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

AccuRev plugin misses changes if login session expires

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • accurev-plugin
    • None
    • AccuRev server authentication using "accurev_login" or "custom" authentication, and hence logins expire after a period (default is after 240 minutes)

    Description

      The accurev plugin sometimes misses changes that were made to a stream.
      This means that the "changes" log for a project is missing entries.

      With additional logging added, one finds the following entries in the log:

      09-May-2011 10:05:17 hudson.plugins.accurev.AccurevSCM logCommandFailure
      WARNING: History command ("C:\Program Files\AccuRev\bin\accurev.exe" hist -H accurev:5050 -fx -p Foo -s Bar -t now.1 -k move) failed with exit code 1

      09-May-2011 10:05:16 hudson.plugins.accurev.AccurevSCM logCommandFailure
      INFO: Not authenticated. Please use the 'login' command to authenticate.

      This seems to be because, when it checks for changes, it does not log in to accurev first, meaning that it's relying on it already being logged in.
      Unfortunately, accurev logins expire after a period (this was a change introduced when accurev moved from what they call "traditional" authentication to "accurev_login" authentication, which is required for the accurev web UI to work), which means that if the poll-for-changes operation is done on a slave which hasn't done any accurev building for a while, it'll try to use a timed-out login and fail.

      Attachments

        Issue Links

          Activity

            pjdarton pjdarton added a comment -

            I spoke (or pressed "send") too soon.
            It does appear to try to login (the "pollChanges" method calls the "accurevLogin" method) before doing much else.
            The question, then, is ... why did the subsequent commands all fail with an error complaining that the user wasn't logged in?

            I suspect that this is due to the accurev (client-side) bug whereby a login attempt will log out (causing all concurrent accurev operations on the machine to fail) before logging in.

            pjdarton pjdarton added a comment - I spoke (or pressed "send") too soon. It does appear to try to login (the "pollChanges" method calls the "accurevLogin" method) before doing much else. The question, then, is ... why did the subsequent commands all fail with an error complaining that the user wasn't logged in? I suspect that this is due to the accurev (client-side) bug whereby a login attempt will log out (causing all concurrent accurev operations on the machine to fail) before logging in.
            pjdarton pjdarton added a comment -

            Uploaded a patch that enhances the plugin so that it can:
            1) Request a non-expiring login session (the -n flag)
            2) Use "accurev info" to determine if it's already logged in as the desired user and, if so, avoid doing a (potentially destructive) "accurev login" command.

            pjdarton pjdarton added a comment - Uploaded a patch that enhances the plugin so that it can: 1) Request a non-expiring login session (the -n flag) 2) Use "accurev info" to determine if it's already logged in as the desired user and, if so, avoid doing a (potentially destructive) "accurev login" command.
            pjdarton pjdarton added a comment -

            Note that this patch builds on top of changes I made for JENKINS-8039 and JENKINS-9601, neither of which have made it to the main Git repository (yet) - if you want to build your own plugin that uses the JENKINS-9629 patch, you'll probably need those two as well.

            pjdarton pjdarton added a comment - Note that this patch builds on top of changes I made for JENKINS-8039 and JENKINS-9601 , neither of which have made it to the main Git repository (yet) - if you want to build your own plugin that uses the JENKINS-9629 patch, you'll probably need those two as well.
            robsimon robsimon added a comment -

            I added at https://issues.jenkins-ci.org/browse/JENKINS-8935 some changes including lazy login. Since I'm not that familiar with git I just attached the changed file.

            robsimon robsimon added a comment - I added at https://issues.jenkins-ci.org/browse/JENKINS-8935 some changes including lazy login. Since I'm not that familiar with git I just attached the changed file.

            fixed in v 0.6.15

            helterscelter helter scelter added a comment - fixed in v 0.6.15

            People

              helterscelter helter scelter
              pjdarton pjdarton
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: