-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
Jenkins 2.354
GitHub plugin Version 1.34.3
Pipeline Version 2.6
Pipeline: Multibranch Version 716.vc692a_e52371b_
Jenkins is running in a linux docker container (jenkins/jenkins:lts@sha256:99fd3cb74257d1df7678c19106586a2da127cd1b08484c9201c7130d4fab92c1)
When configuring a pipeline job, a non-global ssh key credential cannot be chosen when defining the git repository that contains the Jenkinsfile.
Repro:
- Go to "manage credentials"
- Go to "Stores scoped to Jenkins" to get to the "system" scope
- Create a new domain (or use an existing one)
- Create a "ssh username with private key" credential
- Create a new "Pipeline" job
- Configure the job
- Under "pipeline" -> "definition", choose "Pipeline script from SCM", then "Git", then fill in a git url in ssh format.
- Click the "credentials" dropdown. Notice that the newly created ssh credential does not appear on the list.
However, the ssh key actually does appear for a multi-branch pipeline job.
Also, the ssh key actually does appear for a pipeline job if the credential is in the global scope.
I don't believe that this is just a UI problem. We had a pipeline job that had previously been working and had been configured with a system domain scope ssh key. At some point, it started failing with Permission denied (publickey) . Upon opening the job configuration, the UI showed that the credential was missing (not "None", but missing), even though the credential still existed. The credential no longer appeared on the list of credentials in the job config UI.
I can't duplicate the problem as described. Steps that I took while trying to duplicate the problem:
JENKINS-68751exploratory ED 25519 private key"JENKINS-68751-non-global-ssh-key-credential-unavailable-to-pipeline"JENKINS-68751exploratory ED 25519 private key"I've stored the results of those steps in my docker image so that I can refer to them in the future, but it shows me that the code is working as expected. Any suggestions what I'm doing differently compared to what you're doing? I'm using the latest plugin versions as described in my docker-lfs repository.
I also confirmed that the credential I had defined was not visible when I attempted to use a repository with a different URL, like git@github.com:MarkEWaite/bin.git