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

Not connecting to Gerrit events-log plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: gerrit-trigger-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.636
      gerrit-trigger-plugin 2.17.2
      Gerrit 2.11.4
    • Similar Issues:

      Description

      Hi.
      I have configured gerrit-trigger-plugin, Gerrit and events-log plugin. Rest_API is working, events-log plugin is also accessible (INFO: Gerrit Plugin events-log is installed) but there is no connection to events-log archive (checked also with Wireshark). In the LOG there is no "connectionEstablished" from GerritMissedEventsPlaybackManager. When I remove the events-log plugin there IS "connectionEstablished" from GerritMissedEventsPlaybackManager in the LOG reporting WARNING: Playback of missed events not supported for server dev.local - gerrit!

      On server configuration page there is only warning about not supported "Project created events" which will be available in next release 2.12.
      "Gerrit version is a bit old, so not all Gerrit features are enabled. The following features have been disabled: Project created events requires 2.12"

      -------------------------------------
      LOG with events-log enabled
      -------------------------------------
      Nov 06, 2015 8:26:12 PM com.sonymobile.tools.gerrit.gerritevents.GerritConnection run
      INFO: Starting Up dev.local - gerrit
      Nov 06, 2015 8:26:13 PM com.sonyericsson.hudson.plugins.gerrit.trigger.utils.GerritPluginChecker decodeStatus
      INFO: Gerrit Plugin events-log is installed
      Nov 06, 2015 8:26:13 PM com.sonymobile.tools.gerrit.gerritevents.GerritConnection run
      INFO: Ready to receive data from Gerrit: dev.local - gerrit

      -------------------------------------
      LOG with events-log disabled
      -------------------------------------
      Nov 06, 2015 8:57:58 PM com.sonymobile.tools.gerrit.gerritevents.GerritConnection run
      INFO: Starting Up dev.local - gerrit
      Nov 06, 2015 8:57:59 PM com.sonyericsson.hudson.plugins.gerrit.trigger.utils.GerritPluginChecker decodeStatus
      INFO: Gerrit Plugin events-log is NOT installed
      Nov 06, 2015 8:57:59 PM com.sonyericsson.hudson.plugins.gerrit.trigger.playback.GerritMissedEventsPlaybackManager connectionEstablished
      WARNING: Playback of missed events not supported for server dev.local - gerrit!

      Nov 06, 2015 8:57:59 PM com.sonymobile.tools.gerrit.gerritevents.GerritConnection run
      INFO: Ready to receive data from Gerrit: dev.local - gerrit

        Attachments

          Activity

          Hide
          scoheb Scott Hebert added a comment - - edited

          Hi,

          I think I may have a fix for this.

          But can you please try this:

          1. Enable REST API in Gerrit Trigger setup
          2. Ensure events-log plugin enabled in Gerrit
          3. Restart Jenkins (this is where the bug is...seems the Playback Manager does not get initialized correctly)
          4. Push a change to Gerrit that triggers a build in Jenkins (this will persist a last-known event timestamp for Gerrit Trigger)
          5. Verify that data exists in <jenkins_home>/gerrit-server-event-data/<serverName>/gerrit-trigger-server-timestamps.xml
          6. Stop your Gerrit Connection in Gerrit Trigger configuration.
          7. Push ANOTHER change to Gerrit that triggers a build in Jenkins. (this build will NOT be triggered now since Gerrit Connection is down)
          8. Start Gerrit Connection in Gerrit Trigger configuration.
          9. Verify that build has been triggered
          10. Verify that logs contain: INFO: (X) missed events to process for server:

          Let me know how it goes.

          I will update this issue when I have a viable PR.

          Show
          scoheb Scott Hebert added a comment - - edited Hi, I think I may have a fix for this. But can you please try this: Enable REST API in Gerrit Trigger setup Ensure events-log plugin enabled in Gerrit Restart Jenkins (this is where the bug is...seems the Playback Manager does not get initialized correctly) Push a change to Gerrit that triggers a build in Jenkins (this will persist a last-known event timestamp for Gerrit Trigger) Verify that data exists in <jenkins_home>/gerrit-server-event-data/<serverName>/gerrit-trigger-server-timestamps.xml Stop your Gerrit Connection in Gerrit Trigger configuration. Push ANOTHER change to Gerrit that triggers a build in Jenkins. (this build will NOT be triggered now since Gerrit Connection is down) Start Gerrit Connection in Gerrit Trigger configuration. Verify that build has been triggered Verify that logs contain: INFO: (X) missed events to process for server: Let me know how it goes. I will update this issue when I have a viable PR.
          Show
          scoheb Scott Hebert added a comment - Created PR https://github.com/jenkinsci/gerrit-trigger-plugin/pull/259
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Scott Hebert
          Path:
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/GerritServer.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/playback/GerritMissedEventsPlaybackManager.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/playback/GerritMissedEventsFunctionalTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/DuplicateGerritListenersHudsonTestCase.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/DuplicateGerritListenersPreloadedProjectHudsonTestCase.java
          http://jenkins-ci.org/commit/gerrit-trigger-plugin/35efed719ca198f711ca33401d6815e5468ba723
          Log:
          Correct Missed Events Playback manager init

          It is possible for the Missed Events playback manager to not be correctly initialized
          once the REST API has been enabled AFTER the connection has been started.

          The same issue applies if the Gerrit events-log plugin was installed AFTER the
          Gerrit connection was started.

          This ensures that the listener is active so that playback can execute when required.

          [FIXED JENKINS-31439]

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Scott Hebert Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/GerritServer.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/playback/GerritMissedEventsPlaybackManager.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/playback/GerritMissedEventsFunctionalTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/DuplicateGerritListenersHudsonTestCase.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/DuplicateGerritListenersPreloadedProjectHudsonTestCase.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/35efed719ca198f711ca33401d6815e5468ba723 Log: Correct Missed Events Playback manager init It is possible for the Missed Events playback manager to not be correctly initialized once the REST API has been enabled AFTER the connection has been started. The same issue applies if the Gerrit events-log plugin was installed AFTER the Gerrit connection was started. This ensures that the listener is active so that playback can execute when required. [FIXED JENKINS-31439]
          Show
          scoheb Scott Hebert added a comment - Available in 2.17.3 ( https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger#GerritTrigger-Version2.17.3%28releasedNov262015%29 )

            People

            • Assignee:
              scoheb Scott Hebert
              Reporter:
              engy Jiří Engelthaler
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: