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

clearcase plugin attempts and fails to remove view on job deletion

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • clearcase-plugin
    • None
    • Windows XP,
      JRE 1.6.0_20,
      Hudson 1.361,
      clearcase plugin 1.2.1

      When a job is deleted the clearcase plugin attempts to remove the view that it uses. As it is not set to create the view and it is not set to remove the view on rename this is a surprise.

      I see two issues here:
      1) the plugin attempts to delete a view that it did not create and was not told to manage.
      2) it would appear that the plugin is attempting to delete the wrong view name.

      The user is logged in.

      The job settings related to the clearcase plugin are:
      Base ClearCase: selected
      View name: ${USER_NAME}_test_view
      Config spec: element * CHECKEDOUT
      element * /main/LATEST
      Load rules: /CodeStorage
      Use update: unchecked
      Branch(es): empty
      Excluded Regions: empty
      Addition mkview arguments: empty
      Filter 'Destroy sub branch' event: unchecked
      Remove clearcase view on rename: unchecked
      Multi-site poll buffer: 0
      Use dynamic view: checked
      View root: W:\
      Create view if view doesn't exist: unchecked
      Use time rule config spec: unchecked
      Do Not Reset Config Spec: checked

      The following stack trace is printed to the console upon job deletion:
      Jun 9, 2010 8:30:46 AM hudson.plugins.clearcase.AbstractClearCaseScm$ItemListenerImpl onDeleted
      WARNING: Failed to remove ClearCase view
      java.lang.NullPointerException
      at hudson.plugins.clearcase.AbstractClearCaseScm$ItemListenerImpl.onDeleted(AbstractClearCaseScm.java:579)
      at hudson.model.Hudson.deleteJob(Hudson.java:2014)
      at hudson.model.AbstractItem.delete(AbstractItem.java:270)
      at hudson.model.AbstractItem.doDoDelete(AbstractItem.java:249)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:235)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:116)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:57)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:75)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:525)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:181)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:525)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:441)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:123)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:51)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
      at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      at java.lang.Thread.run(Unknown Source)

          [JENKINS-6729] clearcase plugin attempts and fails to remove view on job deletion

          Point taken. It seems that the view deletion feature has been made with snapshot views in mind, and so it fails for dynamic views.

          With the current options (create if not exist, remove clearcase view on rename), it doesn't really fit when to delete or not a dynamic view.
          I suggest a renaming of the 'create if not exist' to 'let Hudson manage the view lifecycle'. This way, it will create view if needed (most likely on first build), and delete it on job deletion.
          In my opinion, 'remove clearcase view on rename' should be removed, and always apply, because if unchecked, it can leave hanging views.

          Note that we currently have no way of detecting when the view tag is changed.

          Vincent Latombe added a comment - Point taken. It seems that the view deletion feature has been made with snapshot views in mind, and so it fails for dynamic views. With the current options (create if not exist, remove clearcase view on rename), it doesn't really fit when to delete or not a dynamic view. I suggest a renaming of the 'create if not exist' to 'let Hudson manage the view lifecycle'. This way, it will create view if needed (most likely on first build), and delete it on job deletion. In my opinion, 'remove clearcase view on rename' should be removed, and always apply, because if unchecked, it can leave hanging views. Note that we currently have no way of detecting when the view tag is changed.

          mihabars added a comment - - edited

          Please consider another major issues relevant to this one.
          Plugin version 1.3 fails to remove dynamic view:
          It issues a wrong command (rmview -force <viewname>). Right command is "rmview -tag <viewname>".
          Log:

           
          [workspace] $ /usr/atria/bin/cleartool lsview my_view
          * my_view /mnt/ccsrv03/vws1/my_view.-2111423111
          [workspace] $ /usr/atria/bin/cleartool rmview -force my_view
          cleartool: Error: Unable to open file "my_view/.view": No such file or directory.
          cleartool: Error: my_view isn't a view: No such file or directory
          cleartool: Error: Unable to remove view "my_view".
          FATAL: Base ClearCase failed. exit code=1
          

          And one more.
          Plugin version 1.3 fails to set configspec for dynamic view:
          It saves temporary file to workspace directory but try to setcs from view root directory.
          See log:

           
          [workspace] $ /usr/atria/bin/cleartool catcs -tag my_view
          element * CHECKEDOUT
          element * /main/LATEST
          [my_view] $ /usr/atria/bin/cleartool setcs ../configspec6533288623247122471.txt
          cleartool: Error: Unable to access "../configspec6533288623247122471.txt": No such file or directory.
          cleartool: Error: Unable to change configuration specification: No such file or directory.
          FATAL: Base ClearCase failed. exit code=1
          

          Previous version used full path to setcs.

          mihabars added a comment - - edited Please consider another major issues relevant to this one. Plugin version 1.3 fails to remove dynamic view: It issues a wrong command (rmview -force <viewname>). Right command is "rmview -tag <viewname>". Log: [workspace] $ /usr/atria/bin/cleartool lsview my_view * my_view /mnt/ccsrv03/vws1/my_view.-2111423111 [workspace] $ /usr/atria/bin/cleartool rmview -force my_view cleartool: Error: Unable to open file "my_view/.view" : No such file or directory. cleartool: Error: my_view isn't a view: No such file or directory cleartool: Error: Unable to remove view "my_view" . FATAL: Base ClearCase failed. exit code=1 And one more. Plugin version 1.3 fails to set configspec for dynamic view: It saves temporary file to workspace directory but try to setcs from view root directory. See log: [workspace] $ /usr/atria/bin/cleartool catcs -tag my_view element * CHECKEDOUT element * /main/LATEST [my_view] $ /usr/atria/bin/cleartool setcs ../configspec6533288623247122471.txt cleartool: Error: Unable to access "../configspec6533288623247122471.txt" : No such file or directory. cleartool: Error: Unable to change configuration specification: No such file or directory. FATAL: Base ClearCase failed. exit code=1 Previous version used full path to setcs.

          Code changed in hudson
          User: : vlatombe
          Path:
          trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolExec.java
          trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/DynamicCheckoutAction.java
          http://jenkins-ci.org/commit/33075
          Log:
          [ JENKINS-6729] clearcase plugin attempts and fails to remove view on job deletion

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : vlatombe Path: trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/ClearToolExec.java trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/action/DynamicCheckoutAction.java http://jenkins-ci.org/commit/33075 Log: [ JENKINS-6729 ] clearcase plugin attempts and fails to remove view on job deletion

          Vincent Latombe added a comment - Should be fixed in hudson build #145 (see http://ci.hudson-labs.org/job/hudson_all_plugins/org.jvnet.hudson.plugins$clearcase/ )

          Released in 1.3.1

          Vincent Latombe added a comment - Released in 1.3.1

          Reopening, as I got a bit too quick on this issue. The issue reported by mihabars in one of the comment is fixed. However the original issue still stands.

          Vincent Latombe added a comment - Reopening, as I got a bit too quick on this issue. The issue reported by mihabars in one of the comment is fixed. However the original issue still stands.

          Garen Parham added a comment -

          As the docs indicate, 'cleartool rmview' will fail if the working directory is inside the view, so you need to change to another dir (and maybe do a 'cleartool endview <view-tag>' first) before attempting to remove it.

          The -force option is meant to override view removal if the view has checkouts.

          Garen Parham added a comment - As the docs indicate, 'cleartool rmview' will fail if the working directory is inside the view, so you need to change to another dir (and maybe do a 'cleartool endview <view-tag>' first) before attempting to remove it. The -force option is meant to override view removal if the view has checkouts.

            Unassigned Unassigned
            minielim Josh Mueller
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: