api-commandline-tool icon indicating copy to clipboard operation
api-commandline-tool copied to clipboard

"bt rename" returns 404, seems to be wrong URL.

Open yutaoshima opened this issue 3 years ago • 9 comments

$ ./act.sh bt rename -b 92204 -n ReanmeTestBT

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>AppDynamics - Error report</title><style type="text/css"><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Not Found</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>Not Found</p><p><b>description</b>The requested resource is not available.</p><hr/><h3>AppDynamics</h3></body></html>

yutaoshima avatar Dec 10 '21 06:12 yutaoshima

@yutaoshima please check if you can get it to work with the code I just pushed to the repository.

svrnm avatar Dec 10 '21 10:12 svrnm

It returns 500 as the below.

$ ./act.sh version
v21.4.0 ~ 9b200d473e5c26fa65f6aa112a34c648a3dc0645 (150 commands)

$ ./act.sh bt rename -b 92204 -n RenameTestBT
<html><body><h1>500 Internal Server Error</h1><br/>Exception Id:a3253467-bc89-4884-9327-4fea30bfc9e2<br/></body></html>

yutaoshima avatar Dec 13 '21 02:12 yutaoshima

@yutaoshima what controller version are you using? can you run it in debug mode (-vvv), remove all sensitive data from the output and share it here? thanks.

svrnm avatar Dec 13 '21 09:12 svrnm

Thanks, @svrnm.
Controller is build 21.11.1-778. (The others than "bt rename" seems to work.)
The result of the command with -vvv is the below.
----------------

$ ./act.sh -vvv bt rename -b 92204 -n RenameTestBT
DEBUG: CONFIG_CONTROLLER_HOST=appd-se-jpn.saas.appdynamics.com
DEBUG: CONFIG_CONTROLLER_CREDENTIALS=XXXXXX
DEBUG: CONFIG_CONTROLLER_COOKIE_LOCATION=/Users/yutoshim/.appdynamics/act/cookie.txt
DEBUG: CONFIG_OUTPUT_VERBOSITY=error,output,warn,info,debug
DEBUG: CONFIG_USER_PLUGIN_DIRECTORY=/Users/yutoshim/.appdynamics/act/plugins
DEBUG: bt has commands
DEBUG: bt_rename is a valid command
DEBUG: Unparsed endpoint is /controller/restui/v1/bt/renameBT?id={{b:business_transaction}}
DEBUG: Unparsed payload is {{n:business_transaction_name}}
DEBUG: Identified Options: n:b:
DEBUG: Identified Types: n:business_transaction_name b:business_transaction
DEBUG: Optional Options: 
DEBUG: Applying b with 92204
DEBUG: Applying n with RenameTestBT
DEBUG: With form: 0
DEBUG: Call Controller with -d RenameTestBT -X POST /controller/restui/v1/bt/renameBT?id=92204
DEBUG: Calling appd-se-jpn.saas.appdynamics.com
DEBUG: -d RenameTestBT -X POST /controller/restui/v1/bt/renameBT?id=92204
DEBUG: Login at appd-se-jpn.saas.appdynamics.com with XXXXXX
DEBUG: RESPONSE: DEBUG: curl -L --connect-timeout 10 -sI -c /Users/yutoshim/.appdynamics/act/cookie.txt --user XXXXXX appd-se-jpn.saas.appdynamics.com/controller/auth?action=login
HTTP/1.1 302 Moved Temporarily
Content-Length: 69
Date: Tue, 14 Dec 2021 00:29:06 GMT
Location: https://appd-se-jpn.saas.appdynamics.com/controller/auth?action=login
X-Content-Type-Options: nosniff
Connection: keep-alive

HTTP/1.1 200 OK
cache-control: no-cache, no-store, max-age=0, must-revalidate
Content-Length: 0
Date: Tue, 14 Dec 2021 00:29:07 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Server: AppDynamics
Set-Cookie: JSESSIONID=657cd96bd6803a9e06b96c658a16; Path=/controller; HttpOnly; Secure
Set-Cookie: X-CSRF-TOKEN=c2183355d6434cf29305942f67ecab4863f2eb3d; Path=/controller; Secure
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Connection: keep-alive

