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

Not in a git directory errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Blocker Blocker
    • git-plugin

      Started getting all sorts of checkout errors after upgrading git plugins to the latest version.

       

      Multibranch job indexing started to throw errors for single Gogs repos (Github repos are indexed but fail when running jobs):

       

      Looking up details of XXXXXX...
      Organization URL: XXXXXX
      [Wed Feb 01 13:31:27 GMT 2023] Consulting GitHub Organization
      13:31:27 Connecting to https://api.github.com using Jenkins XXXXXX Looking up repositories of user XXXXXX
        Proposing analysis-model
      Examining Mulgish/analysis-model
      
        Checking branches...
      
        Getting remote branches...
      
          Checking branch master
      No local file defined. Skipping Source Code SCM probe, since Jenkinsfile will be provided by Remote Jenkins File Plugin
          Met criteria
      
        1 branches were processed (query completed)
      
        1 branches were processed
      
      Finished examining Mulgish/analysis-model
      
      Proposing MutinyFX
      Examining Mulgish/MutinyFX
      
        Checking branches...
      
        Getting remote branches...
      
          Checking branch main
      No local file defined. Skipping Source Code SCM probe, since Jenkinsfile will be provided by Remote Jenkins File Plugin
          Met criteria
      
        1 branches were processed (query completed)
      
        1 branches were processed
      
      Finished examining Mulgish/MutinyFX
      
      Proposing warnings-ng-plugin
      Examining Mulgish/warnings-ng-plugin
      
        Checking branches...
      
        Getting remote branches...
      
          Checking branch master
      No local file defined. Skipping Source Code SCM probe, since Jenkinsfile will be provided by Remote Jenkins File Plugin
          Met criteria
      
        1 branches were processed (query completed)
      
        1 branches were processed
      
      Finished examining Mulgish/warnings-ng-plugin
      
      13:31:30 3 repositories were processed
      [Wed Feb 01 13:31:30 GMT 2023] Consulting Single repository
       > git rev-parse --resolve-git-dir /var/jenkins_home/caches/git-e4021de26cf1cebe22fb56083e970129/.git # timeout=10
      Setting origin to https://gogs.internal/xxxxxx
        > git config remote.origin.url https://gogs.internal/xxxxxx 
      # timeout=10
      ERROR: Failed to create or update a subproject xxxxxx
      hudson.plugins.git.GitException: Command "git config remote.origin.url https://gogs.internal/xxxxxx" returned status code 128:
      stdout: 
      stderr: fatal: not in a git directory
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2734)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2660)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2656)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1981)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1993)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1601)
      	at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:161)
      	at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:381)
      	at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:350)
      	at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:590)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:327)
      	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:261)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1358)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1373)
      	at jenkins.scm.impl.SingleSCMNavigator.visitSources(SingleSCMNavigator.java:78)
      	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:535)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:166)
      	at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:917)
      	at hudson.model.ResourceController.execute(ResourceController.java:101)
      	at hudson.model.Executor.run(Executor.java:442)
      [Wed Feb 01 13:31:30 GMT 2023] Consulting Single repository
       > git rev-parse --resolve-git-dir /var/jenkins_home/caches/git-992dbde355d1d72f7a50c0b5f51d0e23/.git # timeout=10
      Setting origin to https://gogs.internal/xxxxxx  > git config remote.origin.url https://gogs.internal/xxxxxx # timeout=10
      ERROR: Failed to create or update a subproject xxxxxx
      hudson.plugins.git.GitException: Command "git config remote.origin.url https://gogs.internal/xxxxxx" returned status code 128:
      stdout: 
      stderr: fatal: not in a git directory
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2734)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2660)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2656)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1981)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1993)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1601)
      	at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:161)
      	at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:381)
      	at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:350)
      	at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:590)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:327)
      	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:261)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1358)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1373)
      	at jenkins.scm.impl.SingleSCMNavigator.visitSources(SingleSCMNavigator.java:78)
      	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:535)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:166)
      	at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:917)
      	at hudson.model.ResourceController.execute(ResourceController.java:101)
      	at hudson.model.Executor.run(Executor.java:442) 

       

       

       

      Pipelines started failing with below errors:

       

      22:50:45  The recommended git tool is: NONE
      22:50:45  using credential jenkins_svc_vcs
      22:50:45   > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/CI_foobar_main@script/a06cb9a0b5c86ab8e2e832b21c314405ffcb0a9520a6c56990348fa4eb7a901f/.git # timeout=10
      22:50:45  Fetching changes from the remote Git repository
      22:50:45   > git config remote.origin.url https://gogs.internal/xxxx # timeout=10
      22:50:45  ERROR: Error fetching remote repo 'origin'
      22:50:45  hudson.plugins.git.GitException: Failed to fetch from https://gogs.internal/xxxx 22:50:45      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1003)
      22:50:45      at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1245)
      22:50:45      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1309)
      22:50:45      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
      22:50:45      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:159)
      22:50:45      at org.jenkinsci.plugins.workflow.multibranch.extended.scm.ExtendedSCMBinder.create(ExtendedSCMBinder.java:120)
      22:50:45      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:312)
      22:50:45      at hudson.model.ResourceController.execute(ResourceController.java:101)
      22:50:45      at hudson.model.Executor.run(Executor.java:442)
      22:50:45  Caused by: hudson.plugins.git.GitException: Command "git config remote.origin.url https://gogs.internal/xxxx" returned status code 128:
      22:50:45  stdout: 
      22:50:45  stderr: fatal: not in a git directory
      22:50:45  
      22:50:45      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2734)
      22:50:45      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2660)
      22:50:45      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2656)
      22:50:45      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1981)
      22:50:45      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1993)
      22:50:45      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1601)
      22:50:45      at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:161)
      22:50:45      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:991)
      22:50:45      ... 8 more
      22:50:45  ERROR: Error fetching remote repo 'origin'
      22:50:45  ERROR: Maximum checkout retry attempts reached, aborting 

       

       

        1. jobs-freestyle-config.xml
          1 kB
        2. plugins.txt
          0.8 kB
        3. run-jenkins.sh
          1 kB

            Unassigned Unassigned
            mulgish Juri Duval
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: