[JIRA] (JENKINS-36470) Parameter Expression throws CredentialNotFoundException

79 views
Skip to first unread message

erik@theothersonline.eu (JIRA)

unread,
Jul 6, 2016, 5:45:01 AM7/6/16
to jenkinsc...@googlegroups.com
Erik The Other Wizzard updated an issue
 
Jenkins / Bug JENKINS-36470
Parameter Expression throws CredentialNotFoundException
Change By: Erik The Other Wizzard
Summary: Parameter Expression always throws CredentialNotFoundException
Environment: Jenkins ver. 1.648

os.arch amd64
os.name Linux
os.version 4.2.0-38-generic
java.runtime.name OpenJDK Runtime Environment
java.runtime.version 1.7.0_101-b00
java.vm.name OpenJDK 64-Bit Server VM

Plugins:
plain-credentials 1.2 true false
credentials 2.1.4 true false
credentials-binding 1.8 true false
When configuring a job with credentials binding the 'specific credentials' do work but when I try to use the 'parameter expression' it always fails with the following message:

```
[EnvInject] - Loading node environment variables.
[EnvInject] - Preparing an environment for the build.
[EnvInject] - Keeping Jenkins system variables.
[EnvInject] - Keeping Jenkins build variables.
[EnvInject] - Evaluation the following Groovy script content:
println "secret_file_id:" + secret_file_id

secret_file_id:keystore
[EnvInject] - Injecting contributions.
Building on master in workspace /var/lib/jenkins/workspace/Credential-binding-parameter-expression
FATAL: ${secret_file_id}
org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: ${secret_file_id}
at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:124)
at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.bindSingle(FileBinding.java:52)
at org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:133)
at org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper.setUp(SecretBuildWrapper.java:58)
at hudson.model.Build$BuildExecution.doRun(Build.java:156)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE
```
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

erik@theothersonline.eu (JIRA)

unread,
Jul 6, 2016, 5:46:02 AM7/6/16
to jenkinsc...@googlegroups.com
Erik The Other Wizzard updated an issue
When configuring a job with credentials binding the 'specific credentials' do work but when I try to use the 'parameter expression' it always fails with the following message:

``` {code}
[EnvInject] - Loading node environment variables.
[EnvInject] - Preparing an environment for the build.
[EnvInject] - Keeping Jenkins system variables.
[EnvInject] - Keeping Jenkins build variables.
[EnvInject] - Evaluation the following Groovy script content:
println "secret_file_id:" + secret_file_id

secret_file_id:keystore
[EnvInject] - Injecting contributions.
Building on master in workspace /var/lib/jenkins/workspace/Credential-binding-parameter-expression
FATAL: ${secret_file_id}
org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: ${secret_file_id}
at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:124)
at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.bindSingle(FileBinding.java:52)
at org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:133)
at org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper.setUp(SecretBuildWrapper.java:58)
at hudson.model.Build$BuildExecution.doRun(Build.java:156)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE
``` {code}

erik@theothersonline.eu (JIRA)

unread,
Jul 6, 2016, 6:02:01 AM7/6/16
to jenkinsc...@googlegroups.com
Erik The Other Wizzard updated an issue
Attachment: bot-config.xml
Attachment: environment-variables.png

erik@theothersonline.eu (JIRA)

unread,
Jul 6, 2016, 6:03:02 AM7/6/16
to jenkinsc...@googlegroups.com

erik@theothersonline.eu (JIRA)

unread,
Jul 6, 2016, 6:07:01 AM7/6/16
to jenkinsc...@googlegroups.com
Erik The Other Wizzard updated an issue


As shown in config-attachment the referenced secret file (ID: 'keystore') is found when using the specific credentials option. When I try to load it dynamically with the parameter expression using ${secret_file_id} the exception is thrown.


erik@theothersonline.eu (JIRA)

unread,
Jul 6, 2016, 8:04:01 AM7/6/16
to jenkinsc...@googlegroups.com
I've spend a fair amount of time testing with different settings for credentials and plugin versions but none fixed my issue. I've attached an example job configuration that mimics my issue.

Basically the one I'm trying to achieve is a job that based upon a parameter builds and signs an Android app. The parameter is either supplied through a properties file inside a git repo or by making the build 'parameterized'. Any help would be appreciated!

Cheers, Erik

stephenconnolly@java.net (JIRA)

unread,
Jul 21, 2016, 7:10:03 AM7/21/16
to jenkinsc...@googlegroups.com
stephenconnolly resolved as Not A Defect
 

For security reasons, the only parameters that can be expanded are Credentials Parameters as this is the only parameter type that allows us to determine whether

  • the supplied value is the default (and hence can be searched using the authentication that the build is running as but cannot be searched from the user who triggered the build's credentials stores)
  • the supplied value was a user configured value and thus can be searched from the user's credentials store (and optionally the authentication stores of the user the build is running as provided that the user who triggered the build has the permission to use those credentials)

If you change the parameter to a Credentials Parameter then the expansion works.

Change By: stephenconnolly
Status: Open Resolved
Resolution: Not A Defect

stephenconnolly@java.net (JIRA)

unread,
Jul 21, 2016, 7:10:03 AM7/21/16
to jenkinsc...@googlegroups.com
stephenconnolly assigned an issue to stephenconnolly
Change By: stephenconnolly
Assignee: Jesse Glick stephenconnolly
Reply all
Reply to author
Forward
0 new messages