Facing an error while following a jenkins tutorial (while using Git repository to build)

Hello!
I’m setting up jenkins to kickstart contributions here. I’m facing an error while following this tutorial: https://www.jenkins.io/doc/tutorials/build-a-java-app-with-maven/

While I’m adding the path to my locally cloned repository to Repository URL field under the Pipeline tab, the following error shows up:

Failed to connect to repository : Command "git ls-remote -h -- /Users/shreya/Documents/GitHub/simple-java-maven-app HEAD" returned status code 128:
stdout:
stderr: fatal: '/Users/shreya/Documents/GitHub/simple-java-maven-app' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I’ve tried putting the path to Git executable in Manage Jenkins>Global Tools Configuration>Git>Git Installations as /usr/bin/git but this doesn’t work

changing the path to /home/Documents/GitHub/simple-java-maven-app doesn’t help either

I’m using jenkins through docker. can anyone help?

If you are using jenkins inside of docker, do you have /Users/shreya/Documents/GitHub/simple-java-maven-app as a volume (-v) in your docker run? otherwise docker can’t access that directory outside of your container.

It may be less effort to use a github repo instead of a cloned local repo and messing with volumes.

I followed the exact tutorial given in the link I mentioned, and one of the org admins also asked me to follow the tutorial exactly as is.

Also: while following this tutorial:
Building the image gives me this error: https://www.jenkins.io/doc/tutorials/build-a-java-app-with-maven/

 => [6/6] RUN jenkins-plugin-cli --plugins "blueocean docker-workflow"                                                                  406.9s
 => => # INFO: Retrying request to {s}->https://updates.jenkins.io:443                                                                        
 => => # Jan 31, 2023 8:34:01 AM org.apache.http.impl.execchain.RetryExec execute                                                             
 => => # INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {s}->https://mirrors.tuna.tsinghua.ed
 => => # u.cn:443: The target server failed to respond                                                                                        
 => => # Jan 31, 2023 8:34:01 AM org.apache.http.impl.execchain.RetryExec execute                                                             
 => => # INFO: Retrying request to {s}->https://mirrors.tuna.tsinghua.edu.cn:443 

while on this step, the entire process just comes to a standstill and has been running since forever. What to do?

That message means that network requests to the geographically nearest mirror to you (Tsinghua University in China) are not receiving a response. My first guess would be that you are in a network that has decided to block access to sites in China. Most unfortunate that no one has donated a Jenkins mirror from a location that is nearer to you.

The best solution is to persuade your network provider to allow you to access that site.

If your network provider can’t be persuaded to allow you to access that site, then there are alternatives that you can explore.

1 Like

If your network provider can’t be persuaded to allow you to access that site, then there are alternatives that you can explore.

could you lead me to the alternatives? I’m using my Institute’s WiFi network, won’t be possible to get access to the site. Other image builds for plugin dev environments are also failing with the same error.

Unfortunately, I’m not willing to spend the effort to do that. There are too many things that can and will go wrong in that experience.

You may want to tell your institute that their network policies have blocked you from contributing to the Jenkins open source project and that those same policies will block others at the institute from using Jenkins. Jenkins is used at many companies around the world. DevOps jobs frequently expect experience with Jenkins.