简体   繁体   中英

HTTP error 400 accessing /github-webhook/. Hook should contain event type

I call webhook Jenkins from Gitlab and get following error :

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Error 400 Hook should contain event type</title>
    </head>
    <body>
        <h2>HTTP ERROR 400</h2>
        <p>Problem accessing /github-webhook/. Reason:

            <pre>    Hook should contain event type</pre>
        </p>
        <hr>
        <i>
            <small>Powered by Jetty://</small>
        </i>
        <hr/>
    </body>
</html>

What i have done? i read reference here but not working :

Jenkins github plugin returns error 400 "Hook should contain event type"

Why i ask again to similar title:

Cause the solution above still not working for me.

What i can sure :

I sure that Jenkins can connect to Gitlab, cause i can built project "X" manually and no error. My problem here when i want automatically build when i push to gitlab and i always get that error. Can anyone help me ?

It looks like you're using GitLab with the GitHub plugin's webhook ( http://jenkins.example.com/github-webhook/ ).

You should use one of these webhooks instead (assuming you can install the GitLab Hook Plugin ):

  • http://jenkins.example.com/gitlab/notify_commit
  • http://jenkins.example.com/gitlab/build_now

Ref: https://github.com/jenkinsci/gitlab-hook-plugin#build-now-hook

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM