jenkinsci / jenkinsci/credentials-binding-plugin

[JENKINS-32402] Credentials binding fails to find creds when using a Parameterized Expression, but only for timed jobs

Open
#413 14 comments 0 reactions 0 assignees View on GitHub
component:credentials-binding-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
57
Forks
108
PR merge metrics
No merged PRs in 30d

Description

This job attempts to:



  • Take a parameter GAMESPARKS_CREDS_ID as creds

  • Use Credentials Binding to convert the creds into an environment variable GAMESPARKS_CREDS that is the concatenation of username:password for use in a shell script

  • Do so every 2 minutes

When triggered manually, it works fine. But when triggered by the timer, it fails with the following message:

FATAL: ${GAMESPARKS_CREDS_ID}

org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: ${GAMESPARKS_CREDS_ID}
at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:124)
at org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordBinding.bindSingle(UsernamePasswordBinding.java:50)
at org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:126)
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:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Finished: FAILURE

If there's a better way to make credentials available in a build script, I'm open to that.

---
Originally reported by nirvine_bnsv, imported from: Credentials binding fails to find creds when using a Parameterized Expression, but only for timed jobs


  • status: Open
  • priority: Major
  • component(s): credentials-binding-plugin
  • resolution: Unresolved
  • votes: 24
  • watchers: 29
  • imported: 20251211-141027

Raw content of original issue

This job attempts to:



  • Take a parameter GAMESPARKS_CREDS_ID as creds

  • Use Credentials Binding to convert the creds into an environment variable GAMESPARKS_CREDS that is the concatenation of username:password for use in a shell script

  • Do so every 2 minutes

When triggered manually, it works fine. But when triggered by the timer, it fails with the following message:


FATAL: ${GAMESPARKS_CREDS_ID}

org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: ${GAMESPARKS_CREDS_ID}
at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:124)
at org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordBinding.bindSingle(UsernamePasswordBinding.java:50)
at org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:126)
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:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Finished: FAILURE

If there's a better way to make credentials available in a build script, I'm open to that.

1 attachment

- [creds-config.xml](https://issues.jenkins.io/secure/attachment/31605/creds-config.xml)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.