Dear Jenkins Support,
I am reaching out to you regarding difficulties I am encountering with integrating Jenkins and GitLab for my project. Below are the details of the problem I am facing:
1. Problem Description:
While configuring the integration between Jenkins and GitLab, I followed the recommended steps to generate an SSH key in Jenkins, add it to my GitLab account, configure webhooks, and create credentials in Jenkins. However, despite these actions, I am facing errors when attempting to trigger builds from GitLab webhooks.
2. Errors Encountered:
- When I try to trigger a build from a push on GitLab, I receive an HTTP 403 error with the message "No valid crumb was included in the request".
- Additionally, when Jenkins attempts to fetch changes from the GitLab repository, I receive a permission denied error with the message "Permission denied (publickey,password)".
3. Actions Taken:
- I have verified that the SSH keys generated in Jenkins have been correctly added to my GitLab account.
- I have also verified that the credentials and webhook configurations in Jenkins are correct.
4. Recommended Actions:
I am seeking your assistance in resolving this issue. Could you please:
- Verify if the configuration I have described is correct and if I have missed anything important?
- Provide guidance or recommendations for diagnosing and resolving the errors I am encountering?
- Suggest additional steps I could take to resolve this issue?
5. Additional Information:
- Here are the details of my Jenkins and GitLab configuration:
- Jenkins Version: 2.440.3
- GitLab Version: 16.10
- Jenkins Configuration: please see the document in attachment
- GitLab Configuration: please see the document in attachment
Thank you in advance for your help and assistance in resolving this problem. Please feel free to contact me if you need further information.
Best regards,
2. Errors Encountered:
- When I try to trigger a build from a push on GitLab, I receive an HTTP 403 error with the message "No valid crumb was included in the request".
--
--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4e4697f51d952585abd338d5be9549683ba0d00a.camel%40opentext.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/TY1P286MB3171D805D8AA418D223D8833A1172%40TY1P286MB3171.JPNP286.PROD.OUTLOOK.COM.
2. I also updated the webhook URL in GitLab to include this token, as follows: `http://192.168.0.24:8080/job/EasyFormerPipeline/build?token=43272f4e87b1eff15b230e6b8f8395d5`.
--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9aca319ddfc9ac046b556c7bbac61842797ed23c.camel%40opentext.com.
Unfortunately, I'm still encountering problems despite several attempts to resolve them. Here are the errors I'm encountering:
In GitLab:
Hook executed successfully but returned HTTP 403
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 403 Invalid access token</title> </head> <body><h2>HTTP ERROR 403 Invalid access token</h2> <table> <tr><th>URI:</th><td>/git/notifyCommit</td></tr> <tr><th>STATUS:</th><td>403</td></tr> <tr><th>MESSAGE:</th><td>Invalid access token</td></tr> <tr><th>SERVLET:</th><td>Stapler</td></tr> </table> <hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 10.0.20</a><hr/> </body> </html>
In Jenkins, when triggering a build:
The recommended git tool is: NONE
using credential jenkinsgitlabssh
> git rev-parse --resolve-git-dir /var/jenkins_home/workspace/EasyFormerPipeline/.git # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url g...@192.168.0.24:Berechit/easyformer.git # timeout=10
Fetching upstream changes from g...@192.168.0.24:Berechit/easyformer.git
> git --version # timeout=10
> git --version # 'git version 2.39.2'
using GIT_SSH to set credentials Test EasyFormer23042024
Verifying host key using known hosts file, will automatically accept unseen keys
> git fetch --tags --force --progress -- g...@192.168.0.24:Berechit/easyformer.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from g...@192.168.0.24:Berechit/easyformer.git
Additionally, I've updated the webhook URL in Jenkins as follows:
--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3c1b03e33a805c3bfd1a7c4a40d2b696a5c0cf10.camel%40opentext.com.
We are still encountering difficulties with fetching the Git repository in Jenkins. Despite our efforts, Jenkins prompts for a password when attempting to clone the repository, which is unexpected behavior for SSH authentication.
root@easyformer:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
016ce5d64dcb jenkins/jenkins:lts "/usr/bin/tini -- /u…" 8 days ago Up 5 hours 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:50000->50000/tcp, :::50000->50000/tcp jenkins
b777b84a524b gitlab/gitlab-ce:latest "/assets/wrapper" 8 days ago Up 25 hours (healthy) 0.0.0.0:40022->22/tcp, :::40022->22/tcp, 0.0.0.0:40080->80/tcp, :::40080->80/tcp, 0.0.0.0:40443->443/tcp, :::40443->443/tcp gitlab
root@easyformer:~# docker exec -it jenkins bash
jenkins@192:/tmp$ git clone g...@192.168.0.24:Berechit/easyformer.git
Cloning into 'easyformer'...
g...@192.168.0.24's password:
WARNING: Unknown parameter(s) found for class type 'jenkins.plugins.git.GitStep': credentials The recommended git tool is: NONE No credentials specified > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/EasyFormerPipeline/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url g...@192.168.0.24:Berechit/easyformer.git # timeout=10 Fetching upstream changes from g...@192.168.0.24:Berechit/easyformer.git > git --version # timeout=10 > git --version # 'git version 2.39.2' > git fetch --tags --force --progress -- g...@192.168.0.24:Berechit/easyformer.git +refs/heads/*:refs/remotes/origin/* # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from g...@192.168.0.24:Berechit/easyformer.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1241) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:136) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:101) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:88) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- g...@192.168.0.24:Berechit/easyformer.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied, please try again. Permission denied, please try again.
--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cd70bfa8596f1daf5911ae6e4e3c0ebb4331e745.camel%40opentext.com.
Subject: Issue with accessing GitLab repository from Jenkins
Problem Description:
We have configured Jenkins to access a GitLab repository hosted at `192.168.0.24:Berechit/easyformer.git`, but we are encountering authentication errors when attempting to retrieve changes from this repository. Despite several checks, we have been unable to resolve the issue.
Verified Elements:
- Correct configuration of SSH keys in GitLab and Jenkins.
- Permissions on the GitLab repository have been checked and appear to be correct.
- SSH keys have been manually tested from the Jenkins container and appear to be functioning correctly.
- Jenkins logs indicate an authentication error when attempting to retrieve changes from the repository.WARNING: Unknown parameter(s) found for class type 'jenkins.plugins.git.GitStep': credentials The recommended git tool is: NONE No credentials specified
--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/910f6025-7cff-424d-b6df-5a4ca26d0fe8n%40googlegroups.com.