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

P4Groovy - Credential not found error does not propagate

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • p4-plugin
    • OS: Windows Server 2012 R2 (build 9600)
      Jenkins: 2.150.1
      P4 Plugin: 1.9.5

      Duplication:

      1. Go to http://<jenkins>/computer/<node>/script
      2. Run:
        import org.jenkinsci.plugins.p4.workspace.StreamWorkspaceImpl;
        import org.jenkinsci.plugins.p4.groovy.P4Groovy;
        
        def ws = new StreamWorkspaceImpl('none', false, '//Stream_Depot/Main', 'job1-temp-branch1')
        def p4 = new P4Groovy('bad credential', null, ws, new FilePath(new File('workspace')))
        def result = p4.run('status')
      1. The error message returned is 'hudson.AbortException: P4: Task Exception: null'

      This can also be duplicated by using a bad credential in a Jenkinsfile using the normal syntax:

      def ws = [$class: 'StreamWorkspaceImpl', charset: 'none', format: env.JOB_NAME + '-temp-' + env.BRANCH_NAME, pinHost: false, streamName: '//Stream_Depot/' + env.BRANCH_NAME]
      def p4 = p4(credential: 'bad credential', workspace: ws)
      def result = p4.run('streams')

      Expected result:

      An error message stating that the credential is not found.

          [JENKINS-55430] P4Groovy - Credential not found error does not propagate

          Dylan H created issue -
          Dylan H made changes -
          Description Original: Duplication:
           # Go to http://&lt;jenkins&gt;/computer/&lt;node&gt;/script
           # Run:
          {code:java}
          import org.jenkinsci.plugins.p4.workspace.StreamWorkspaceImpl;
          import org.jenkinsci.plugins.p4.groovy.P4Groovy;def ws = new StreamWorkspaceImpl('none', false, '//Device_SeriesT/Main', 'job1-temp-branch1'){code}
          {code:java}
          def p4 = new P4Groovy('f02cd8e4-12f7-4107-8db2-bd0d96fed271', null, ws, new FilePath(new File('E:/DTHTemp')))
          def result = p4.run('status')
          {code}
          New: Duplication:
           # Go to http://&lt;jenkins&gt;/computer/&lt;node&gt;/script
           # Run:
          {code:java}
          import org.jenkinsci.plugins.p4.workspace.StreamWorkspaceImpl;
          import org.jenkinsci.plugins.p4.groovy.P4Groovy;

          def ws = new StreamWorkspaceImpl('none', false, '//Device_SeriesT/Main', 'job1-temp-branch1')
          def p4 = new P4Groovy('bad credential', null, ws, new FilePath(new File('E:/DTHTemp')))
          def result = p4.run('status'){code}

           # The error message returned is 'hudson.AbortException: P4: Task Exception: null'

          Expected result:

          An error message stating that the credential is not found.
          Dylan H made changes -
          Comment [ Working on completing the description. Accidentally used the wrong keyboard shortcut trying to format the description. ]
          Dylan H made changes -
          Summary Original: P4Groovy - Credential not found does not propagate New: P4Groovy - Credential not found error does not propagate
          Dylan H made changes -
          Description Original: Duplication:
           # Go to http://&lt;jenkins&gt;/computer/&lt;node&gt;/script
           # Run:
          {code:java}
          import org.jenkinsci.plugins.p4.workspace.StreamWorkspaceImpl;
          import org.jenkinsci.plugins.p4.groovy.P4Groovy;

          def ws = new StreamWorkspaceImpl('none', false, '//Device_SeriesT/Main', 'job1-temp-branch1')
          def p4 = new P4Groovy('bad credential', null, ws, new FilePath(new File('E:/DTHTemp')))
          def result = p4.run('status'){code}

           # The error message returned is 'hudson.AbortException: P4: Task Exception: null'

          Expected result:

          An error message stating that the credential is not found.
          New: *Duplication:*
           # Go to http://&lt;jenkins&gt;/computer/&lt;node&gt;/script
           # Run:
          {code:java}
          import org.jenkinsci.plugins.p4.workspace.StreamWorkspaceImpl;
          import org.jenkinsci.plugins.p4.groovy.P4Groovy;

          def ws = new StreamWorkspaceImpl('none', false, '//Device_SeriesT/Main', 'job1-temp-branch1')
          def p4 = new P4Groovy('bad credential', null, ws, new FilePath(new File('E:/DTHTemp')))
          def result = p4.run('status'){code}

           # The error message returned is 'hudson.AbortException: P4: Task Exception: null'

          This can also be duplicated by using a bad credential in a Jenkinsfile using the normal syntax:
          {code:java}
          def ws = [$class: 'StreamWorkspaceImpl', charset: 'none', format: env.JOB_NAME + '-temp-' + env.BRANCH_NAME, pinHost: false, streamName: '//Device_SeriesT/' + env.BRANCH_NAME]
          def p4 = p4(credential: 'bad credential', workspace: ws)
          def result = p4.run('streams'){code}
          *Expected result:*

          An error message stating that the credential is not found.
          Dylan H made changes -
          Description Original: *Duplication:*
           # Go to http://&lt;jenkins&gt;/computer/&lt;node&gt;/script
           # Run:
          {code:java}
          import org.jenkinsci.plugins.p4.workspace.StreamWorkspaceImpl;
          import org.jenkinsci.plugins.p4.groovy.P4Groovy;

          def ws = new StreamWorkspaceImpl('none', false, '//Device_SeriesT/Main', 'job1-temp-branch1')
          def p4 = new P4Groovy('bad credential', null, ws, new FilePath(new File('E:/DTHTemp')))
          def result = p4.run('status'){code}

           # The error message returned is 'hudson.AbortException: P4: Task Exception: null'

          This can also be duplicated by using a bad credential in a Jenkinsfile using the normal syntax:
          {code:java}
          def ws = [$class: 'StreamWorkspaceImpl', charset: 'none', format: env.JOB_NAME + '-temp-' + env.BRANCH_NAME, pinHost: false, streamName: '//Device_SeriesT/' + env.BRANCH_NAME]
          def p4 = p4(credential: 'bad credential', workspace: ws)
          def result = p4.run('streams'){code}
          *Expected result:*

          An error message stating that the credential is not found.
          New: *Duplication:*
           # Go to http://&lt;jenkins&gt;/computer/&lt;node&gt;/script
           # Run:
          {code:java}
          import org.jenkinsci.plugins.p4.workspace.StreamWorkspaceImpl;
          import org.jenkinsci.plugins.p4.groovy.P4Groovy;

          def ws = new StreamWorkspaceImpl('none', false, '//Stream_Depot/Main', 'job1-temp-branch1')
          def p4 = new P4Groovy('bad credential', null, ws, new FilePath(new File('workspace')))
          def result = p4.run('status'){code}

           # The error message returned is 'hudson.AbortException: P4: Task Exception: null'

          This can also be duplicated by using a bad credential in a Jenkinsfile using the normal syntax:
          {code:java}
          def ws = [$class: 'StreamWorkspaceImpl', charset: 'none', format: env.JOB_NAME + '-temp-' + env.BRANCH_NAME, pinHost: false, streamName: '//Stream_Depot/' + env.BRANCH_NAME]
          def p4 = p4(credential: 'bad credential', workspace: ws)
          def result = p4.run('streams'){code}
          *Expected result:*

          An error message stating that the credential is not found.
          Karl Wirth made changes -
          Assignee New: Karl Wirth [ p4karl ]
          Paul Allen made changes -
          Labels New: P4_B
          Paul Allen made changes -
          Assignee Original: Karl Wirth [ p4karl ] New: Charusheela Bopardikar [ cbopardikar ]
          Charusheela Bopardikar made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Charusheela Bopardikar made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Fixed but Unreleased [ 10203 ]

            cbopardikar Charusheela Bopardikar
            dthomash Dylan H
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: