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

NPE when using a credentials parameter with multi-configuration project

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: matrix-project-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.609.3
      matrix-project-plugin 1.7.1
      credentials plugin 2.1.4
    • Similar Issues:

      Description

      Steps to reproduce:

      • create multi-configuration project with axis "Slaves"
      • add build parameter of type "Credentials Parameter"
      • add minimal build step, e.g. execute shell "echo HOWDY"
      • build project using some credential

      Resulting console output:
      Started by user t761
      [EnvInject] - Loading node environment variables.
      Building remotely on Slave_extend_SEU_Linux3_Slk (Slk_Linux) in workspace /home/hudrun/slave3_jenkins.eng.zkb.ch_produktiv/workspace/0195-SLK-GKKKK-ReferenceRepo
      FATAL: null
      java.lang.NullPointerException
      at com.cloudbees.plugins.credentials.CredentialsParameterValue.lookupCredentials(CredentialsParameterValue.java:98)
      at com.cloudbees.plugins.credentials.CredentialsParameterValue.lookupCredentials(CredentialsParameterValue.java:92)
      at com.cloudbees.plugins.credentials.CredentialsParameterValue.createVariableResolver(CredentialsParameterValue.java:74)
      at hudson.matrix.FilterScript.getConfiguredBinding(FilterScript.java:97)
      at hudson.matrix.FilterScript.apply(FilterScript.java:75)
      at hudson.matrix.DefaultMatrixExecutionStrategyImpl.filterConfigurations(DefaultMatrixExecutionStrategyImpl.java:190)
      at hudson.matrix.DefaultMatrixExecutionStrategyImpl.run(DefaultMatrixExecutionStrategyImpl.java:121)
      at hudson.matrix.MatrixBuild$MatrixBuildExecution.doRun(MatrixBuild.java:364)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.matrix.MatrixBuild.run(MatrixBuild.java:313)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:381)
      Finished: FAILURE

        Attachments

          Activity

          Hide
          ozaika Alexander Z added a comment - - edited

          Facing same issue with
          Jenkins 2.19.4
          matrix-project-plugin 1.7.1
          credentials plugin 2.1.10

          Also reproduced on:
          Jenkins 1.609
          matrix-project-plugin 1.4.1
          credentials plugin 2.1.11-SNAPSHOT

          Show
          ozaika Alexander Z added a comment - - edited Facing same issue with Jenkins 2.19.4 matrix-project-plugin 1.7.1 credentials plugin 2.1.10 Also reproduced on: Jenkins 1.609 matrix-project-plugin 1.4.1 credentials plugin 2.1.11-SNAPSHOT
          Hide
          stephenconnolly Stephen Connolly added a comment -

          Not a bug in the credentials plugin:

          http://javadoc.jenkins.io/hudson/model/ParameterValue.html#createVariableResolver(hudson.model.AbstractBuild) describes the build parameter:

          The build for which this parameter is being used. Never null.

          While the matrix plugin is passing an explicit null: https://github.com/jenkinsci/matrix-project-plugin/blob/3d7eb2b13fce78fe71d0ad84cb992856209cbca2/src/main/java/hudson/matrix/FilterScript.java#L97

          Clearly a bug in the matrix plugin.

          Show
          stephenconnolly Stephen Connolly added a comment - Not a bug in the credentials plugin: http://javadoc.jenkins.io/hudson/model/ParameterValue.html#createVariableResolver(hudson.model.AbstractBuild ) describes the build parameter: The build for which this parameter is being used. Never null. While the matrix plugin is passing an explicit null : https://github.com/jenkinsci/matrix-project-plugin/blob/3d7eb2b13fce78fe71d0ad84cb992856209cbca2/src/main/java/hudson/matrix/FilterScript.java#L97 Clearly a bug in the matrix plugin.
          Hide
          ozaika Alexander Z added a comment -

          Bug is not reproduced with such versions:
          Jenkins 1.651.3
          matrix-project-plugin 1.7.1
          credentials plugin 1.24

          Show
          ozaika Alexander Z added a comment - Bug is not reproduced with such versions: Jenkins 1.651.3 matrix-project-plugin 1.7.1 credentials plugin 1.24
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          It has been fixed by https://github.com/jenkinsci/matrix-project-plugin/pull/44 in Matrix Project 1.10

          Show
          oleg_nenashev Oleg Nenashev added a comment - It has been fixed by https://github.com/jenkinsci/matrix-project-plugin/pull/44 in Matrix Project 1.10

            People

            Assignee:
            kohsuke Kohsuke Kawaguchi
            Reporter:
            rschupp Roderich Schupp
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: