Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-33953

embeddable-build-status images are returned as 404 non-jenkins admins

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      v2.0-beta1

      Description

      embeddable-build-status images are returned as 404 non-jenkins admins.
      They work well for all users that are admins in Jenkins but for all others they return 404 even if I used that was supposed to be the public view URL: https://jenkins.example.com/buildStatus/icon?job=orgname/reponame/master

      Note: this may be specific to the github-organization plugin because all our jobs are already migrated to this type of job.

      We are using GitHub authentication integration but probably this is not related to the issue as we expect these to be accessible even for anonymous users.

        Attachments

          Activity

          Hide
          jmccance Joel McCance added a comment -

          I've been running into what may be a related issue. We aren't using GitHub, but we are using pipeline jobs and our feature branches have a slash in the name (e.g., feature/1234-fix-the-thing).

          Branches that do not have a slash in the name work fine (like master). Branches that do have a slash in the name return a 404 when we try to use the unprotected link.

          For example, we have a pipeline project called "customer-service". The following path works fine:

          /jenkins/buildStatus/icon?job=customer-service/master

          This path does not:

          /jenkins/buildStatus/icon?job=customer-service/feature%2F1234-fix-the-thing

          Show
          jmccance Joel McCance added a comment - I've been running into what may be a related issue. We aren't using GitHub, but we are using pipeline jobs and our feature branches have a slash in the name (e.g., feature/1234-fix-the-thing). Branches that do not have a slash in the name work fine (like master). Branches that do have a slash in the name return a 404 when we try to use the unprotected link. For example, we have a pipeline project called "customer-service". The following path works fine: /jenkins/buildStatus/icon?job=customer-service/master This path does not: /jenkins/buildStatus/icon?job=customer-service/feature%2F1234-fix-the-thing
          Hide
          leodj Leo DJ added a comment - - edited

          I just ran into the same issue as you Joel McCance.

          After a few hours of probing around with permissions for multibranch embeddable build status and whatnot, I finally found the culprit.

           

          Thing is, as you already found out, Jenkins somehow does not like slashes in branch names.

          There might be some internal bug in the Jenkins Webserver, that %2F is actually turned back into a slash and parsed like an URL path or something like that, I don't know exactly.

           

          But the solution is, that you also need to escape the percent sign in the URL, so that the slash is double escaped. (%2F turns into %252F)

          Not working: /jenkins/buildStatus/icon?job=customer-service/feature %2F 1234-fix-the-thing
          Working: /jenkins/buildStatus/icon?job=customer-service/feature %252F 1234-fix-the-thing

           

          At least that worked for me

          Show
          leodj Leo DJ added a comment - - edited I just ran into the same issue as you Joel McCance . After a few hours of probing around with permissions for multibranch embeddable build status and whatnot, I finally found the culprit.   Thing is, as you already found out, Jenkins somehow does not like slashes in branch names. There might be some internal bug in the Jenkins Webserver, that %2F is actually turned back into a slash and parsed like an URL path or something like that, I don't know exactly.   But the solution is, that you also need to escape the percent sign in the URL, so that the slash is double escaped. (%2F turns into %252F) Not working: /jenkins/buildStatus/icon?job=customer-service/feature %2F 1234-fix-the-thing Working: /jenkins/buildStatus/icon?job=customer-service/feature %252F 1234-fix-the-thing   At least that worked for me

            People

            • Assignee:
              amuniz Antonio Muñiz
              Reporter:
              ssbarnea Sorin Sbarnea
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: