You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What Operating System are you using (both controller, and any agents involved in the problem)?
Jenkins running on Docker
Reproduction steps
Create an SSH Key credential "locally" on Jenkins, by manually creating a credential, and copy/pasting the Secret key and username. Jenkins > Manage Jenkins > Credential > Add credential
Using the Secret Manager plugin, load a previously uploaded SSH Key credential from AWS Secret Manager
Make sure both keys are added to Github and have the correct permissions on the repo being tested
Test with the pipelines below for a github repository:
pipeline {
agent any
environment {
// The key below is manually entered in Jenkins
CREDENTIALS_ID_LOCAL = "xx-yy-zz"
// This one below is imported via AWS Secret Manager plugin
CREDENTIALS_ID_AWS = "global/dashboard/jenkins/dahboard_jenkins_ssh_key_api_eng_user"//
}
stages {
stage('this step works') {
steps {
sshagent(credentials: [CREDENTIALS_ID_LOCAL]) {
script {
sh(returnStdout: true, script: 'git fetch')
}
}
}
}
stage('this one does not') {
steps {
sshagent(credentials: [CREDENTIALS_ID_AWS]) {
script {
sh(returnStdout: true, script: 'git fetch')
}
}
}
}
}
}
Expected Results
Both steps should successfully execute the git fetch . The first stage works, but the second does not.
Actual Results
During the second step, we get the below message:
[ssh-agent] Using credentials EDITED-BUT -THIS-SHOWS-THE-CORRECT-SECRET-NAME
[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-QHrN9yoaNjpv/agent.8848
SSH_AGENT_PID=8851
Running ssh-add (command line suppressed)
Error loading key "/var/jenkins_home/workspace/folder_location_edited@tmp/private_key_2322035249091043671.key": invalid format
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Jenkins running on Docker
Reproduction steps
Expected Results
Both steps should successfully execute the
git fetch
. The first stage works, but the second does not.Actual Results
During the second step, we get the below message:
Anything else?
No response
The text was updated successfully, but these errors were encountered: