Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,926
Community Members
 
Community Events
165
Community Groups

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

Edited

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

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

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/

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.

That did it.  Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

954 views 3 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you