Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

API response contains "* Connection #0 bamboo.<companyname>.com left intact."

james_mckean April 14, 2022

I am testing some Bamboo APIs with the goal of writing a report requested by management. I am using cURL until I figure out what works and then will probably move to Ansible.

In all responses I get a string "* Connection #0 bamboo.<companyname>.com left intact." Usually, this is the last line before the json formatted payload and causes no problems.  But if the response is long, the string may get inserted into the middle of the json payload resulting in broken json.

Here is an example snippet (I added the bold)

. . . "plan":{"shortName":"Mod of HelloWorld","shortKey":"MH","type":"chain","enabled":true,"link":{"href":"https://bamboo.dev<companyname>com/rest/api/latest/plan/TABVTJP* Connection #0 to host bamboo.dev.<companyname>.com left intact

-MH","rel":"self"},"key":"TABXXJP-YY","name":"Test availability of BITBUCKET_BRANCH variable to java program - Mod of HelloWorld","planKey":{"key":"TABXXJP-YY"}}, . . .

Does anyone have any suggestions?

1 answer

1 accepted

0 votes
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 14, 2022

Hello @james_mckean

 

Adding a header "Connection: close" to your cURL command line should solve the problem:

  • curl -v -H "Connection: close" https://bamboo.dev.<companyname>.com
    

 

From this page:

Why is the connection left intact:

The connection is left intact, because the server allowed it to stay open and CURL no need to close it after you receive the response for the request sent. That’s why the requests return ‘Connection: keep-alive‘ headers when you expect ‘Connection:close

If you wanted to close the connection, then you could send CURL request with ‘Connection: close‘ as shown below and you could see ‘* Closing connection 0‘ in the response.

Regards,

Eduardo Alvarenga
Atlassian Support APAC

james_mckean April 15, 2022

Hmm. Not exactly. Now it drops the "closing connection " notification into the json response, again breaking the json.

BSR-PLAN"}},{"shortName":"build the specs demo plan","shortKey":"SDP","type":"chain","enabled* Closing connection 1
* TLSv1.2 (OUT), TLS alert, close notify (256):
":false,"link":{"href":"https://bamboo.dev.companyName.com/rest/api/

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 15, 2022

Hello @james_mckean

That message comes from the SSL library that cURL is linked to (usually OpenSSL/LibreSSL) and will show up when using curl with a "-v" flag. Those messages are sent to the standard error output and can be discarded by your script.

Try running it without the "-v" flag.

james_mckean April 27, 2022

That did it.  Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events