GitLab build not triggering

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.

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?

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

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

I look this line inside the drone log file:

Preformatted text [GIN-debug] POST /hook --> 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 ?

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
      - 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

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.

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.

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”,“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.