jenkinsci / jenkinsci/aws-credentials-plugin
java.lang.NullPointerException for the Credentials plugin
- Dominant language
- Java
- Stars
- 30
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
### Jenkins and plugins versions report
Jenkins: 2.462.3
OS: Linux - 6.1.87-99.174.amzn2023.x86_64
Java: 21.0.2 - Amazon.com Inc. (OpenJDK 64-Bit Server VM)
---
ant:497.v94e7d9fffa_b_9
antisamy-markup-formatter:162.v0e6ec0fcfcf6
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
apache-httpcomponents-client-5-api:5.3.1-1.0
asm-api:9.7.1-97.v4cc844130d97
authentication-tokens:1.119.v50285141b_7e1
aws-credentials:243.v41c19a_fb_5dcf
aws-java-sdk-ec2:1.12.772-477.v650d756dcf6d
aws-java-sdk-minimal:1.12.772-477.v650d756dcf6d
aws-java-sdk2-core:2.30.10-22.v1339d66b_e0f4
aws-java-sdk2-ec2:2.30.10-22.v1339d66b_e0f4
blueocean-commons:1.27.11
blueocean-core-js:1.27.11
blueocean-dashboard:1.27.11
blueocean-jwt:1.27.11
blueocean-pipeline-api-impl:1.27.11
blueocean-pipeline-editor:1.27.11
blueocean-pipeline-scm-api:1.27.11
blueocean-rest:1.27.11
blueocean-rest-impl:1.27.11
blueocean-web:1.27.11
bootstrap5-api:5.3.2-3
bouncycastle-api:2.30.1.78.1-248.ve27176eb_46cb_
branch-api:2.1144.v1425d1c3d5a_7
build-timeout:1.32
caffeine-api:3.1.8-133.v17b_1ff2e0599
checks-api:2.0.2
cloud-stats:336.v788e4055508b_
cloudbees-folder:6.858.v898218f3609d
command-launcher:107.v773860566e2e
commons-lang3-api:3.13.0-62.v7d18e55f51e2
commons-text-api:1.11.0-95.v22a_d30ee5d36
credentials:1384.vf0a_2ed06f9c6
credentials-binding:681.vf91669a_32e45
display-url-api:2.200.vb_9327d658781
docker-commons:439.va_3cb_0a_6a_fb_29
docker-java-api:3.3.4-86.v39b_a_5ede342c
docker-plugin:1.5
durable-task:543.v262f6a_803410
echarts-api:5.4.3-2
eddsa-api:0.3.0-4.v84c6f0f4969e
email-ext:2.104
favorite:2.208.v91d65b_7792a_c
font-awesome-api:6.5.1-2
generic-webhook-trigger:2.0.0
git:5.2.1
git-client:4.6.0
github:1.37.3.1
github-api:1.318-461.v7a_c09c9fa_d63
github-branch-source:1772.va_69eda_d018d4
gitlab-api:5.3.0-91.v1f9a_fda_d654f
gitlab-branch-source:702.v7dde70ed1522
gitlab-oauth:1.19
gitlab-plugin:1.8.0
gradle:2.9
gson-api:2.10.1-15.v0d99f670e0a_7
handy-uri-templates-2-api:2.1.8-30.v7e777411b_148
htmlpublisher:1.32
instance-identity:185.v303dc7c645f9
ionicons-api:74.v93d5eb_813d5f
jackson2-api:2.17.0-379.v02de8ec9f64c
jakarta-activation-api:2.1.3-1
jakarta-mail-api:2.1.3-1
javax-activation-api:1.2.0-7
javax-mail-api:1.6.2-10
jaxb:2.3.9-1
jdk-tool:73.vddf737284550
jenkins-design-language:1.27.11
jersey2-api:2.41-133.va_03323b_a_1396
jira:3.13
jjwt-api:0.11.5-77.v646c772fddb_0
job-import-plugin:3.6
joda-time-api:2.13.0-93.v9934da_29b_a_e9
jquery3-api:3.7.1-1
json-api:20240303-41.v94e11e6de726
json-path-api:2.9.0-33.v2527142f2e1d
junit:1296.vb_f538b_c88630
ldap:711.vb_d1a_491714dc
mailer:472.vf7c289a_4b_420
matrix-auth:3.2.2
matrix-project:832.va_66e270d2946
mina-sshd-api-common:2.12.0-90.v9f7fb_9fa_3d3b_
mina-sshd-api-core:2.12.0-90.v9f7fb_9fa_3d3b_
multibranch-scan-webhook-trigger:1.0.11
multiselect-parameter:1.7
okhttp-api:4.11.0-157.v6852a_a_fa_ec11
pam-auth:1.10
pipeline-build-step:540.vb_e8849e1a_b_d8
pipeline-github-lib:42.v0739460cda_c4
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-groovy-lib:704.vc58b_8890a_384
pipeline-input-step:495.ve9c153f6067b_
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2218.v56d0cda_37c72
pipeline-model-definition:2.2175.v76a_fff0a_2618
pipeline-model-extensions:2.2218.v56d0cda_37c72
pipeline-rest-api:2.34
pipeline-stage-step:312.v8cd10304c27a_
pipeline-stage-tags-metadata:2.2175.v76a_fff0a_2618
pipeline-stage-view:2.34
pipeline-utility-steps:2.16.2
plain-credentials:183.va_de8f1dd5a_2b_
plugin-util-api:3.8.0
pubsub-light:1.18
remote-file:1.24
resource-disposer:0.23
scm-api:696.v778d637b_a_762
script-security:1369.v9b_98a_4e95b_2d
snakeyaml-api:2.2-111.vc6598e30cc65
ssh-credentials:349.vb_8b_6b_9709f5b_
ssh-slaves:2.948.vb_8050d697fec
sshd:3.330.vc866a_8389b_58
structs:338.v848422169819
timestamper:1.26
token-macro:400.v35420b_922dcb_
trilead-api:2.147.vb_73cc728a_32e
uno-choice:2.8.3
variant:60.v7290fc0eb_b_cd
workflow-aggregator:596.v8c21c963d92d
workflow-api:1358.vfb_5780da_64cb_
workflow-basic-steps:1042.ve7b_140c4a_e0c
workflow-cps:4009.v0089238351a_9
workflow-durable-task-step:1317.v5337e0c1fe28
workflow-job:1385.vb_58b_86ea_fff1
workflow-multibranch:773.vc4fe1378f1d5
workflow-scm-step:427.v4ca_6512e7df1
workflow-step-api:678.v3ee58b_469476
workflow-support:943.v8b_0d01a_7b_a_08
ws-cleanup:0.45
### What Operating System are you using (both controller, and any agents involved in the problem)?
Linux OS
### Reproduction steps
1. Added crendetials mapper like below:
withCredentials([[
$class: 'AmazonWebServicesCredentialsBinding',
credentialsId: 'aws-shared-account',
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY'
]]) {
2. Run the pipeline. It gives below error
Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 8b612058-9c74-4276-9677-44a41163abc5
java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at PluginClassLoader for credentials//com.cloudbees.plugins.credentials.CredentialsProvider.findCredentialById(CredentialsProvider.java:897)
at PluginClassLoader for credentials//com.cloudbees.plugins.credentials.CredentialsProvider.findCredentialById(CredentialsProvider.java:866)
at PluginClassLoader for credentials-binding//org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:195)
at PluginClassLoader for aws-credentials//com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding.bind(AmazonWebServicesCredentialsBinding.java:134)
at PluginClassLoader for credentials-binding//org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Execution2.doStart(BindingStep.java:132)
at PluginClassLoader for workflow-step-api//org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Finished: FAILURE
### Expected Results
Credentials should be correctly processed
### Actual Results
Failing with below error
Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 8b612058-9c74-4276-9677-44a41163abc5
java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at PluginClassLoader for credentials//com.cloudbees.plugins.credentials.CredentialsProvider.findCredentialById(CredentialsProvider.java:897)
at PluginClassLoader for credentials//com.cloudbees.plugins.credentials.CredentialsProvider.findCredentialById(CredentialsProvider.java:866)
at PluginClassLoader for credentials-binding//org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:195)
at PluginClassLoader for aws-credentials//com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding.bind(AmazonWebServicesCredentialsBinding.java:134)
at PluginClassLoader for credentials-binding//org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Execution2.doStart(BindingStep.java:132)
at PluginClassLoader for workflow-step-api//org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Finished: FAILURE
### Anything else?
_No response_
### Are you interested in contributing a fix?
_No response_
Contributor guide
Research direction
Reproduce the pipeline using the AmazonWebServicesCredentialsBinding example and the reported plugin versions. Start at AmazonWebServicesCredentialsBinding.bind, then follow MultiBinding.getCredentials and CredentialsProvider.findCredentialById as shown in the stack trace. Done means the configured AWS credential is processed without the reported NullPointerException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100