-
Bug
-
Resolution: Duplicate
-
Minor
-
None
I tried using string parameter with declarative where user types in their user store credential id but then declarative 'credentials' DSL failed to find it. Below is sample script where 'my-user-cred' is credential id created in user credentials store.
pipeline{ agent any environment { USER_CRED = credentials('my-user-cred') } stages { stage('Example') { steps { sh 'echo ${USER_CRED}' } } } }
It fails with:
org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: my-user-cred at org.jenkinsci.plugins.pipeline.modeldefinition.model.CredentialsBindingHandler.forId(CredentialsBindingHandler.java:121) at org.jenkinsci.plugins.pipeline.modeldefinition.model.CredentialsBindingHandler$forId.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18) at
- duplicates
-
JENKINS-44772 User Scoped credentials are not used by the "withCredentials" pipeline step
-
- Open
-
[JENKINS-44635] Declarative credentials() can't see user store credentials
Description |
Original:
I tried using string parameter with declarative where user types in their user store credential id but then declarative 'credentials' DSL failed to find it. Below is sample script where 'my-user-cred' is credential id created in user credentials store. {code:java} pipeline{ agent any environment { USER_CRED = credentials('my-user-cred') } stages { stage('Example') { steps { sh 'echo ${USER_CRED}' } } } } {code} It fails with: {code:java} org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: my-user-cred at org.jenkinsci.plugins.pipeline.modeldefinition.model.CredentialsBindingHandler.forId(CredentialsBindingHandler.java:121) at org.jenkinsci.plugins.pipeline.modeldefinition.model.CredentialsBindingHandler$forId.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18) at {code} |
New:
I tried using string parameter with declarative where user types in their user store credential id but then declarative 'credentials' DSL failed to find it. Below is sample script where 'my-user-cred' is credential id created in user credentials store. {code:java} pipeline{ agent any environment { USER_CRED = credentials('my-user-cred') } stages { stage('Example') { steps { sh 'echo ${USER_CRED}' } } } } {code} It fails with: {code:java} org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: my-user-cred at org.jenkinsci.plugins.pipeline.modeldefinition.model.CredentialsBindingHandler.forId(CredentialsBindingHandler.java:121) at org.jenkinsci.plugins.pipeline.modeldefinition.model.CredentialsBindingHandler$forId.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18) at {code} |
Link | New: This issue duplicates JENKINS-44772 [ JENKINS-44772 ] |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Bulk closing resolved issues.