DEBUG: XCSRFTOKEN: c2183355d6434cf29305942f67ecab4863f2eb3d
DEBUG: Login result: Controller Login Successful
DEBUG: Endpoint: /controller/restui/v1/bt/renameBT?id=92204
Note: Unnecessary use of -X or --request, POST is already inferred.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 13.238.80.31...
* TCP_NODELAY set
* Connected to appd-se-jpn.saas.appdynamics.com (13.238.80.31) port 80 (#0)
> POST /controller/restui/v1/bt/renameBT?id=92204 HTTP/1.1
> Host: appd-se-jpn.saas.appdynamics.com
> User-Agent: curl/7.64.1
> X-CSRF-TOKEN: c2183355d6434cf29305942f67ecab4863f2eb3d
> Content-Type: application/json;charset=UTF-8
> Accept: application/json, text/plain, */*
> Content-Length: 12
> 
} [12 bytes data]
* upload completely sent off: 12 out of 12 bytes
< HTTP/1.1 302 Moved Temporarily
< Date: Tue, 14 Dec 2021 00:29:07 GMT
< Location: https://appd-se-jpn.saas.appdynamics.com/controller/restui/v1/bt/renameBT?id=92204
< X-Content-Type-Options: nosniff
< Content-Length: 82
< Connection: keep-alive
< 
* Ignoring the response-body
{ [82 bytes data]
100    94  100    82  100    12    381     55 --:--:-- --:--:-- --:--:--   437
* Connection #0 to host appd-se-jpn.saas.appdynamics.com left intact
* Issue another request to this URL: 'https://appd-se-jpn.saas.appdynamics.com/controller/restui/v1/bt/renameBT?id=92204'
* Switch from POST to GET
*   Trying 13.238.80.31...
* TCP_NODELAY set
* Connected to appd-se-jpn.saas.appdynamics.com (13.238.80.31) port 443 (#1)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
} [246 bytes data]
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* TLSv1.2 (IN), TLS handshake, Server hello (2):
{ [89 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [2973 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [333 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [70 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
{ [1 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=AppDynamics LLC; CN=*.saas.appdynamics.com
*  start date: Aug  8 00:00:00 2021 GMT
*  expire date: Sep  8 23:59:59 2022 GMT
*  subjectAltName: host "appd-se-jpn.saas.appdynamics.com" matched cert's "*.saas.appdynamics.com"
*  issuer: C=US; O=DigiCert Inc; CN=DigiCert TLS RSA SHA256 2020 CA1
*  SSL certificate verify ok.
> POST /controller/restui/v1/bt/renameBT?id=92204 HTTP/1.1
> Host: appd-se-jpn.saas.appdynamics.com
> User-Agent: curl/7.64.1
> Cookie: X-CSRF-TOKEN=c2183355d6434cf29305942f67ecab4863f2eb3d; JSESSIONID=657cd96bd6803a9e06b96c658a16
> X-CSRF-TOKEN: c2183355d6434cf29305942f67ecab4863f2eb3d
> Content-Type: application/json;charset=UTF-8
> Accept: application/json, text/plain, */*
> 
< HTTP/1.1 500 Internal Server Error
< cache-control: no-cache, no-store, max-age=0, must-revalidate
< Content-Type: text/html;charset=ISO-8859-1
< Date: Tue, 14 Dec 2021 00:29:07 GMT
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Pragma: no-cache
< Server: AppDynamics
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< Content-Length: 119
< Connection: keep-alive
< 
{ [119 bytes data]
100   119  100   119    0     0    176      0 --:--:-- --:--:-- --:--:--   466
* Connection #1 to host appd-se-jpn.saas.appdynamics.com left intact
* Closing connection 0
* Closing connection 1
DEBUG: Command result: (DEBUG: curl -L --connect-timeout 10 -v -b /Users/yutoshim/.appdynamics/act/cookie.txt -X POST -H X-CSRF-TOKEN: c2183355d6434cf29305942f67ecab4863f2eb3d -H Content-Type: application/json;charset=UTF-8 -H Accept: application/json, text/plain, */* -d RenameTestBT -w ==========act-stats: 20093-16459-7147-6616%{http_code} appd-se-jpn.saas.appdynamics.com/controller/restui/v1/bt/renameBT?id=92204
<html><body><h1>500 Internal Server Error</h1><br/>Exception Id:52f8d385-1630-462f-acef-ac4c9af6fd60<br/></body></html>)
INFO: HTTP Status Code: 500
DEBUG: curl -L --connect-timeout 10 -v -b /Users/yutoshim/.appdynamics/act/cookie.txt -X POST -H X-CSRF-TOKEN: c2183355d6434cf29305942f67ecab4863f2eb3d -H Content-Type: application/json;charset=UTF-8 -H Accept: application/json, text/plain, */* -d RenameTestBT -w ==========act-stats: 20093-16459-7147-6616%{http_code} appd-se-jpn.saas.appdynamics.com/controller/restui/v1/bt/renameBT?id=92204
<html><body><h1>500 Internal Server Error</h1><br/>Exception Id:52f8d385-1630-462f-acef-ac4c9af6fd60<br/></body></html>
DEBUG: END

yutaoshima avatar Dec 14 '21 00:12 yutaoshima

odd, it works for me ... what's the version of the controller?

svrnm avatar Dec 14 '21 13:12 svrnm

Controller is build 21.11.1-778. What version did you test?

yutaoshima avatar Dec 15 '21 00:12 yutaoshima

Same version, that's odd, would it be possible to share access on that controller with me?

svrnm avatar Dec 15 '21 13:12 svrnm

I created your account on my controller, so I believe the welcome mail is sent to you.

yutaoshima avatar Dec 16 '21 02:12 yutaoshima

Sorry but I confirmed it works by changing appd-se-jpn.saas.appdynamics.com to https://appd-se-jpn.saas.appdynamics.com on config.sh. Thanks @svrnm !

yutaoshima avatar Dec 16 '21 02:12 yutaoshima