• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • cvs-plugin
    • None
    • Linux redhat 2.6.18-164.15.1.el5
      Tomcat 7.0.2
      Hudson 1.381
      CVS plugin 1.2

      It is not possible to tag a build any more. In the past (issue JENKINS-4374) it was not possible to "Tag all upstream builds at once", but it was possible to tag one build per time.

      Whenever we try to tag a build it shows us a message saying "Marcação está em progresso:" (meaning Tagging is in progress) and a button saying "Limpar erro para tentar novamente" (meaning Clear errors and retry). Moreover we get no log errors neither tag in the source code.

      According to mindless, he is also having a similar issue in SVN. Mindless also said the following in an issue comment (JENKINS-4374).
      "From what I can tell in the src, the screen with "Tagging is in progress" should show output from the cvs tag command and several other status messages about what it's doing.. the "Clear error to retry" button is only there when the operation is done.. so the fact you see this right away and with no log output is quite odd."

      I set the log level to ALL to try to understand the problem. The log is attached.
      What is important to say is that hudson is trying to use the user 'anonymous' (and 'SYSTEM' in some cases), but I'm logged in with the 'admin' user.

      If it is not possible to provide a fix in a mean time, please, provide a work around. Since, right now, it is not possible to tag a build at all.

          [JENKINS-8128] Tagging a build is not working

          fernandor created issue -

          Alan Harder added a comment -

          Unassigning.. as I don't use cvs I don't think I can spend any more time digging into this. Perhaps you can find someone who does use this plugin to help, or try debugging/fixing yourself. Otherwise you can try cvs plugin version 1.1 and see if that still works (w/o the "all upstream" option checked), or if something else changed to cause this problem. Good luck..

          Alan Harder added a comment - Unassigning.. as I don't use cvs I don't think I can spend any more time digging into this. Perhaps you can find someone who does use this plugin to help, or try debugging/fixing yourself. Otherwise you can try cvs plugin version 1.1 and see if that still works (w/o the "all upstream" option checked), or if something else changed to cause this problem. Good luck..
          Alan Harder made changes -
          Component/s New: cvs [ 15486 ]
          Component/s Original: cvs-tag [ 15534 ]
          Assignee Original: Alan Harder [ mindless ]
          Description Original:
          It is not possible to tag a build any more. In the past (issue JENKINS-4374) it was not possible to "Tag all upstream builds at once", but it was possible to tag one build per time.

          Whenever we try to tag a build it shows us a message saying "Marcação está em progresso:" (meaning Tagging is in progress) and a button saying "Limpar erro para tentar novamente" (meaning Clear errors and retry). Moreover we get no log errors neither tag in the source code.

          According to mindless, he is also having a similar issue in SVN. Mindless also said the following in an issue comment (JENKINS-4374).
          "From what I can tell in the src, the screen with "Tagging is in progress" should show output from the cvs tag command and several other status messages about what it's doing.. the "Clear error to retry" button is only there when the operation is done.. so the fact you see this right away and with no log output is quite odd."

          I set the log level to ALL to try to understand the problem. The log is attached.
          What is important to say is that hudson is trying to use the user 'anonymous' (and 'SYSTEM' in some cases), but I'm logged in with the 'admin' user.

          If it is not possible to provide a fix in a mean time, please, provide a work around. Since, right now, it is not possible to tag a build at all.
          New: It is not possible to tag a build any more. In the past (issue JENKINS-4374) it was not possible to "Tag all upstream builds at once", but it was possible to tag one build per time.

          Whenever we try to tag a build it shows us a message saying "Marcação está em progresso:" (meaning Tagging is in progress) and a button saying "Limpar erro para tentar novamente" (meaning Clear errors and retry). Moreover we get no log errors neither tag in the source code.

          According to mindless, he is also having a similar issue in SVN. Mindless also said the following in an issue comment (JENKINS-4374).
          "From what I can tell in the src, the screen with "Tagging is in progress" should show output from the cvs tag command and several other status messages about what it's doing.. the "Clear error to retry" button is only there when the operation is done.. so the fact you see this right away and with no log output is quite odd."

          I set the log level to ALL to try to understand the problem. The log is attached.
          What is important to say is that hudson is trying to use the user 'anonymous' (and 'SYSTEM' in some cases), but I'm logged in with the 'admin' user.

          If it is not possible to provide a fix in a mean time, please, provide a work around. Since, right now, it is not possible to tag a build at all.

          fernandor added a comment -

          How could I downgrade the cvs plugin? It does not give-me the option.

          fernandor added a comment - How could I downgrade the cvs plugin? It does not give-me the option.

          Alan Harder added a comment -

          On the advanced tab you can provide a file to upload.. get v1.1 from http://jenkins-ci.org/download/plugins/cvs/
          Or you can just drop the file in your $HUDSON_HOME/plugins dir and restart.

          Alan Harder added a comment - On the advanced tab you can provide a file to upload.. get v1.1 from http://jenkins-ci.org/download/plugins/cvs/ Or you can just drop the file in your $HUDSON_HOME/plugins dir and restart.

          Im having this issue on v1.4 and v1.1

          Tomas Boremalm added a comment - Im having this issue on v1.4 and v1.1

          I've observed the same problem in Jenkins 1.440 and I believe I found the cause of the problem.

          CAUSE: Debugging the code reveals that an access-exception is thrown during tagging. However, the code fails to catch this exception, probably because it was unexpected when code was written. The exception is thrown because the CVSSCM.TagWorkerThread-class calls the "keepLog()"-method of the "hudson.model.Run"-class. This method, in turn, checks if the current user has the "UPDATE" right. However, since the "perform"-method of the TagWorkerThread is run from a separate thread it has no user associated with it and thus uses the "anonymous" user, hence the observations in the log-files. I believe the issue has arisen due to a security-fix (actually authored by "mindless") that introduced the check for the UPDATE-permission and hence broke the tagging function in the CVS plugin (...when security is enabled).

          WORKAROUND: A workaround of the problem can be to grant the "UPDATE"-permission to the anonymous user. If this is the only privilege granted to the anonymous user it will not interfere visually with the UI (from what I've seen so far) but of course it's not a viable solution to a publicly exposed system.

          FIX: A quick-fix of the code would be to completely remove the call to "keepLog()" as it doesn't seem to play any vital part in the tagging - I guess it was supposed to store the output of the tagging process for later querying, however, I've never seen any logs in my old installation where tagging still works. I've tried to catch the exception and just ignore it (in a plugin that was based on the CVSSCM-code) and in this case the tagging succeeds. Anyway, here's the faulty peace of code (hudson.scm.CVSSCM.java, line 1679):

                  protected void perform(TaskListener listener) {
                      for (Entry<AbstractBuild<?,?>, String> e : tagSet.entrySet()) {
                          TagAction ta = e.getKey().getAction(TagAction.class);
                          if(ta==null) {
                              listener.error(e.getKey()+" doesn't have CVS tag associated with it. Skipping");
                              continue;
                          }
                          listener.getLogger().println(Messages.CVSSCM_TagginXasY(e.getKey(),e.getValue()));
                          try {
                              e.getKey().keepLog();
                          } catch (IOException x) {
                              x.printStackTrace(listener.error(Messages.CVSSCM_FailedToMarkForKeep(e.getKey())));
                          }
                          ta.perform(e.getValue(), listener);
                          listener.getLogger().println();
                      }
                  }
          

          and here's a fix:

                  protected void perform(TaskListener listener) {
                      for (Entry<AbstractBuild<?,?>, String> e : tagSet.entrySet()) {
                          TagAction ta = e.getKey().getAction(TagAction.class);
                          if(ta==null) {
                              listener.error(e.getKey()+" doesn't have CVS tag associated with it. Skipping");
                              continue;
                          }
                          listener.getLogger().println(Messages.CVSSCM_TagginXasY(e.getKey(),e.getValue()));
                          //try {
                          //    e.getKey().keepLog();
                          //} catch (IOException x) {
                          //    x.printStackTrace(listener.error(Messages.CVSSCM_FailedToMarkForKeep(e.getKey())));
                          //}
                          ta.perform(e.getValue(), listener);
                          listener.getLogger().println();
                      }
                  }
          

          EPILOG: I'm not in loop with all this project/github/patching/branching-stuff so I suggest somebody better suited try to commit the fix.

          Christoffer Børrild added a comment - I've observed the same problem in Jenkins 1.440 and I believe I found the cause of the problem. CAUSE : Debugging the code reveals that an access-exception is thrown during tagging. However, the code fails to catch this exception, probably because it was unexpected when code was written. The exception is thrown because the CVSSCM.TagWorkerThread-class calls the "keepLog()"-method of the "hudson.model.Run"-class. This method, in turn, checks if the current user has the "UPDATE" right. However, since the "perform"-method of the TagWorkerThread is run from a separate thread it has no user associated with it and thus uses the "anonymous" user, hence the observations in the log-files. I believe the issue has arisen due to a security-fix (actually authored by "mindless") that introduced the check for the UPDATE-permission and hence broke the tagging function in the CVS plugin (...when security is enabled). WORKAROUND : A workaround of the problem can be to grant the "UPDATE"-permission to the anonymous user. If this is the only privilege granted to the anonymous user it will not interfere visually with the UI (from what I've seen so far) but of course it's not a viable solution to a publicly exposed system. FIX : A quick-fix of the code would be to completely remove the call to "keepLog()" as it doesn't seem to play any vital part in the tagging - I guess it was supposed to store the output of the tagging process for later querying, however, I've never seen any logs in my old installation where tagging still works. I've tried to catch the exception and just ignore it (in a plugin that was based on the CVSSCM-code) and in this case the tagging succeeds. Anyway, here's the faulty peace of code ( hudson.scm.CVSSCM.java, line 1679 ): protected void perform(TaskListener listener) { for (Entry<AbstractBuild<?,?>, String > e : tagSet.entrySet()) { TagAction ta = e.getKey().getAction(TagAction.class); if (ta== null ) { listener.error(e.getKey()+ " doesn't have CVS tag associated with it. Skipping" ); continue ; } listener.getLogger().println(Messages.CVSSCM_TagginXasY(e.getKey(),e.getValue())); try { e.getKey().keepLog(); } catch (IOException x) { x.printStackTrace(listener.error(Messages.CVSSCM_FailedToMarkForKeep(e.getKey()))); } ta.perform(e.getValue(), listener); listener.getLogger().println(); } } and here's a fix: protected void perform(TaskListener listener) { for (Entry<AbstractBuild<?,?>, String > e : tagSet.entrySet()) { TagAction ta = e.getKey().getAction(TagAction.class); if (ta== null ) { listener.error(e.getKey()+ " doesn't have CVS tag associated with it. Skipping" ); continue ; } listener.getLogger().println(Messages.CVSSCM_TagginXasY(e.getKey(),e.getValue())); // try { // e.getKey().keepLog(); //} catch (IOException x) { // x.printStackTrace(listener.error(Messages.CVSSCM_FailedToMarkForKeep(e.getKey()))); //} ta.perform(e.getValue(), listener); listener.getLogger().println(); } } EPILOG : I'm not in loop with all this project/github/patching/branching-stuff so I suggest somebody better suited try to commit the fix.

          I've committed a pull-request with the fix on github: https://github.com/Boerrild/cvs-plugin/commit/57e1806398772e5b7a6ba32a8a02a47b095e0d23.
          Not sure what happens from here(!?)

          Christoffer Børrild added a comment - I've committed a pull-request with the fix on github: https://github.com/Boerrild/cvs-plugin/commit/57e1806398772e5b7a6ba32a8a02a47b095e0d23 . Not sure what happens from here(!?)

          Whilst Christoffer's fix seems to work, I've not merged it as we have a bigger change pending which incorporates an variant of this fix.

          Michael Clarke added a comment - Whilst Christoffer's fix seems to work, I've not merged it as we have a bigger change pending which incorporates an variant of this fix.
          Michael Clarke made changes -
          Assignee New: Michael Clarke [ mc1arke ]

            mc1arke Michael Clarke
            fernandor fernandor
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: