Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68751

Cannot use non-global ssh key credential in pipline job configuration

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • git-plugin

      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.

          [JENKINS-68751] Cannot use non-global ssh key credential in pipline job configuration

          p cowlinator created issue -
          p cowlinator made changes -
          Environment Original: Jenkins 2.354
          GitHub plugin Version1.34.3
          Pipeline Version2.6
          Pipeline: Multibranch Version716.vc692a_e52371b_
          Jenkins is running in a linux docker container (jenkins/jenkins:lts@sha256:99fd3cb74257d1df7678c19106586a2da127cd1b08484c9201c7130d4fab92c1)
          New: 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)
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            Unassigned Unassigned
            cowlinator p cowlinator
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: