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

Environment variables not being set when Gerrit 2.14

    Details

    • Similar Issues:

      Description

      For some reason the environment variables are not created for open changes in multibranch pipeline. I tried with GerritHub (latest version of Gerrit) and it seems to be working fine, however, with my local Gerrit implementation (v2.14) this issue happens. Only these environment variables are being set (I'm testing with sh 'printenv'): 

      • GERRIT_API_URL
      • GERRIT_PROJECT
      • GERRIT_CREDENTIALS_ID

        Attachments

          Activity

          Hide
          lucamilanesio Luca Domenico Milanesio added a comment -

          Gerrit v2.14 is EOL (see https://www.gerritcodereview.com/support.html). Have you considered upgrading?

          Do you see any error on the Gerrit logs? Or on the Jenkins logs?

          Show
          lucamilanesio Luca Domenico Milanesio added a comment - Gerrit v2.14 is EOL (see  https://www.gerritcodereview.com/support.html ). Have you considered upgrading? Do you see any error on the Gerrit logs? Or on the Jenkins logs?
          Hide
          felipecassiors Felipe Santos added a comment -

          The upgrade to Gerrit 3.0 in our company is scheduled on the road-map for Q4 2020 (and I would love to change this, sadly I can't).

          The log isn't very clear. Did I configured it right? 

          Show
          felipecassiors Felipe Santos added a comment - The upgrade to Gerrit 3.0 in our company is scheduled on the road-map for Q4 2020 (and I would love to change this, sadly I can't). The log isn't very clear. Did I configured it right? 
          Hide
          felipecassiors Felipe Santos added a comment -

          By using that logger configuration, I see one error that just occurs when trying to build an open change. The error happens all the time after hitting the button "Build now", only stops when the build finishes. Does't happen when trying to build from a branch (not a open change). The error seems to be the same every time, however, the stack trace is different. Log is attached to do not pollute the chat: gerrit-code-review-plugin.log
           
          Dec 09, 2019 9:44:10 PM SEVERE jenkins.plugins.gerrit.ProjectChanges get
          Unable to retrieve change 6566742
          Dec 09, 2019 9:44:10 PM FINER jenkins.plugins.gerrit.ProjectChanges get
          THROW
          com.urswolfer.gerrit.client.rest.http.HttpStatusException: Request not successful. Message: Bad Request. Status-Code: 400. Content: "TRACKING_IDS" is not a valid value for "-o".
              at com.urswolfer.gerrit.client.rest.http.GerritRestClient.throwHttpStatusException(GerritRestClient.java:494)
           
           

          Show
          felipecassiors Felipe Santos added a comment - By using that logger configuration, I see one error that just occurs when trying to build an open change. The error happens all the time after hitting the button "Build now", only stops when the build finishes. Does't happen when trying to build from a branch (not a open change). The error seems to be the same every time, however, the stack trace is different. Log is attached to do not pollute the chat:  gerrit-code-review-plugin.log   Dec 09, 2019 9:44:10 PM SEVERE jenkins.plugins.gerrit.ProjectChanges get Unable to retrieve change 6566742 Dec 09, 2019 9:44:10 PM FINER jenkins.plugins.gerrit.ProjectChanges get THROW com.urswolfer.gerrit.client.rest.http.HttpStatusException: Request not successful. Message: Bad Request. Status-Code: 400. Content: "TRACKING_IDS" is not a valid value for "-o".     at com.urswolfer.gerrit.client.rest.http.GerritRestClient.throwHttpStatusException(GerritRestClient.java:494)    
          Hide
          lucamilanesio Luca Domenico Milanesio added a comment -

          I believe this is more an issue with the GerritRestClient (see https://github.com/uwolfer/gerrit-rest-java-client). Will have a look on that code-base to see what is needed to support Gerrit v2.14 or earlier.

          Show
          lucamilanesio Luca Domenico Milanesio added a comment - I believe this is more an issue with the GerritRestClient (see  https://github.com/uwolfer/gerrit-rest-java-client ). Will have a look on that code-base to see what is needed to support Gerrit v2.14 or earlier.
          Hide
          lucamilanesio Luca Domenico Milanesio added a comment -

          Raised as https://github.com/uwolfer/gerrit-rest-java-client/issues/97.

          As soon as the Gerrit REST API java layer will be fixed, I'll include it in the plugin.

          Thanks for raising it and for providing meaningful and comprehensive logs for reproducing . the issue.

          Show
          lucamilanesio Luca Domenico Milanesio added a comment - Raised as  https://github.com/uwolfer/gerrit-rest-java-client/issues/97. As soon as the Gerrit REST API java layer will be fixed, I'll include it in the plugin. Thanks for raising it and for providing meaningful and comprehensive logs for reproducing . the issue.
          Hide
          felipecassiors Felipe Santos added a comment -

          Awesome! I just saw the Issue there. You're very welcome and thank you so much.

          Show
          felipecassiors Felipe Santos added a comment - Awesome! I just saw the Issue there. You're very welcome and thank you so much.
          Hide
          lucamilanesio Luca Domenico Milanesio added a comment -

          I am trying to downgrade for the time being the Gerrit REST API java layer, so that compatibility with Gerrit v2.14 is resumed.

          Show
          lucamilanesio Luca Domenico Milanesio added a comment - I am trying to downgrade for the time being the Gerrit REST API java layer, so that compatibility with Gerrit v2.14 is resumed.
          Hide
          lucamilanesio Luca Domenico Milanesio added a comment -
          Show
          lucamilanesio Luca Domenico Milanesio added a comment - It looks like the downgrade would work for now: https://review.gerrithub.io/c/jenkinsci/gerrit-code-review-plugin/+/478951
          Hide
          felipecassiors Felipe Santos added a comment -

          I loaded the generated plugin into my Jenkins and I can confirm now all the environment variables is being set.

          Show
          felipecassiors Felipe Santos added a comment - I loaded the generated plugin into my Jenkins and I can confirm now all the environment variables is being set.
          Hide
          felipecassiors Felipe Santos added a comment -

          I think this Issue can be closed now, don't you think?

          Show
          felipecassiors Felipe Santos added a comment - I think this Issue can be closed now, don't you think?

            People

            • Assignee:
              lucamilanesio Luca Domenico Milanesio
              Reporter:
              felipecassiors Felipe Santos
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: