gitlab plugin test connection issue on jenkins - jenkins

Im having issue with gitlab plugin test connection on jenkins. it gives error when I hit the "test connection" button with the given values.
GitLab user is maintainer and has full access on it. GitLab API token belongs to this user.
unfortunately it seems no way to track this error. I checked the logs files in jenkins machine as well.
GitLab Plugin Version is -> 1.5.27
you may see screenshot of the page here
alternative link:
https://gyazo.com/2b81c4310c7a144651fda54c6b1462c1

Related

Gitlab jenkins integration

I am using jenkins as CI server and Gitlab as Codebase both are running into two serpent docker containers.
I have created CICD pipeline into jenkins and gitlab repo. also setup webhook which working fine. Now I want to integrate jenkins from gitlab and inserted required details but it showing 401 error while test. please note entered details are verified and credentials are working.
enter image description here
enter image description here
401 indicates that the request is unauthorized. So, stated another way: your credentials are correctly set, but the credentials do not have the appropriate permission needed.
You should make sure your API keys are generated with appropriate scope and/or that the user account associated with the keys have appropriate permission.

Jenkins CI not available in Gitlab Integrations

Im working in GitLab and Jenkins Integrations. Its working fine in scheduling process.
I'm trying CI from GitLab with Jenkins. All the blogs and tutorials explained with JenkinsCI But that option is not available in GitLab->Integrations. GitLab-Integration please refer the image.
I have tried without Jenkins CI using webhook getting the error.
enter image description here
Error: Webhook executed successfully But returning Http 500
I have tried my personal account in that I can see the jenkins under Integration able to add setting then moved to Active Integration

After giving initial admin password in jenkins to Unlock Jenkins i am getting issue

As i am trying to install Jenkins on cloud server and i installed that but after installation when it is asking for the /var/lib/jenkins/secrets/initialAdminPassword i am providing that also but after that i should get a plugin page but i am directly coming into Jenkins home page.
I have tried the installing jenkins again but still i am getting this below error.
Jenkins root URL is empty but is required for the proper operation of many Jenkins features like email notifications, PR status update, and environment variables such as BUILD_URL.
Please provide an accurate value in Jenkins configuration.
can any one tell me why this happening.enter image description here

Automatic build with Jenkins and GitLab

I deploy Jenkins and GitLab using Docker (locally), both are connected with each other.
One of the problems (not very important) is with SSH. I create ssh key inside Jenkins container and set it to GitLab, but when Jenkins try to checkout the repository throws "Permission Denied". So, executing Jenkins bash, try to run git command and what's happen? GitLab container needs a password for access. Searching, and trying to do as a virtualized server, no works. Whatever, I solved using user and password (I don't like, but works).
The important problem. I don't have any problem creatin, and running, a job (using pipelines). The job download the world from GitLab and send the result to GitLab. The problem, after add a webhook with Jenkins URL to GitLab, push something but nothing happens in Jenkins, not trigger the job.
Anyone can help me?
Thanks!!
Is your webhook working correctly ?? are you able to send/receive request and response, if not refer to
Github webhook URL config issue? How to fix it?
When you push does it trigger a request ? can you try hitting it with postman if you do have a request. If you can provide more information, then it will be helpful :)

hooking gitlab with jenkins

I'm trying to connect Gitlab CE 8.16 with Jenkins 2.46.1 using the GitLab hook plugin 1.4 to trigger builds when push or merge.
So I checked "Build when a change is pushed to GitLab", copied the GitLab CI Service URL: http://server:port/project/my-project and the security token, to gitlab webhook, disabled ssl verification and when I clicked on Test, I got this error :
Hook execution failed: execution expired
What am I doing wrong, please? How can I make it work?
There are a few things that are needed to make it work, there is documentation here:
https://github.com/jenkinsci/gitlab-plugin#global-plugin-configuration
So:
Make sure the jenkins user that you use on the GitLab side has the proper permissions - it needs project access and the APITOKEN needs to be there
Create the webhook on the project in GitLab that corresponds to the project in Jenkins (the Jenkins project that uses the git repo you are working with)
In GitLab, when you create webhooks to trigger Jenkins jobs, use this format for the URL and do not enter anything for 'Secret Token': https://USERID:APITOKEN#JENKINS_URL/project/YOUR_JOB
You can use a non-https link too and skip SSL verification if the certificate is not valid. Either way, the gitlab server has to be able to connect to the name and port you are using there.
Hit test and it should work, if not, you might not be able to connect to the server. Make sure your Jenkins server is listening on the URL and port that you are using, the error seems to be related to that not being right.
It's possible that GitLab server is not allowed to connect to the internet, or to the network you have the Jenkins server on, or there might be a firewall blocking the port you try to connect to (80/443) on the local Jenkins machine.
Try to do for example a curl to the Jenkins server and see what comes back:
curl http://you.jenkins.fqdn/
If you don't get something like:
<html><head><meta http-equiv='refresh' content='1;url=/loginEntry?from=%2F'/><script>window.location.replace('/loginEntry?from=%2F');</script></head><body style='background-color:white; color:white;'>
Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
Permission you need to have (but didn't): hudson.model.Hudson.Read
... which is implied by: hudson.security.Permission.GenericRead
... which is implied by: hudson.model.Hudson.Administer
-->
</body></html>
then you cannot connect.
If it's not the Jenkins server where the issue is, you need to ask the network people that manage the server about it.
Hope that helps, good luck!
Make sure to use the latest 1.4 GitLab hook plugin (1.4.3, March 2016)
Look into your GitLab production.log, as in this issue, and see if this is a proxy configuration problem.
You should at least the context of that error message.
Here is what worked for me:
Ensure there is a merge request, even if you don't intend to actually merge any branches.
Go to branches -> select 'merge request' for a branch to merge -> create the request
Now try to test the integration.

Resources