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

P4Groovy - Credential not found error does not propagate

XMLWordPrintable

    • 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.

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

              Created:
              Updated:
              Resolved: