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

Clearcase plugin tries to use mkview with "-vws null/[viewpath]" after restart

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • clearcase-plugin
    • None
    • RHEL master/slave, ClearCase 7.1.0.2, Jenkins 1.461, ClearCase plugin 1.358

      Every time the Jenkins server is restarted all of our ClearCase builds break. All of our builds are using snapshot views and run on slave nodes, no jobs are run on the master. Polling is also broken but I do not know if the problems are related.

      The log when the build is failing:

      Building remotely on goesrpora in workspace /goesrpora/linux/local_home/jenkins/jenkins_slave/workspace/my_project
      $ /opt/ibm/RationalSDLC/clearcase//bin/cleartool lsview -cview -s
      $ /opt/ibm/RationalSDLC/clearcase//bin/cleartool lsview _jenkins_my_project
      cleartool: Error: No matching entries found for view tag "_jenkins_my_project".
      FATAL: Base ClearCase failed. exit code=1
      $ /opt/ibm/RationalSDLC/clearcase//bin/cleartool mkview -snapshot -tag _jenkins_my_project -vws null/_jenkins_my_project.vws _jenkins_my_project
      cleartool: Error: unable to create directory null/_jenkins_my_project.vws: No such file or directory
      cleartool: Error: Unable to create directory "null/_jenkins_my_project.vws": No such file or directory.
      cleartool: Error: Unable to create view "null/_jenkins_my_project.vws".
      FATAL: Base ClearCase failed. exit code=1
      java.io.IOException: cleartool did not return the expected exit code. Command line="mkview -snapshot -tag _jenkins_my_project -vws null/_jenkins_my_project.vws _jenkins_my_project", actual exit code=1
      at hudson.plugins.clearcase.HudsonClearToolLauncher.run(HudsonClearToolLauncher.java:107)
      at hudson.plugins.clearcase.HudsonClearToolLauncher.run(HudsonClearToolLauncher.java:72)
      at hudson.plugins.clearcase.ClearToolExec.mkview(ClearToolExec.java:643)
      at hudson.plugins.clearcase.action.AbstractCheckoutAction.cleanAndCreateViewIfNeeded(AbstractCheckoutAction.java:138)
      at hudson.plugins.clearcase.action.SnapshotCheckoutAction.checkout(SnapshotCheckoutAction.java:51)
      at hudson.plugins.clearcase.AbstractClearCaseScm.checkout(AbstractClearCaseScm.java:534)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
      at hudson.model.Run.run(Run.java:1434)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:239)
      [FINDBUGS] Skipping publisher since build result is FAILURE
      [WARNINGS] Skipping publisher since build result is FAILURE
      [TASKS] Skipping publisher since build result is FAILURE
      Archiving artifacts
      Finished: FAILURE

      If I go in to the projects configuration and hit save, without necessarily making any changes, the build will use "-stgloc -auto" like it is supposed to and continue to work properly until the server is restarted.

          [JENKINS-13901] Clearcase plugin tries to use mkview with "-vws null/[viewpath]" after restart

          banoss added a comment - - edited

          I get exactly this issue with Solaris 10 slaves, I've never notices this problem on Windows slaves although they are used a lot less. I don't need to restart Jenkins however to see this issue. But I think if the build jumps to a different slave we see this issue, but I'm not sure if this is the only cause. It certainly doesn't occur 100% when a job jumps to a different slave.

          Workaround is the same, have to re-save each job. We have a lot of jobs ...

          Jenkins v1.474, Jenkins CC plugin v1.3.7

          banoss added a comment - - edited I get exactly this issue with Solaris 10 slaves, I've never notices this problem on Windows slaves although they are used a lot less. I don't need to restart Jenkins however to see this issue. But I think if the build jumps to a different slave we see this issue, but I'm not sure if this is the only cause. It certainly doesn't occur 100% when a job jumps to a different slave. Workaround is the same, have to re-save each job. We have a lot of jobs ... Jenkins v1.474, Jenkins CC plugin v1.3.7

          Doug Dicks added a comment -

          It is also broke on a Windows single Jenkins instance setup using snapshot views.

          Jenkins 1.477 Plugin version 1.3.7. ClearCase version 7.1.1.0

          The first time I ran the job, it used a command of:

          cleartool mkview -snapshot -tag myviewname -vws null\myviewname.vws

          I don’t normally specify the view location when I do a mkview, so I added -stgloc –auto in the “additional mkview paramenters” and the plugin put it on twice.

          cleartool mkview -snapshot -tag myviewname -stgloc -auto -stgloc -auto myviewname

          So, I removed -stgloc –auto, and this time it generated

          cleartool mkview -snapshot -tag myviewname -stgloc -auto myviewname

          Which worked. But not for long. After a reboot I was back where I started with “-vws null...”

          I looked through the source of ClearToolExec.java, and I think the problem is in mkview(MkViewParameters parameters).

          I don’t want it to automatically add a view storage location when I create a snapshot view. I don’t need it. A simple “cleartool mkview -snapshot -tag myviewname myviewname“ works for me.

          My workaround is to add “-tcomment test-host” to the additional mkview parameters of the job. The “-host” part of the comment fakes ClearToolExec.java into thinking I specified a view storage host and it skips the cmd.add(parameters.getViewStorage().getCommandArguments()); in the switch statement.

          Doug Dicks added a comment - It is also broke on a Windows single Jenkins instance setup using snapshot views. Jenkins 1.477 Plugin version 1.3.7. ClearCase version 7.1.1.0 The first time I ran the job, it used a command of: cleartool mkview -snapshot -tag myviewname -vws null\myviewname.vws I don’t normally specify the view location when I do a mkview, so I added -stgloc –auto in the “additional mkview paramenters” and the plugin put it on twice. cleartool mkview -snapshot -tag myviewname -stgloc -auto -stgloc -auto myviewname So, I removed -stgloc –auto, and this time it generated cleartool mkview -snapshot -tag myviewname -stgloc -auto myviewname Which worked. But not for long. After a reboot I was back where I started with “-vws null...” I looked through the source of ClearToolExec.java, and I think the problem is in mkview(MkViewParameters parameters). I don’t want it to automatically add a view storage location when I create a snapshot view. I don’t need it. A simple “cleartool mkview -snapshot -tag myviewname myviewname“ works for me. My workaround is to add “-tcomment test-host” to the additional mkview parameters of the job. The “-host” part of the comment fakes ClearToolExec.java into thinking I specified a view storage host and it skips the cmd.add(parameters.getViewStorage().getCommandArguments()); in the switch statement.

          x29a added a comment -

          Using "Override view storage -> Default" in the advanced SCM settings of a project works for me, Jenkins 1.524, CC Plugin 1.3.19

          x29a added a comment - Using "Override view storage -> Default" in the advanced SCM settings of a project works for me, Jenkins 1.524, CC Plugin 1.3.19

            Unassigned Unassigned
            jbentley Jordan Bentley
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: