A.Marques
A.Marques

Reputation: 131

GitLab webhook error 'Hook Execution Failed'

I have a vbox with a virtualhost running a website which I can access through the host. That website is on a gitlab repository, which is running on a local server.

I wanted to setup a webhook so that when I pushed on the host, it would pull on the vbox.

I already have a php script at http://192.168.1.1/webhook.php and I've tested it with curl and it's working just fine. But when I input that URL as a webhook URL on my gitlab project and test it, it shows a 'Hook Execution Failed' error.

I have also tried:

  1. setting up a webhook with a http://requestb.in/ URL and it worked.

  2. running the website on a virtual host on the host machine (not on vbox) but it did not work.

  3. typing the url on the browser manually http://192.168.1.1/webhook.php or localhost/webhook.php (not on vbox) and it did run the script.

Upvotes: 4

Views: 11262

Answers (1)

Bennet G.
Bennet G.

Reputation: 585

This may not be up to date anymore, but can help anyone facing this issue.

The problem is, that your local maschine's IP (192.168.1.1) only reachable for your local network is. Therefore the gitlab-server cannot connect to your maschine. You need to host it anywhere, for example on a webserver which is accessable from anywhere on the internet. Otherwise it won't work!

Upvotes: 0

Related Questions