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

"P4JAVA: Error in finding type of stream.java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0" since release 1.17.0

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None
    • Jenkins version: 2.479.2
      P4 Plugin version: 1.17.0
      Java Runtime version: 17.0.13+11-Ubuntu-2ubuntu122.04
      P4JAVA version: 2024.2/2695691

      Projects with "Pipeline script from SCM" fail with the following error in the pipeline log:

      [2024-12-30T07:32:52.472Z] P4 Task: establishing connection.
      [2024-12-30T07:32:52.472Z] ... server: ssl:perforce.domain.com:1666
      [2024-12-30T07:32:52.472Z] ... node: gui-jenkins
      [2024-12-30T07:32:52.484Z] (p4):cmd:... p4 where /var/lib/jenkins/workspace/Check Make Status%40script/607502807ca3___
      [2024-12-30T07:32:52.484Z] p4 where /var/lib/jenkins/workspace/Check Make Status%40script/607502807ca37d1ed7242a4077864b02087909c2baae05ef5fc241c699aebe2d/Check_Make_Status.jenkinsfile
      [2024-12-30T07:32:52.484Z]
      [2024-12-30T07:32:52.493Z] (p4):stop:11
      [2024-12-30T07:32:52.505Z] (p4):cmd:... p4 streams
      [2024-12-30T07:32:52.505Z] p4 streams
      [2024-12-30T07:32:52.505Z]
      [2024-12-30T07:32:52.513Z] (p4):stop:12
      [2024-12-30T07:32:52.515Z] P4 Task: attempt: 1
      [2024-12-30T07:32:55.516Z] ERROR: P4: Task Exception: java.lang.RuntimeException: P4JAVA: Error in finding type of stream.java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
      [2024-12-30T07:32:55.516Z] Retrying after 10 seconds

          [JENKINS-75076] "P4JAVA: Error in finding type of stream.java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0" since release 1.17.0

          Andreas created issue -

          Dhaval added a comment - - edited

          Hi,
          I tried and I am not able to recreate this error.
          Currently it looks like this could be an issue because stream name given doesnot exist in the workspace.
          Can you share your jenkins pipeline logs, from jobs folder please share config.xml and build.xml so that we can understand your problem better?

          What stream name are you using. What's the output of the "p4 streams "given stream name""?

          Note: I have tried in windows 11 x64 with p4 plugin 1.17.0 and jenkins 2.479.2.

          Dhaval added a comment - - edited Hi, I tried and I am not able to recreate this error. Currently it looks like this could be an issue because stream name given doesnot exist in the workspace. Can you share your jenkins pipeline logs, from jobs folder please share config.xml and build.xml so that we can understand your problem better? What stream name are you using. What's the output of the "p4 streams "given stream name""? Note: I have tried in windows 11 x64 with p4 plugin 1.17.0 and jenkins 2.479.2.

          Andreas added a comment -

          Hi, Stream is empty in my project's configuration. Does that help already?

          Andreas added a comment - Hi, Stream is empty in my project's configuration. Does that help already?
          Dhaval made changes -
          Attachment New: image-2025-01-07-19-57-52-425.png [ 63771 ]

          Dhaval added a comment -

          If stream is selected as workspace behavior, it cannot be empty.

          Dhaval added a comment - If stream is selected as workspace behavior, it cannot be empty.
          Andreas made changes -
          Attachment New: screenshot-1.png [ 63772 ]
          Andreas made changes -
          Attachment New: image-2025-01-07-16-31-46-361.png [ 63773 ]

          Andreas added a comment -

          Workspace behavior is "Manual (custom view)", Stream and Stream at change both are empty.

          Andreas added a comment - Workspace behavior is "Manual (custom view)", Stream and Stream at change both are empty.

          Dhaval added a comment -

          In manual (custom view) either stream or view mappings should be given.
          I am pretty certain this is some configuration issue.

          Can you share your jenkins pipeline logs, from jobs folder please share config.xml and build.xml so that we can understand your problem better?

          Dhaval added a comment - In manual (custom view) either stream or view mappings should be given. I am pretty certain this is some configuration issue. Can you share your jenkins pipeline logs, from jobs folder please share config.xml and build.xml so that we can understand your problem better?

          Jarosław added a comment - - edited

          Hi, I'm seeing the same issue with 1.17.0 version. In my case it's a scripted pipeline and also a custom view. The checkout step looks something like this:

          String mapping(String workspace, String branch, String arch, String type) {
            final String depotPath = "//depot/${type}";
            final String workSpacePath = "//${workspace}/depot/${type}";
          
            String mapping = """
              ${depotPath}/${branch}/... ${workSpacePath}/${branch}/...
              //depot/prod/MAIN/unittests/services/testrunner/... //${workspace}/depot/prod/MAIN/unittests/services/testrunner/...
              //depot/prod/MAIN/unittests/services/automation/... //${workspace}/depot/prod/MAIN/unittests/services/automation/...
              //depot/tests/services/MAIN/automation/tools/linux/... //${workspace}/depot/tests/services/MAIN/automation/tools/linux/...
              //depot/tests/services/MAIN/automation/tools/common/... //${workspace}/depot/tests/services/MAIN/automation/tools/common/...
              //depot/tests/services/MAIN/automation/playbooks/... //${workspace}/playbooks/...
              //depot/tests/services/MAIN/media/... //${workspace}/depot/tests/services/MAIN/media/...
            """.stripIndent();
          
            return mapping;
          }
          
          ...
          
          checkout perforce(
            credential: '[creds]',
            populate: autoClean(
              delete: true, modtime: false, pin: change, quiet: true, replace: true,
              tidy: false, parallel: [
                enable: true, minbytes: '1024', minfiles: '1', threads: '4'
              ]
            ),
            workspace: manualSpec(
              name: workspace,
              charset: 'none', pinHost: false, spec: clientSpec(
                allwrite: false, backup: true, changeView: '', clobber: true,
                compress: true, line: 'LOCAL', locked: false, modtime: false,
                rmdir: true, serverID: '', streamName: '', type: 'WRITABLE',
                view: mapping(workspace, branch, mapping, type)
              )
            )
          )

          I'm happy to provide additional information if needed.

          Jarosław added a comment - - edited Hi, I'm seeing the same issue with 1.17.0 version. In my case it's a scripted pipeline and also a custom view. The checkout step looks something like this: String mapping( String workspace, String branch, String arch, String type) {   final String depotPath = " //depot/${type}" ;   final String workSpacePath = " //${workspace}/depot/${type}" ; String mapping = """     ${depotPath}/${branch}/... ${workSpacePath}/${branch}/...     //depot/prod/MAIN/unittests/services/testrunner/... //${workspace}/depot/prod/MAIN/unittests/services/testrunner/...     //depot/prod/MAIN/unittests/services/automation/... //${workspace}/depot/prod/MAIN/unittests/services/automation/...     //depot/tests/services/MAIN/automation/tools/linux/... //${workspace}/depot/tests/services/MAIN/automation/tools/linux/...     //depot/tests/services/MAIN/automation/tools/common/... //${workspace}/depot/tests/services/MAIN/automation/tools/common/...     //depot/tests/services/MAIN/automation/playbooks/... //${workspace}/playbooks/...     //depot/tests/services/MAIN/media/... //${workspace}/depot/tests/services/MAIN/media/... """.stripIndent(); return mapping; } ... checkout perforce(   credential: '[creds]' ,   populate: autoClean(     delete: true , modtime: false , pin: change, quiet: true , replace: true ,     tidy: false , parallel: [       enable: true , minbytes: '1024' , minfiles: '1' , threads: '4'     ]   ),   workspace: manualSpec(     name: workspace,     charset: 'none' , pinHost: false , spec: clientSpec(       allwrite: false , backup: true , changeView: '', clobber: true ,       compress: true , line: 'LOCAL' , locked: false , modtime: false ,       rmdir: true , serverID: '', streamName: ' ', type: ' WRITABLE',       view: mapping(workspace, branch, mapping, type)     )   ) ) I'm happy to provide additional information if needed.

            Unassigned Unassigned
            andreas_rueger Andreas
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: