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

cannot open .git/FETCH_HEAD: Permission denied

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • git-plugin
    • None
    • CentOS, Tomcat 6.0.29

      Hudson runs in Tomcat as Hudson.

      Identical jobs work perfectly well at this time.

      Some jobs like this show the error, then recover with no action taken.

      Initial error:

      Started by user Lee
      Building on master
      Checkout:workspace / /disk/hudson/jobs/DC_Chain_30_Aspects_goodsin_3030/workspace - hudson.remoting.LocalChannel@59601d60
      Using strategy: Default
      Last Built Revision: Revision 19273e2fc694db71b33500ab70967cbd92b4b2b2 (origin/master)
      Checkout:workspace / /disk/hudson/jobs/DC_Chain_30_Aspects_goodsin_3030/workspace - hudson.remoting.LocalChannel@59601d60
      GitAPI created
      Cloning the remote Git repository
      Cloning repository origin
      $ /usr/bin/git clone -o origin git@gitosis.net-a-porter.com:xt /disk/hudson/jobs/DC_Chain_30_Aspects_goodsin_3030/workspace
      ERROR: Error cloning remote repo 'origin' : Could not clone git@gitosis.net-a-porter.com:xt
      ERROR: Cause: Error performing /usr/bin/git clone -o origin git@gitosis.net-a-porter.com:xt /disk/hudson/jobs/DC_Chain_30_Aspects_goodsin_3030/workspace
      null
      Trying next repository
      ERROR: Could not clone repository
      FATAL: Could not clone
      hudson.plugins.git.GitException: Could not clone
      	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:719)
      	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:658)
      	at hudson.FilePath.act(FilePath.java:753)
      	at hudson.FilePath.act(FilePath.java:735)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:658)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1038)
      	at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
      	at hudson.model.Run.run(Run.java:1248)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:129)
      

      Later attempts to build show:

      Started by user Lee
      Building on master
      Checkout:workspace / /disk/hudson/jobs/DC_Chain_30_Aspects_goodsin_3030/workspace - hudson.remoting.LocalChannel@59601d60
      Using strategy: Default
      Last Built Revision: Revision 19273e2fc694db71b33500ab70967cbd92b4b2b2 (origin/master)
      Checkout:workspace / /disk/hudson/jobs/DC_Chain_30_Aspects_goodsin_3030/workspace - hudson.remoting.LocalChannel@59601d60
      GitAPI created
      Fetching changes from the remote Git repository
      Fetching upstream changes from git@gitosis.net-a-porter.com:xt
      [workspace] $ /usr/bin/git fetch -t git@gitosis.net-a-porter.com:xt +refs/heads/*:refs/remotes/origin/*
      error: cannot open .git/FETCH_HEAD: Permission denied
      
      ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
      ERROR: Could not fetch from any repository
      FATAL: Could not fetch from any repository
      hudson.plugins.git.GitException: Could not fetch from any repository
      	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:691)
      	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:658)
      	at hudson.FilePath.act(FilePath.java:753)
      	at hudson.FilePath.act(FilePath.java:735)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:658)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1038)
      	at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
      	at hudson.model.Run.run(Run.java:1248)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java
      

      Solved the problem by:

      • su hudson and ran the git command, got the 'cannot change to /root' error
      • sudo rm -Rf $the_workspace
      • {[su hudson}} ran the git command and got no problem.

      The workspace was craeted by Hudson by cloning another job.

            Unassigned Unassigned
            leegee leegee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: