Error permission denied when clone remote repo

487 views
Skip to first unread message

SysAdmin EM

unread,
Dec 22, 2021, 5:28:20 PM12/22/21
to jenkins...@googlegroups.com
I install Jenkins in Ubuntu 20.04 and create my first task in my localhost, to clone a test repository en my localhost.

Captura de pantalla de 2021-12-22 17-55-20.png

when i try to build i see this error "stderr: /home/emanuel/git-test/.git: permission denied"

Running as SYSTEM
Building in workspace /home/emanuel/git-test
The recommended git tool is: NONE
No credentials specified
Cloning the remote Git repository
Cloning repository https://github.com/pilchita/test-jenkins.git
 > git init /home/emanuel/git-test # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /home/emanuel/git-test
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:1048)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:803)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1224)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
at hudson.scm.SCM.checkout(SCM.java:505)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1213)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
at hudson.model.Run.execute(Run.java:1888)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:99)
at hudson.model.Executor.run(Executor.java:432)
Caused by: hudson.plugins.git.GitException: Command "git init /home/emanuel/git-test" returned status code 1:
stdout:
stderr: /home/emanuel/git-test/.git: Permiso denegado

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2681)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2611)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2607)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1974)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:1046)
... 12 more
ERROR: Error cloning remote repo 'origin'
Finished: FAILURE

Any helps??

Mark Waite

unread,
Dec 22, 2021, 5:33:38 PM12/22/21
to Jenkins Users
On Wednesday, December 22, 2021 at 3:28:20 PM UTC-7 Emanuel wrote:
I install Jenkins in Ubuntu 20.04 and create my first task in my localhost, to clone a test repository en my localhost.

Captura de pantalla de 2021-12-22 17-55-20.png

when i try to build i see this error "stderr: /home/emanuel/git-test/.git: permission denied"

 
Running as SYSTEM
Building in workspace /home/emanuel/git-test
The recommended git tool is: NONE
No credentials specified
Cloning the remote Git repository
Cloning repository https://github.com/pilchita/test-jenkins.git
 > git init /home/emanuel/git-test # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /home/emanuel/git-test
 
Caused by: hudson.plugins.git.GitException: Command "git init /home/emanuel/git-test" returned status code 1:

stdout:
stderr: /home/emanuel/git-test/.git: Permiso denegado


Command line git attempted to perform the command "git init  /home/emanuel/git-test" and was not allowed to write to that location as the user that is running the Jenkins controller process.  

Jenkins runs as the user 'jenkins' when installed with the package manager on Ubuntu and Debian.  The user 'jenkins' does not have permission to write to '/home/emanuel'.

Let Jenkins control its own directories by using the default workspace assigned to Jenkins.  Don't assign it to write to /home/emanuel when its default is writing to a different location.

Mark Waite

Reply all
Reply to author
Forward
0 new messages