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

Multibranch fails if gerrit lives at a subdirectory

    Details

    • Similar Issues:
    • Released As:
      gerrit-code-review-0.2

      Description

      I enabled the http scheme this evening and tried to set up a multibranch job. I put in the clone URL - http://gerrit/gerrit/a/repo - and received the following error:

      ERROR: [Sun Apr 22 23:25:24 EDT 2018] Could not fetch branches from source bc69d1d2-f5e2-4030-a2d4-a322692fddaf
      com.urswolfer.gerrit.client.rest.http.HttpStatusException: Request not successful. Message: Not Found. Status-Code: 404. Content: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <html><head>
      <title>404 Not Found</title>
      </head><body>
      <h1>Not Found</h1>
      <p>The requested URL /a/changes/ was not found on this server.</p>
      <hr>
      <address>Apache/2.4.18 (Ubuntu) Server at gerrit Port 80</address>
      </body></html>.
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.throwHttpStatusException(GerritRestClient.java:467)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCodeError(GerritRestClient.java:454)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCodeClientError(GerritRestClient.java:440)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCode(GerritRestClient.java:432)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.request(GerritRestClient.java:227)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestRest(GerritRestClient.java:163)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestRest(GerritRestClient.java:155)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestJson(GerritRestClient.java:132)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.getRequest(GerritRestClient.java:101)
      	at com.urswolfer.gerrit.client.rest.http.changes.ChangesRestClient.get(ChangesRestClient.java:113)
      	at com.urswolfer.gerrit.client.rest.http.changes.ChangesRestClient.access$000(ChangesRestClient.java:35)
      	at com.urswolfer.gerrit.client.rest.http.changes.ChangesRestClient$1.get(ChangesRestClient.java:78)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource.getOpenChanges(AbstractGerritSCMSource.java:175)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource.access$100(AbstractGerritSCMSource.java:59)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.discoverBranches(AbstractGerritSCMSource.java:124)
      Caused: java.io.IOException
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.discoverBranches(AbstractGerritSCMSource.java:156)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.run(AbstractGerritSCMSource.java:98)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.run(AbstractGerritSCMSource.java:82)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource.doRetrieve(AbstractGerritSCMSource.java:497)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource.retrieve(AbstractGerritSCMSource.java:81)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:357)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:267)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:633)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1024)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      [Sun Apr 22 23:25:24 EDT 2018] Finished branch indexing. Indexing took 1.4 sec
      FATAL: Failed to recompute children of Folder » mb
      java.io.IOException: com.urswolfer.gerrit.client.rest.http.HttpStatusException: Request not successful. Message: Not Found. Status-Code: 404. Content: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <html><head>
      <title>404 Not Found</title>
      </head><body>
      <h1>Not Found</h1>
      <p>The requested URL /a/changes/ was not found on this server.</p>
      <hr>
      <address>Apache/2.4.18 (Ubuntu) Server at gerrit Port 80</address>
      </body></html>.
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.discoverBranches(AbstractGerritSCMSource.java:156)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.run(AbstractGerritSCMSource.java:98)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.run(AbstractGerritSCMSource.java:82)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource.doRetrieve(AbstractGerritSCMSource.java:497)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource.retrieve(AbstractGerritSCMSource.java:81)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:357)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:267)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:633)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1024)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Caused by: com.urswolfer.gerrit.client.rest.http.HttpStatusException: Request not successful. Message: Not Found. Status-Code: 404. Content: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <html><head>
      <title>404 Not Found</title>
      </head><body>
      <h1>Not Found</h1>
      <p>The requested URL /a/changes/ was not found on this server.</p>
      <hr>
      <address>Apache/2.4.18 (Ubuntu) Server at gerrit Port 80</address>
      </body></html>.
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.throwHttpStatusException(GerritRestClient.java:467)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCodeError(GerritRestClient.java:454)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCodeClientError(GerritRestClient.java:440)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCode(GerritRestClient.java:432)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.request(GerritRestClient.java:227)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestRest(GerritRestClient.java:163)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestRest(GerritRestClient.java:155)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestJson(GerritRestClient.java:132)
      	at com.urswolfer.gerrit.client.rest.http.GerritRestClient.getRequest(GerritRestClient.java:101)
      	at com.urswolfer.gerrit.client.rest.http.changes.ChangesRestClient.get(ChangesRestClient.java:113)
      	at com.urswolfer.gerrit.client.rest.http.changes.ChangesRestClient.access$000(ChangesRestClient.java:35)
      	at com.urswolfer.gerrit.client.rest.http.changes.ChangesRestClient$1.get(ChangesRestClient.java:78)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource.getOpenChanges(AbstractGerritSCMSource.java:175)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource.access$100(AbstractGerritSCMSource.java:59)
      	at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.discoverBranches(AbstractGerritSCMSource.java:124)
      	... 12 more
      

      I don't think there's currently a workaround for this other than mapping /a to /gerrit/a on my server. Am I correct?

        Attachments

          Issue Links

            Activity

            Hide
            aschrijnen Auke Schrijnen added a comment -

            I have created a pull request which fixes this issue: https://github.com/jenkinsci/gerrit-code-review-plugin/pull/8

            Show
            aschrijnen Auke Schrijnen added a comment - I have created a pull request which fixes this issue:  https://github.com/jenkinsci/gerrit-code-review-plugin/pull/8
            Hide
            nickbrealey Nick Brealey added a comment - - edited

            I tried your changes and it mostly worked.

            I needed more changes to get gerrit.review() to work in the Jenkinsfile.

            The attached patch works for me but there is probably a better way of doing it

            git-review.patch

            (This includes the fix for JENKINS-49985).

            Show
            nickbrealey Nick Brealey added a comment - - edited I tried your changes and it mostly worked. I needed more changes to get gerrit.review() to work in the Jenkinsfile. The attached patch works for me but there is probably a better way of doing it git-review.patch (This includes the fix for  JENKINS-49985 ).

              People

              • Assignee:
                lucamilanesio Luca Domenico Milanesio
                Reporter:
                wsaxon Will Saxon
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: