I did - there is a credential for user "git" in the global credentials. But I noticed that $PWD is set to "/" - which is probably not what I want... I'll investigate further..
On Thursday, October 1, 2015 at 7:35:59 PM UTC+2, Mark Waite wrote: > > Did you define a credential and reference that credential when you defined > the git settings in the job definition? The run time environment may be > different between your logging in as the jenkins user with an interactive > shell and your running jenkins as a CentOS 7 service. > > Mark Waite > > On Thu, Oct 1, 2015 at 10:11 AM Henk van Voorthuijsen <[email protected] > <javascript:>> wrote: > >> Hi, >> >> I'm having trouble getting access to a local git repository: >> >> System: CentOS 7 >> >> I'm running Jenkins as a service using system >> >> When I try to set up a job with Git, the URL field shows the following >> error: >> >> >> Failed to connect to repository : Command "git -c core.askpass=true >> ls-remote -h git@localhost:repositories/puq HEAD" returned status code 128: >> stdout: >> stderr: Permission denied, please try again. >> Permission denied, please try again. >> Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). >> fatal: Could not read from remote repository. >> >> Please make sure you have the correct access rights >> and the repository exists. >> >> >> In order to test what is happening, I run the following script: >> >> whoami >> echo $USER >> cd /tmp >> rm -rf test >> mkdir test >> cd test >> git clone git@localhost:repositories/puq >> >> >> Which gives the following output: >> >> + whoami >> >> jenkins >> >> + echo jenkins >> >> jenkins >> >> + cd /tmp >> >> + rm -rf test >> >> + mkdir test >> >> + cd test >> >> + git clone git@localhost:repositories/puq >> >> Cloning into 'puq'... >> >> Permission denied, please try again. >> >> Permission denied, please try again. >> >> Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). >> >> fatal: Could not read from remote repository. >> >> Please make sure you have the correct access rights >> >> and the repository exists. >> >> >> So, basically the same error. >> >> When I run the same clone command from the command line (logged in as >> jenkins), however, the clone succeeds... >> >> I have the feeling I'm missing something obvious - can anyone tell me >> what's going on? >> >> Henk van Voorthuijsen >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-users/4e09f72f-f23b-4eeb-8eb7-4779df08cee1%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jenkinsci-users/4e09f72f-f23b-4eeb-8eb7-4779df08cee1%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0ba2168d-1b16-4f9c-bf7f-294aa782beea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
