-
Bug
-
Resolution: Cannot Reproduce
-
Minor
The helptext is at odds with what gets generated by the Snippet Generator (see screenshot).
node { sshagent (credentials: ['deploy-dev']) { sh 'ssh -o StrictHostKeyChecking=no -l cloudbees 192.168.1.106 uname -a' } }Multiple credentials could be passed in the array but it is not supported using Snippet Generator.
This would be useful, since I have a staging and a production Jenkins master and I would like to refer to the credential by name instead of ID so I can use it between hosts. The snippet generated is with the ID, and only that will work it seems:
sshagent(['05917262-0ebf-4491-bc84-5029e36ad0e8']) { // some block }
If I attempt to use the credentials: ['foo'] syntax, my job will fail:
FATAL: [ssh-agent] Could not find specified credentials
[ssh-agent] Looking for ssh-agent implementation...
[ssh-agent] Java/JNR ssh-agent
[ssh-agent] Started.
- is related to
-
JENKINS-32102 Only credentials added via the snippet generator are usable
-
- Resolved
-
[JENKINS-32101] Credentials must be referred to by ID which is Jenkins master specific
Link |
New:
This issue is related to |
Resolution | New: Cannot Reproduce [ 5 ] | |
Status | Original: Open [ 1 ] | New: Closed [ 6 ] |
Workflow | Original: JNJira [ 167584 ] | New: JNJira + In-Review [ 209548 ] |
Labels | Original: workflow | New: pipeline workflow |
Labels | Original: pipeline workflow | New: pipeline |
Resolution | Original: Cannot Reproduce [ 5 ] | |
Status | Original: Closed [ 6 ] | New: Reopened [ 4 ] |
Attachment | New: creds.PNG [ 35011 ] | |
Attachment | New: pipeline_snippet_generator.PNG [ 35012 ] |
Resolution | New: Cannot Reproduce [ 5 ] | |
Status | Original: Reopened [ 4 ] | New: Resolved [ 5 ] |
Comment |
[ I am having the same issue as described in this ticket. I'm sorry to reopen this issue if that's not the correct process. I've tried adding credentials in the Snippet Generator as well as through the main Jenkins Credential interface. No matter which way they are added, they don't appear to be available in the Pipeline. Pipeline: 2.4 Jenkins: 2.19.2 [Pipeline] sshagent FATAL: [ssh-agent] Could not find specified credentials [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/JNR ssh-agent [ssh-agent] Skipped registering BouncyCastle, not running on a remote agent [ssh-agent] Started. [Pipeline] { [Pipeline] sh [ssh-agent] Stopped. [ui] Running shell script + ssh -o StrictHostKeyChecking=no -l cloudui 10.x.x.x uname -a Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,password). [Pipeline] } [Pipeline] // sshagent [Pipeline] } [Pipeline] // withEnv [Pipeline] } [Pipeline] // dir [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code 255 ] |
Attachment | Original: pipeline_snippet_generator.PNG [ 35012 ] |