-
Bug
-
Resolution: Fixed
-
Major
-
atlassian-bitbucket-server-integration-plugin/3.4.1
Jenkins/2.387.1
-
-
3.4.2
After this commit, the requests to our Bitbucket Server instance (v7.21.6) started failing:
bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/k8s/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.3.2 200 /rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/k8s/Jenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.4.1 500 /rest/api/1.0/projects/XYZ/repos/masked/raw/cicd%2FJenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.4.1 500 /rest/api/1.0/projects/XYZ/repos/masked/raw/cicd%2FJenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.4.1 500 /rest/api/1.0/projects/XYZ/repos/masked/raw/cicd%2FJenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1 bitbucket-jenkins-integration/3.4.1 500 /rest/api/1.0/projects/XYZ/repos/masked/raw/cicd%2Fk8s%2FJenkinsfile?at=refs%2Fheads%2Fdevelop HTTP/1.1
The problem seems to be the following:
- Our Jenkinsfile is not in the root directory
- atlassian-bitbucket-server-integration-plugin is using the newest version 3.4.1
- atlassian-bitbucket-server-integration-plugin 3.4.1 is encoding the file path
Thus, the commit above seems to have introduced a regression: the file path is now encoded:
/rest/api/1.0/projects/XYZ/repos/masked/browse/cicd/Jenkinsfile?at=refs%2Fheads%2Fdevelop (3.3.2) becomes /rest/api/1.0/projects/XYZ/repos/masked/raw/cicd%2Fk8s%2FJenkinsfile?at=refs%2Fheads%2Fdevelop (3.4.1)
This in turn causes the following error in Bitbucket:
org.springframework.security.web.firewall.RequestRejectedException: The requestURI cannot contain encoded slash. Got /rest/api/1.0/projects/XYZ/repos/masked/raw/cicd%2FJenkinsfile
and the following error in the Jenkins plugin:
com.atlassian.bitbucket.jenkins.internal.client.exception.ServerErrorException: - response: 500 at com.atlassian.bitbucket.jenkins.internal.http.HttpRequestExecutorImpl.handleError(HttpRequestExecutorImpl.java:151) at com.atlassian.bitbucket.jenkins.internal.http.HttpRequestExecutorImpl.makeRequest(HttpRequestExecutorImpl.java:95) at com.atlassian.bitbucket.jenkins.internal.http.HttpRequestExecutorImpl.performStreamingGet(HttpRequestExecutorImpl.java:174) at com.atlassian.bitbucket.jenkins.internal.http.HttpRequestExecutorImpl.executeStreamingGet(HttpRequestExecutorImpl.java:66) at com.atlassian.bitbucket.jenkins.internal.client.BitbucketRequestExecutor.streamGetRequest(BitbucketRequestExecutor.java:195) at com.atlassian.bitbucket.jenkins.internal.client.BitbucketRequestExecutor.makeStreamingGetRequest(BitbucketRequestExecutor.java:117) at com.atlassian.bitbucket.jenkins.internal.client.BitbucketFilePathClientImpl.getRawFileStream(BitbucketFilePathClientImpl.java:64) at com.atlassian.bitbucket.jenkins.internal.scm.filesystem.BitbucketSCMFile.content(BitbucketSCMFile.java:81) at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:335) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:108) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:312) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442)