Double-encoding issues with multi-branch jobs containing slashes

Description

We're trying out the Jenkins integration in our JIRA instance, but unfortunately it doesn't seem to be working with our git branch setup and the multi-branch configuration in Jenkins. We make heavy use of slashes to categorise our git branches, but it appears that the plugin doesn't support this correctly.

First off, you can see from the attached screenshot that the Jenkins job names are being displayed with the slashes percent-encoded:

 

It looks like it also has the same issue when it comes to making the API requests to sync data, as per the access logs from our Jenkins server:

 

jenkins [24/Nov/2017:10:43:46 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:43:46 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:43:46 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:43:46 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:44:42 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:44:42 +0000] "GET /job/zedcore/api/json/ HTTP/1.1" 200 6637 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:48:53 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:48:53 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-3250_SwitchOffESRExportsSingleApp/api/json/ HTTP/1.1" 404 322 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:27 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:27 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:27 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:27 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:28 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:28 +0000] "GET /job/zedcore/api/json/ HTTP/1.1" 200 6659 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:30 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:30 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-3250_SwitchOffESRExportsSingleApp/api/json/ HTTP/1.1" 404 322 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:32 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:51:32 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-4423-hotfix/api/json/ HTTP/1.1" 404 305 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:55:06 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:55:06 +0000] "GET /job/zedcore/api/json/ HTTP/1.1" 200 6659 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:55:08 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:55:08 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-3250_SwitchOffESRExportsSingleApp/api/json/ HTTP/1.1" 404 322 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:55:10 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:55:10 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-4423-hotfix/api/json/ HTTP/1.1" 404 305 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:55:37 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:55:37 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:56:03 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:56:03 +0000] "GET /job/zedcore/api/json/ HTTP/1.1" 200 6659 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:56:05 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:56:05 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-3250_SwitchOffESRExportsSingleApp/api/json/ HTTP/1.1" 404 322 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:56:07 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:56:07 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-4423-hotfix/api/json/ HTTP/1.1" 404 305 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:56:23 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:56:23 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:57:17 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:57:17 +0000] "GET /job/zedcore/job/nursingnet%25252Frelease%25252F2018%25252F1/api/json/ HTTP/1.1" 404 305 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:57:18 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:57:18 +0000] "GET /job/zedcore/job/nursingnet%25252Frelease%25252F2017%25252F8/api/json/ HTTP/1.1" 404 305 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:58:31 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:10:58:31 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:02:57 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:02:57 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:02:57 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:02:57 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:02:58 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:02:58 +0000] "GET /job/zedcore/api/json/ HTTP/1.1" 200 6659 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:03:00 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:03:00 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-3250_SwitchOffESRExportsSingleApp/api/json/ HTTP/1.1" 404 322 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:03:02 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:03:02 +0000] "GET /job/zedcore/job/nursingnet%25252FTRAC-4423-hotfix/api/json/ HTTP/1.1" 404 305 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:03:02 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:03:02 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:03:02 +0000] "GET /job/zedcore/job/nursingnet%25252Frelease%25252F2017%25252F8/api/json/ HTTP/1.1" 404 305 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:03:02 +0000] "GET /job/zedcore/job/nursingnet%25252Frelease%25252F2018%25252F1/api/json/ HTTP/1.1" 404 305 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:07:31 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:07:31 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:07:31 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:07:31 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:43:34 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:43:34 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:43:34 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:43:34 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:45:02 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:45:02 +0000] "GET /plugin/jenkins-jira-plugin/ping.html HTTP/1.1" 404 286 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:45:20 +0000] "GET /api/json/ HTTP/1.1" 200 791 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)" jenkins [24/Nov/2017:11:45:20 +0000] "GET /job/zedcore/job/nursingnet%25252Frelease%25252F2017%25252F05/api/json/ HTTP/1.1" 404 306 "-" "Apache-HttpClient/4.4.1 (Java/1.8.0_131)"

I think this is also why the "auto add new jobs" feature is constantly adding the new branches that appear and immediately deciding they've been deleted...

Environment

JIRA 7.3.7 Jenkins 2.91 (with nginx reverse-proxy providing SSL)

Attachments

6
  • 29 Nov 2017, 07:55 PM
  • 29 Nov 2017, 07:27 PM
  • 29 Nov 2017, 07:27 PM
  • 29 Nov 2017, 07:26 PM
  • 29 Nov 2017, 05:48 PM
  • 24 Nov 2017, 11:50 AM

Activity

Show:

Mark Rekveld November 30, 2017 at 4:48 PM

Corrected the double encoding issue.

Kalle Niemitalo November 29, 2017 at 7:58 PM

Attached multibranch-252f.json from https://REDACTED/jenkins/job/migration/api/json

I redacted the hostname but that's the only change.

The branch URL has %252F in it, and it really works when I open it in a browser.

Mark Rekveld November 29, 2017 at 7:57 PM

Thanks for the JSON, I see the likely issue and will try to get a fix out soon.

Mark Rekveld November 29, 2017 at 7:55 PM

I'll also try to run some tests with the branches plugin installed in Jenkins to see what is going on.

Mark Rekveld November 29, 2017 at 7:40 PM

Thanks for the information .

I ran some tests, but I doesn't look like its the generation of the URL that is not handling the slashes, but rather the storage of the url name of a job.
In the 2.3.x branch the URL generation would update the %2F to /, but the %2F should not be stored in the first place, making me wonder is the url shared by the JSON API of Jenkins is encoding the urls of branch jobs differently then that of "normal" jobs.

To test this, can you share the JSON API output of the job that contains the branch jobs? This can be done easily by navigating to the job in Jenkins and adding /api/json/ to the URL.
The output should contain details of the job you where watching, but also have basic details on the branch sub-jobs.

If you could attach this, or alternately mail it to support@marvelution.com.

Then I can use that to see if the parsing needs to be tweaked.

Cheers,
Mark

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Zoom

Open Zoom
Created November 24, 2017 at 11:52 AM
Updated December 7, 2017 at 4:08 PM
Resolved November 30, 2017 at 4:48 PM
Zoom