# GitLab build not triggering

**URL:** <https://drone.discourse.group/t/gitlab-build-not-triggering/10373>\
**Category:** Drone Support\
**Created:** [May 14, 2018, 5:43pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373 "2018-05-14T17:43:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dromadaire54](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dromadaire54](https://drone.discourse.group/u/dromadaire54)\
**Post date:** [May 14, 2018, 5:43pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/1 "2018-05-14T17:43:38Z")

</div>

I installed a Gitlab (v10.7.3-ee) and a drone (v0.8) on the same server (Debian 8). I added an application Id and set up on the docker-compose yaml file. Drone retrieves the repositories from the Gitlab. I activated a repositories and added a .drone.yml on the repository root. But when I pushed the commit and unfortunately anything happens on Drone. The build list is always empty regardless of following the drone installation guide.

Thanks.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [May 14, 2018, 6:39pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/2 "2018-05-14T18:39:38Z")

</div>

That would imply that the webhook is not reaching the Drone server from GitLab, and could indicate a networking error.

- Check your GitLab server logs. What do you see?
- Check your Drone server logs. Do you see a POST request to /hook? If not GitLab is requests are not being sent to Drone properly
- Check the webhook address in GitLab. Is it correct?

---

<div class="post-metadata">

**Author:** ![dromadaire54](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dromadaire54](https://drone.discourse.group/u/dromadaire54)\
**Post date:** [May 14, 2018, 7:19pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/3 "2018-05-14T19:19:38Z")

</div>

Thanks for your quick answer, I must add manually a webhook in gitlab ?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [May 14, 2018, 7:21pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/4 "2018-05-14T19:21:25Z")

</div>

Nope, webhooks are added automatically when you active the repository in Drone.

---

<div class="post-metadata">

**Author:** ![dromadaire54](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dromadaire54](https://drone.discourse.group/u/dromadaire54)\
**Post date:** [May 14, 2018, 7:21pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/5 "2018-05-14T19:21:58Z")

</div>

I look this line inside the drone log file:

`Preformatted text` [GIN-debug] POST /hook --\> [github.com/drone/drone/server.PostHook](http://github.com/drone/drone/server.PostHook) (12 handlers)

On the gitlab log I can see this line  
`Started PUT "/api/v4/projects/open_islam%2Fopenislam-backend/services/drone-ci?drone_url=http%3A%2F%2F192.168.0.5%3A8888&enable_ssl_verification=true&token=[FILTERED]" for 172.18.0.2 at 2018-05-14 21:36:00 +0200`

When I activate a repository in drone. I see that the ssl verification is enabled and the address scheme is http not https there’s a consequence ?

---

<div class="post-metadata">

**Author:** ![dromadaire54](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dromadaire54](https://drone.discourse.group/u/dromadaire54)\
**Post date:** [May 14, 2018, 7:30pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/6 "2018-05-14T19:30:16Z")

</div>

This is the docker-compose yaml file

```
version: '2'
services:
  drone-server:
    image: drone/drone:0.8
    ports:
      - 8888:8000
      - 9000
    volumes:
      - /var/lib/drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_ADMIN=test
      - DRONE_HOST=http://192.168.0.5
      - DRONE_GITLAB=true
      - DRONE_GITLAB_URL=http://192.168.0.5:7990
      - DRONE_GITLAB_CLIENT=client
      - DRONE_GITLAB_SECRET=client-secret
      - DRONE_SECRET=secret

  drone-agent:
    image: drone/agent:0.8

    command: agent
    restart: always
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET=secret
```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [May 14, 2018, 7:51pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/7 "2018-05-14T19:51:51Z")

</div>

```auto
      - DRONE_HOST=http://192.168.0.5
      - DRONE_GITLAB=true
      - DRONE_GITLAB_URL=http://192.168.0.5:7990

```

This seems a bit strange to use IP address here, especially the 192. addresses. Typically these values should be set to the DNS or whatever you type in your browser address bar to access Drone and GitLab.

In terms of why a build is not running, I don’t think I have enough information to assist. It is unclear to me what you see in the user interface. Do you see a build? Is it stuck in pending? Does it finish with a failure? What do you see on your agent logs? Did you enable debug logging on your drone server? What else do you see in the logs?

There are no known issues with the Drone GitLab integration. It is quite mature and has been running in production for years. So this likely represents some sort of configuration problem, but I just don’t have enough details to assist.

Note that we offer enterprise support if you require more hands on assistance. [https://drone.io/enterprise](https://drone.io/enterprise)

---

<div class="post-metadata">

**Author:** ![dromadaire54](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dromadaire54](https://drone.discourse.group/u/dromadaire54)\
**Post date:** [May 14, 2018, 7:59pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/8 "2018-05-14T19:59:30Z")

</div>

I use IP adresses with 192. because it is a local network. In drone interface, build list is totally empty. It never works. I started drone with the debug flag and I see all the request when I activate or not a repository. But when I push a commit anything in the log.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [May 14, 2018, 8:26pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/9 "2018-05-14T20:26:33Z")

</div>

If there is nothing in the logs, that would indicate the GitLab request does not reach Drone. That would indicate a problem with your network stack.

---

<div class="post-metadata">

**Author:** ![dromadaire54](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dromadaire54](https://drone.discourse.group/u/dromadaire54)\
**Post date:** [May 15, 2018, 5:37pm UTC](https://drone.discourse.group/t/gitlab-build-not-triggering/10373/10 "2018-05-15T17:37:23Z")

</div>

Today I tested drone with the gitlab especially the api.json which lists the curl request from the drone server this the output:

> {“time”:“2018-05-15T17:17:01.575Z”,“severity”:“INFO”,“duration”:144.4,“db”:39.61,“view”:104.79,“status”:200,“method”:“PUT”,“path”:“/api/v4/projects/open\_islam%2Fopenislam-backend/services/drone-ci”,“params”:{“drone\_url”:“[http://192.168.0.5:8888](http://192.168.0.5:8888)”,“enable\_ssl\_verification”:“true”,“token”:“[FILTERED]”},“host”:“192.168.0.5”,“ip”:“172.18.0.2”,“ua”:“Go-http-client/1.1”,“user\_id”:2,“username”:“dromadaire”}  
> {“time”:“2018-05-15T17:17:01.673Z”,“severity”:“INFO”,“duration”:86.79,“db”:19.24,“view”:67.55000000000001,“status”:200,“method”:“GET”,“path”:“/api/v4/projects/open\_islam%2Fopenislam-backend”,“params”:{},“host”:“192.168.0.5”,“ip”:“172.18.0.2”,“ua”:“Go-http-client/1.1”,“user\_id”:2,“username”:“dromadaire”}

We can see the PUT request when I activate a repository from the drone UI.
