Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitlab test jenkins webhook return 404 #354

Closed
lazywhite opened this issue Jun 12, 2016 · 19 comments
Closed

gitlab test jenkins webhook return 404 #354

lazywhite opened this issue Jun 12, 2016 · 19 comments

Comments

@lazywhite
Copy link

Software Versions

gitlab: 8.3
jenkins: 2.8
jenkins-gitlab-plugin: 1.2.3

Configs

repo_address: http://gitlab.xxx.com/white/jenkins_test.git
webhook: http://x.x.x.x:5000/project/jenkins_test

Logs

Jun 12, 2016 4:14:44 PM com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic
INFO: WebHook called with url: /project/jenkins_test

problem

I configured a jenkins job and can execute it manually, but webhook always return 404

@omorillo
Copy link
Contributor

Have you set the webhook url as suggested in the jenkins job? You may also have a typo in the url.

@djdevin
Copy link

djdevin commented Jun 13, 2016

I also get a 404, after upgrading, from a working installation.

GET https://mydomain.com/project/Test_BRANCH
404 Not Found

GitLab 8.8.1-ee
jenkins: 2.8
jenkins-gitlab-plugin: 1.2.3

@omehegan
Copy link
Member

I wonder if this is a Jenkins 2.8 issue. Can you both check the main Jenkins log, rather than the plugin-specific log, and see if there are any errors logged there?

@lazywhite
Copy link
Author

I'm sorry, I didn't configure the webhook rightly, PROJECT_NAME should be jenkins job name , not gitlab project name.

@omorillo
Copy link
Contributor

@lazywhite Great to hear, that it fixed your issue.

@omorillo
Copy link
Contributor

@djdevin Just to be sure I understand correctly. You upgraded the gitlab plugin, didn't you?

@djdevin
Copy link

djdevin commented Jun 14, 2016

@omorillo I did, that's actually why it broke. I missed the switchover to the Credentials system, so reinputting the API key based on the readme fixes it.

@omorillo
Copy link
Contributor

Great!

@bert2002
Copy link

Hi,

i am running into the same problem. I added the credentials based on the readme (secret text) and the connection test is working, but every call to https://mydomain.com/project/JENKINS_JOB_NAME results in a 404 on the jenkins server.

The only difference is that i run jenkins: 2.10

Any other idea?

@coder-hugo
Copy link
Contributor

@bert2002 to figure out what's happening it would be helpful to have some logs. Please have a look to the user support section how to enable logging for the GitLab plugin.

@bert2002
Copy link

I found a workaround. I downgraded the gitlap-plugin to 1.1.32. I know thats not a solution, but at least its working now.

@vmaurin
Copy link

vmaurin commented Jul 11, 2016

@bert2002
I had the same issue and for me it was from a 302 returned by my jenkins server.
Let me explain the flow :

  • Gitlab send a POST to the jenkins server to the configured URL (starting with http:// in my case)
  • My jenkins server working with https send a 302 redirect to the same url, but starting with https://
  • Then Gitlab follows the redirect, but send a GET query, that is rejected by the GitLab plugin

So in my case, the fix was just to configure directly the link starting with https in gitlab, and then avoiding the redirect

I have submitted an issue to gitlab https://gitlab.com/gitlab-org/gitlab-ce/issues/19696

@RyanYans
Copy link

I found that the WebhooksURL can not be "localhost" or "127.0.0.1", please find your IPv4 address.

@omehegan
Copy link
Member

@RyanYans that is caused by #730, you can change a setting in GitLab to fix it.

@panostzemis
Copy link

panostzemis commented Oct 16, 2018

First of all have a look o Jenkins logs in order to check if it receives the Hook.
You should see something like this

INFO: WebHook called with url: /ci/project/content-fetch

In case you are accessing your Jenkins/Git with HTTP, add your webhook as provided by Jenkins on project settings
http://domain/ci/project/<project-name>

and uncheck
Enable SSL verification

In case you have HTTPS
Use your Jenkins project URL but this time add https instead of http``

https://domain/ci/project/<project-name>
And check
Enable SSL verification

Also on Jenkins project configuration on Build Triggers/Build when a change is pushed to GitLab.
by pressing the advanced button you will find Generate Code
Generate a code and insert it on the GitLab Webhook settings.

That should work for you.

@ashokmahato
Copy link

ashokmahato commented Jan 8, 2020

Dear experts,
I am facing same issue http 404 .
Checked below things
1.Jenkins Userid is correct
2.Api token generated from that Jenkins user
3. Enable authentication for '/project's end point : unchecked
Webhooks url: https//Userid:apikoken@jenkinsServerurl/project/job-name

Please help/suggest .

@ricardo-aspira
Copy link

Any news on that? I am facing the same issue.

@patrickjeried
Copy link

any updates?

@sdklab007
Copy link

I am facing the same. Did anyone find the solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests