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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,462,801
Community Members
 
Community Events
176
Community Groups

Bamboo REST API returning Connection Timeout

When attempting to trigger a test plan using the Bamboo REST API, a connection timeout is occurring. The code and corresponding error are shown below.

Code:

base_url = "http://bamboo.delawarenorth.com:8085/rest/api/latest/"
execution_response = requests.post(
base_url + "queue/EDC-NITCS",
auth=(args['<user>'], args['<password>']),
data="JOB1&ExecuteAllStages",
headers={'Accept': 'application/json'}
).json()

Error:

17-Jan-2023 17:40:32Traceback (most recent call last):
17-Jan-2023 17:40:32  File "scripts/validate_staging_environment.py", line 54, in <module>
17-Jan-2023 17:40:32    main(docopt(__doc__))
17-Jan-2023 17:40:32  File "scripts/validate_staging_environment.py", line 32, in main
17-Jan-2023 17:40:32    headers={'Accept': 'application/json'}).json()
17-Jan-2023 17:40:32  File "/home/bamboo/.local/share/virtualenvs/19496961-76316673-E-qKXQIp/lib/python3.6/site-packages/requests/models.py", line 897, in json
17-Jan-2023 17:40:32    return complexjson.loads(self.text, **kwargs)
17-Jan-2023 17:40:32  File "/home/bamboo/.local/share/virtualenvs/19496961-76316673-E-qKXQIp/lib/python3.6/site-packages/simplejson/__init__.py", line 525, in loads
17-Jan-2023 17:40:32    return _default_decoder.decode(s)
17-Jan-2023 17:40:32  File "/home/bamboo/.local/share/virtualenvs/19496961-76316673-E-qKXQIp/lib/python3.6/site-packages/simplejson/decoder.py", line 372, in decode
17-Jan-2023 17:40:32    obj, end = self.raw_decode(s)
17-Jan-2023 17:40:32  File "/home/bamboo/.local/share/virtualenvs/19496961-76316673-E-qKXQIp/lib/python3.6/site-packages/simplejson/decoder.py", line 402, in raw_decode
17-Jan-2023 17:40:32    return self.scan_once(s, idx=_w(s, idx).end())
17-Jan-2023 17:40:32

simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

My team has done the following:

  • Stopped and started Bamboo.
  • Re-created the issue in a local script (received a timeout).
  • `curl`ed the endpoint (again received a timeout).

What are next steps we can take to resolve this issue?

1 answer

Hello @Jake Roach

Welcome to Atlassian Community!

Can you connect to the main Bamboo URL via curl? Does that work with an authenticated user as well?

Timing out may be something other than Bamboo such as a Reverse Proxy, a Firewall, etc so you need to make sure that you can reach Bamboo on the specified port and hostname.

I was able to trigger a build using the code inspired by the Bamboo REST API documentation.

Ran this:

#!/usr/bin/python3
# This code sample uses the 'requests' library:
# http://docs.python-requests.org
import requests
import json

url = "https://bamboo.mydomain.net/rest/api/latest/queue/ABC-MF1"

headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}

response = requests.request(
"POST",
url,
headers=headers,
auth=('admin', 'admin')
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

Got this:

{
    "buildNumber": 5,
    "buildResultKey": "ABC-MF1-5",
    "link": {
        "href": "https://bamboo.mydomain.net/rest/api/latest/result/ABC-MF1-5",
        "rel": "self"
    },
    "planKey": "ABC-MF1",
    "triggerReason": "Manual build"
}

Sincerely,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events