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

Jenkins jobs using a different git cred that what's configured

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None
    • Jenkins 2.249.3
      Running on Kubernetes 1.19.10
      Using the jenkins/jenkins:2.249.3 docker image

      Configured Git Credential ID: identity-ids

      Actually Used Git Credential ID: github-svc-sbseg-ci

      We have seen twice now that some of our multibranch pipeline jobs started using a different git credential to clone from git compared to what is configured in the multibranch pipeline. The scan repo log for the pipeline shows the the identity-ius credential is being used (screenshot attached) but the git clone within the actual pipeline jobs are using the values contained in the github-svc-sbseg-ci credential id. We validated this by checking the GitHub logs on our side (we host our own Github Enterprise server). 

      This has happened at least twice now. The first time we fixed this by doing the following

      1. Deleted all cache related items from the Jenkins home directory

      rm -rf $JENKINS_HOME/caches/* $JENKINS_HOME/org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache/* $JENKINS_HOME/org.jenkinsci.plugins.github.GitHubPlugin.cache/*
      

      2. Performing a hard restart of Jenkins (restarting the Jenkins process). We initially tried doing a soft restart (using the /restart url), but that did not work. 

      When viewing each of the credentials in the Jenkins UI, Jenkins correctly lists which jobs are associated with the credential. We are only seeing the mixup with the jobs are run. This is happening in both our multibranch pipelines and the test freestyle job I setup. 

      At this point we have not done a hard restart on this Jenkins yet and can collect any additional info that may be helpful. We are planning to restart it in a couple of days though to clean this up. 

          [JENKINS-66464] Jenkins jobs using a different git cred that what's configured

          SRO Jenkins added a comment - - edited

          Hello,
          We encounter this issue aswell.
          Currently we are on Jenkins main  version: 2.319.3 running on Windows 2016 Standard , version 1607, build 14393.4825.
          Git Plugin version: 4.10.3.

          We have restarted the service and when that did not relove the issue, the machine, still no change in behaviour.

          A workaround we found is to add the user in the URL to gitlab.

           

          In the logs on Giltab we can see the configured user information on the Jenkins  job is not passed to gitlab.
          We do see another account being used that does not have access to the gitlab repository.

          We still need to try the deletion of the cache during our next maintenance window ( 1 week from now ).

           

          If additional information is needed to address this issue please let us know.

           

          Kind regards,

          Gerson Leinenga

           

          SRO Jenkins added a comment - - edited Hello, We encounter this issue aswell. Currently we are on Jenkins main  version: 2.319.3 running on Windows 2016 Standard , version 1607, build 14393.4825. Git Plugin version: 4.10.3. We have restarted the service and when that did not relove the issue, the machine, still no change in behaviour. A workaround we found is to add the user in the URL to gitlab.   In the logs on Giltab we can see the configured user information on the Jenkins  job is not passed to gitlab. We do see another account being used that does not have access to the gitlab repository. We still need to try the deletion of the cache during our next maintenance window ( 1 week from now ).   If additional information is needed to address this issue please let us know.   Kind regards, Gerson Leinenga  

            Unassigned Unassigned
            mikenau_intuit Mike Nau
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: