Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

wait does not work on multibranch pipelines

Kasper Tofte
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 21, 2025

I am trying to use jenkins-job-trigger to trigger the scan Multibranch. It does work without the wait, but If I add a wait I get the error below. From my manual debugging it seems the error occurs because the POST request on the build endpoint gets redirected, which looses the location header.

It works fine for jobs inside the multibranch project.

I would like to wait for the scan to complete before I continue my pipeline. I have worked around it using some manual curl commands.

 

This is my usage of the pipe:

- pipe: atlassian/jenkins-job-trigger:0.10.0
variables:
JENKINS_URL: 'https:<my_jenkins_url>/job'
JENKINS_USER: $jenkins_user
JENKINS_TOKEN: $jenkins_token
JOB_NAME: 'bitbucket_poc_kto'
WAIT: 'true'
WAIT_MAX_TIME: '300' # seconds
DEBUG: 'true'
This is the error log
Digest: sha256:9a4c0aa1133e6a3058e2dce29b92a640ba3348f908edd9f22f12549e3325ef8d
Status: Downloaded newer image for bitbucketpipelines/jenkins-job-trigger:0.10.0
DEBUG: Starting new HTTPS connection (1): bitbucket.org:443
DEBUG: https://bitbucket.org:443 "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/11" 200 None
INFO: None
INFO: Submitting jenkins job...
DEBUG: Starting new HTTPS connection (1): <my jenkins url>
DEBUG: https://<my jenkins url> "POST /job/bitbucket_poc_kto/build HTTP/11" 302 0
DEBUG: https://<my jenkins url> "GET /job/bitbucket_poc_kto/ HTTP/11" 200 None
Traceback (most recent call last):
File "/pipe.py", line 200, in <module>
pipe.run()
File "/pipe.py", line 191, in run
self.wait_for_job(build_response.headers['Location'])
File "/usr/local/lib/python3.10/site-packages/requests/structures.py", line 52, in __getitem__
return self._store[key.lower()][1]
keyError: 'location'

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events