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

Cannot check out folders whose path contains two matching brackets and a dash between them

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
    • Environment:
      Ubuntu Linux 13.10 amd64
      OpenJDK JRE 1.6.0_27
      Perforce Plugin 1.3.28
      Perforce client : P4/LINUX26X86_64/2013.3/740675 (2013/11/11)
      Perforce server : P4D/LINUX26X86_64/2013.3/770073 (2014/01/14)
    • Similar Issues:

      Description

      When checking out a Perforce repository via a mapped view, the build fails when there were changes to the repository and the view path contains a two matching brackets and a dash between them, for example :

      //depot/[S-B_Src]/... //jenkins-workspace/...

      Attached, please find the Jenkins log illustrating the issue.

        Attachments

          Activity

          Hide
          xavery Daniel Kozar added a comment -

          Hey there. You can download the latest binary of the plugin here : https://jenkins.ci.cloudbees.com/job/plugins/job/perforce-plugin/org.jvnet.hudson.plugins$perforce/lastSuccessfulBuild/artifact/org.jvnet.hudson.plugins/perforce/1.3.28-SNAPSHOT/perforce-1.3.28-SNAPSHOT.hpi . It contains the fix, in fact I'm using it on my own Jenkins installation and the issue does not occur anymore. If you're using Jenkins, just rename .hpi to .jpi.

          Show
          xavery Daniel Kozar added a comment - Hey there. You can download the latest binary of the plugin here : https://jenkins.ci.cloudbees.com/job/plugins/job/perforce-plugin/org.jvnet.hudson.plugins$perforce/lastSuccessfulBuild/artifact/org.jvnet.hudson.plugins/perforce/1.3.28-SNAPSHOT/perforce-1.3.28-SNAPSHOT.hpi . It contains the fix, in fact I'm using it on my own Jenkins installation and the issue does not occur anymore. If you're using Jenkins, just rename .hpi to .jpi.
          Hide
          davidriggleman David Riggleman added a comment - - edited

          Thanks a lot for the quick reply! I used the latest but still hit the same exception. So I ended up compiling from source and added some logging to see the exact string that is problematic. It looks like it might be a slight variation on this bug, so I can create a new issue if you would like. I've shortened the string in question (and removed unique identifying information) while verifying the error is reproducible: "//trunk/branch\...". It looks like the problematic line of code is as follows:
          regex = regex.replaceAll("\\.\\.
          .", "(.*)");

          Show
          davidriggleman David Riggleman added a comment - - edited Thanks a lot for the quick reply! I used the latest but still hit the same exception. So I ended up compiling from source and added some logging to see the exact string that is problematic. It looks like it might be a slight variation on this bug, so I can create a new issue if you would like. I've shortened the string in question (and removed unique identifying information) while verifying the error is reproducible: "//trunk/branch\...". It looks like the problematic line of code is as follows: regex = regex.replaceAll("\\.\\. .", "(.*)");
          Hide
          xavery Daniel Kozar added a comment -

          "//trunk/branch\..." does not seem like a valid Perforce workspace mapping - at least I don't remember seeing '\' slashes anywhere in my paths. Seems like you mean "//trunk/branch/...".

          Show
          xavery Daniel Kozar added a comment - "//trunk/branch\..." does not seem like a valid Perforce workspace mapping - at least I don't remember seeing '\' slashes anywhere in my paths. Seems like you mean "//trunk/branch/...".
          Hide
          davidriggleman David Riggleman added a comment -

          No, I actually meant backslash. That's at least the string that is coming through. I questioned as well whether this is a valid perforce workspace mapping, and am planning on contacting my build team to follow up further, but I was able to at least temporarily comment out locally the line I mentioned above to get my Jenkins environment back up and running.

          Show
          davidriggleman David Riggleman added a comment - No, I actually meant backslash. That's at least the string that is coming through. I questioned as well whether this is a valid perforce workspace mapping, and am planning on contacting my build team to follow up further, but I was able to at least temporarily comment out locally the line I mentioned above to get my Jenkins environment back up and running.
          Hide
          davidriggleman David Riggleman added a comment -

          So it looks like backslashes are not exactly valid, but Perforce does allow adding paths with backslashes to the stream configuration (it just ignores them). I still think it might be worth investigating and possibly coming up with a fix, because even if someone accidentally entered in an "invalid" path, it's bad that it can actually break a working Jenkins environment. I'll leave it up to you, though, if you think it's worth creating a new issue. Sorry to hijack this thread somewhat, although actually in the subfolder right below where I was having this problem, I did need the patched build as I had folders with matching brackets and a dash between them. Thanks for all your help!

          Show
          davidriggleman David Riggleman added a comment - So it looks like backslashes are not exactly valid, but Perforce does allow adding paths with backslashes to the stream configuration (it just ignores them). I still think it might be worth investigating and possibly coming up with a fix, because even if someone accidentally entered in an "invalid" path, it's bad that it can actually break a working Jenkins environment. I'll leave it up to you, though, if you think it's worth creating a new issue. Sorry to hijack this thread somewhat, although actually in the subfolder right below where I was having this problem, I did need the patched build as I had folders with matching brackets and a dash between them. Thanks for all your help!

            People

            • Assignee:
              xavery Daniel Kozar
              Reporter:
              xavery Daniel Kozar
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: