Jenkins ssh-agent plugin: private key cannot be retrieved

237 views
Skip to first unread message

MAKIUCHI, EDWIN Y

unread,
Apr 4, 2019, 2:26:06 PM4/4/19
to jenkins...@googlegroups.com

Hi,

 

I am resending this email since the last one seemed to encounter a delivery failure.

 

The private key generated by the ssh-agent plugin cannot be found during the execution of a pipeline job:

 

[ssh-agent] Using credentials svc-jenkins (Private key for svc-jenkins to access repos on bitbucket)

[ssh-agent] Looking for ssh-agent implementation...

[ssh-agent]   Exec ssh-agent (binary ssh-agent on a remote machine)

$ ssh-agent

SSH_AUTH_SOCK=/tmp/ssh-vxwIED770k3P/agent.196

SSH_AGENT_PID=198

$ ssh-add /users/jenkins/workspace/dka-ovcms_test_feature_cicd-LZWI5LYQXFUOKHUMW7I45K2F6TBKTEU6UU44VGSQNIYAMA6UYW5A@tmp/private_key_8268391044362948453.key

Identity added: /users/jenkins/workspace/dka-ovcms_test_feature_cicd-LZWI5LYQXFUOKHUMW7I45K2F6TBKTEU6UU44VGSQNIYAMA6UYW5A@tmp/private_key_8268391044362948453.key (/users/jenkins/workspace/dka-ovcms_test_feature_cicd-LZWI5LYQXFUOKHUMW7I45K2F6TBKTEU6UU44VGSQNIYAMA6UYW5A@tmp/private_key_8268391044362948453.key)

[ssh-agent] Started.

[Pipeline] {

[Pipeline] sh

[dka-ovcms_test_feature_cicd-LZWI5LYQXFUOKHUMW7I45K2F6TBKTEU6UU44VGSQNIYAMA6UYW5A] Running shell script

$ ssh-agent -k

unset SSH_AUTH_SOCK;

unset SSH_AGENT_PID;

echo Agent pid 198 killed;

[ssh-agent] Stopped.

+ cat '/users/jenkins/workspace/dka-ovcms_test_feature_cicd-LZWI5LYQXFUOKHUMW7I45K2F6TBKTEU6UU44VGSQNIYAMA6UYW5A@tmp/private_key_*.key'

cat: /users/jenkins/workspace/dka-ovcms_test_feature_cicd-LZWI5LYQXFUOKHUMW7I45K2F6TBKTEU6UU44VGSQNIYAMA6UYW5A@tmp/private_key_*.key: No such file or directory

 

This is the same behavior described in the following page:

 

https://groups.google.com/forum/#!topic/jenkinsci-users/keR8yjf7ZHY

 

Can you let me know how the private key can be retrieved during the pipeline execution?

This value needs to be sent to the developer project’s Dockerfile so private repositories can be cloned using these credentials during the Docker image creation.

 

Please let me know if there is any information I can provide.

 

Thanks,

 

Edwin Makiuchi

AT&T - Continuous Integration/Continuous Delivery

LA3/1142B, 2230 E. Imperial Highway, El Segundo, CA 90245

em5...@att.com

 

Reply all
Reply to author
Forward
0 new messages