You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you leave your Jenkins URL pointing at localhost under Manage Jenkins->Configure System->Jenkins Location->Jenkins URL when an api call is made by com.cloudbees.jenkins.plugins.bitbucket.client.BitBucketCloudApiAdapter for:
POST /api/2.0/repositories/<org>/<repo>/<commit>/statuses/build
It will fail with the error:
This response was received:{"error": {"fields": {"url": ["Enter a valid URL."]}, "message": "Bad request"}}
The reason for this is when you leave your Jenkins URL configured for localhost, somewhere along the way the URL is replaced with http://unconfigured-jenkins-location/... When this is passed into the POST body like so:
{"description":"The tests have started...","state":"INPROGRESS","url":"http://unconfigured-jenkins-location/job/myrepo/job/myjob/11/","key":"JENKINS-2","name":"#11"}
The BitBucket API will complain with the aforementioned error.
WORKAROUND:
If you go in and just change the Jenkins URL, everything works right. Even if you change the Jenkins URL back to localhost it's enough just so that field is dirtied and then written to the configuration.
The text was updated successfully, but these errors were encountered:
ctataryn
referenced
this issue
in ctataryn/bitbucket-branch-source-plugin
Oct 7, 2016
I've encountered a problem with 'unconfigured-jenkins-location' when trying to reach the jenkins build from bitbucket pull request. The URL pointed to http://unconfigured-jenkins-location/... , while the 'Jenkins location' in the jenkins configuration was supplied correctly.
Maybe because the bitbucket-branch-source-plugin was installed áfter the 'Jenkins location' was specified in the jenkins configuration, the URL was not set in the plugin configuration. After altering the jenkins location and then changing it back to the correct URL, the issue was resolved. Now bitbucket receives the correct url to jenkins for pull request builds. This imo confirms the workaround decribed above.
If you leave your Jenkins URL pointing at
localhost
underManage Jenkins->Configure System->Jenkins Location->Jenkins URL
when an api call is made bycom.cloudbees.jenkins.plugins.bitbucket.client.BitBucketCloudApiAdapter
for:It will fail with the error:
The reason for this is when you leave your Jenkins URL configured for localhost, somewhere along the way the URL is replaced with
http://unconfigured-jenkins-location/...
When this is passed into the POST body like so:The BitBucket API will complain with the aforementioned error.
WORKAROUND:
If you go in and just change the Jenkins URL, everything works right. Even if you change the Jenkins URL back to
localhost
it's enough just so that field is dirtied and then written to the configuration.The text was updated successfully, but these errors were encountered: