Drone

Failed to activate your repository

Sorry for another “help me” post, but i am truly unable to figure out the issue!

I am getting a “failed to activate your repository” on drone after successfully authentication to gitlab.

I have gitlab and drone on separate servers, gitlab is a hard install (not with docker) and i am able to access/ping etc etc with both servers.

docker-compose:
version: ‘2’

    services:
      drone-server:
        image: drone/drone:0.8

    ports:
      - 80:8000
      - 9000
    volumes:
      - /var/lib/drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_HOST=http://10.211.55.29
      - DRONE_OPEN=true
      - DRONE_SECRET=xxx
      - DRONE_ADMIN=root

      #Drone Log Configs
      #- DRONE_LOGS_DEBUG=true  
      #- DRONE_LOGS_PRETTY=true
      #- DRONE_LOGS_COLOR=true

      # GitLab Config
      - DRONE_GITLAB=true
      - DRONE_GITLAB_CLIENT=xxx
      -DRONE_GITLAB_SECRET=xxxx
      - DRONE_GITLAB_URL=http://10.211.55.28

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

Logs from drone agent:
{“time”:“2018-11-02T23:07:08Z”,“level”:“debug”,“message”:“request next execution”}

Logs from drone server:
I can upload if you need, everything looks fine on this end, and im getting errors about uploading more than 2 links…

1 Like

failed to activate repository could happen if 1) you do not have admin permissions to the repository which is required in order to create webhooks 2) the drone application oauth client was not configured with the correct scopes in gitlab 3) the url is invalid or cannot be reached by gitlab (e.g. your drone address is localhost).

I would also recommend searching some of the existing threads which may have answers to your question. https://discourse.drone.io/search?q=failed%20to%20activate%20your%20repository

Thanks for the reply.

  1. The project is public so it “can we accessed without authentication”

1.5) I am using the root account, but just to test i created a drone user and gave the drone user on gitlab full access to the repo, still failed to activate

  1. Originally the scope i used was “api”, i then went ahead and added “sudo” and “openid” and created a new applications to test, still did not work. (also tried the new user)

  2. I am thinking this is the issue, but i do now know how to test.

My drone docker is hosted on 10.211.55.29, gitlab is hosted on 10.211.55.28. Is there something you can recommend to me for testing the url is invalid?

Nmapping 10.211.55.29 with drone up has port 80, 631 and 32780 up.

I recommend looking at your GitLab server logs which may provide a more detailed error message regarding why webhook creation failed. This would help narrow down the possible root causes.

Sorry for the long reply, iv been trying to resolve the issue without spamming this forum.

Here is some new information that ive found… its looks like drone_agent is getting a ctl c sent to it… an i am not sure why…

I did a little research on the internet and was unable to find a reason?
Yes i saw Build not working

drone-agent_1   | {"time":"2018-11-13T16:27:31Z","level":"debug","message":"request next execution"}
drone-agent_1   | ctrl+c received, terminating process
drone-agent_1   | 2018/11/13 16:31:33 grpc error: done(): code: Canceled: rpc error: code = Canceled desc = context canceled
drone-agent_1   | {"time":"2018-11-13T16:31:33Z","level":"error","error":"rpc error: code = Canceled desc = context canceled","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-11-13T16:31:47Z","level":"debug","message":"request next execution"}
drone-agent_1   | INFO: 2018/11/13 16:31:47 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.18.0.2:9000: getsockopt: connection refused"; Reconnecting to {drone-server:9000 <nil>}
drone-agent_1   | 2018/11/13 16:31:47 grpc error: done(): code: Unavailable: rpc error: code = Unavailable desc = grpc: the connection is unavailable
drone-agent_1   | ctrl+c received, terminating process
drone-agent_1   | 2018/11/13 16:33:19 grpc error: done(): code: Canceled: rpc error: code = Canceled desc = context canceled
drone-agent_1   | {"time":"2018-11-13T16:33:19Z","level":"error","error":"rpc error: code = Canceled desc = context canceled","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-11-13T16:33:33Z","level":"debug","message":"request next execution"}
drone-agent_1   | ctrl+c received, terminating process
drone-agent_1   | 2018/11/13 16:34:29 grpc error: done(): code: Canceled: rpc error: code = Canceled desc = context canceled
drone-agent_1   | {"time":"2018-11-13T16:34:29Z","level":"error","error":"rpc error: code = Canceled desc = context canceled","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-11-13T16:34:37Z","level":"debug","message":"request next execution"}
drone-agent_1   | ctrl+c received, terminating process
drone-agent_1   | 2018/11/13 16:34:40 grpc error: done(): code: Canceled: rpc error: code = Canceled desc = context canceled
drone-agent_1   | {"time":"2018-11-13T16:34:40Z","level":"error","error":"rpc error: code = Canceled desc = context canceled","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-11-13T16:34:56Z","level":"debug","message":"request next execution"}
drone-agent_1   | ctrl+c received, terminating process
drone-agent_1   | 2018/11/13 16:35:20 grpc error: done(): code: Canceled: rpc error: code = Canceled desc = context canceled
drone-agent_1   | {"time":"2018-11-13T16:35:20Z","level":"error","error":"rpc error: code = Canceled desc = context canceled","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-11-13T16:35:33Z","level":"debug","message":"request next execution"}
drone-agent_1   | INFO: 2018/11/13 16:35:34 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.18.0.3:9000: getsockopt: connection refused"; Reconnecting to {drone-server:9000 <nil>}
drone-agent_1   | 2018/11/13 16:35:34 grpc error: done(): code: Unavailable: rpc error: code = Unavailable desc = grpc: the connection is unavailable
drone-agent_1   | INFO: 2018/11/13 16:35:34 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.18.0.3:9000: getsockopt: connection refused"; Reconnecting to {drone-server:9000 <nil>}
drone-agent_1   | 2018/11/13 16:35:35 grpc error: done(): code: Unavailable: rpc error: code = Unavailable desc = grpc: the connection is unavailable
drone-server_1  | [GIN-debug] GET    /api/repos/:owner/:name/logs/:number/:pid/:proc --> github.com/drone/drone/server.GetBuildLogs (15 handlers)
drone-server_1  | [GIN-debug] GET    /api/repos/:owner/:name/files/:number --> github.com/drone/drone/server.FileList (15 handlers)
drone-server_1  | [GIN-debug] GET    /api/repos/:owner/:name/files/:number/:proc/*file --> github.com/drone/drone/server.FileGet (15 handlers)
drone-server_1  | [GIN-debug] GET    /api/repos/:owner/:name/secrets --> github.com/drone/drone/server.GetSecretList (16 handlers)

Well, this problem might be relating to gitlab settings ‘Outbound requests’. You could be interested in the issue #46490

You may have a try log in as administrator (root) user in your self-hosted gitlab server, then forward to Admin Area->Settings->Network->Outbound requests, there you can see an option ‘Allow requests to the local network from hooks and services’, check it on and save changes. next back to your drone server, try to activate your repository again.

Hope you have a good luck!:wink:

1 Like

Thanks for the reply! I will have to try this, sorry i have been out of town lately.

it’s work , thanks, Allow requests to the local network from hooks and services