Drone

[SOLVED] Failed to activate your repository?

version: '2'

services:
  drone-server:
    image: drone/drone

ports:
  - 8080:8000
  - 9000
volumes:
  - ./drone:/var/lib/drone/
restart: always
environment:
  - DRONE_OPEN=true
  - DRONE_HOST=http://localhost
  - DRONE_BITBUCKET=true
  - DRONE_BITBUCKET_CLIENT=.....
  - DRONE_BITBUCKET_SECRET=.....
  - DRONE_SECRET=511a89s1d9a81sd9a81sdasd1asd189

  drone-agent:
    image: drone/agent

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=511a89s1d9a81sd9a81sdasd1asd189

this is my docker-compose file, i have correctly set all the authorization within the bitbucket oauth section, i can all my repositories… however when i try to enable any repository it shows the message:

Failed to activate your repository

There are no logs… im pretty sure i gave all the required permission for the bitbucket oAuth as described on the docs, does it matter if all my repositories are private? do i need to set anything special in this case?

I can see you are running Drone on localhost, based on your DRONE_HOST variable, which means Drone will (accurately) create webhooks using the localhost address. Unfortunately Bitbucket will error if you try to create a webhook for localhost. This issue is specific to Bitbucket and does not impact the other providers.

So the solution is to install your instance on a public IP or hostname. I recommend either using ngrok or digital ocean which has low cost servers that you can use for testing.

1 Like

ahhhh thats it! … its working now… thanks!

hello , i have the same problem. can you tell me how to solve it ?
so thanks,

Your drone instance needs to be have a public IP, otherwise bitbucket wont be able to communicate with your drone instance, so either use localtunnel / ngrok for testing or get yourself a VPS somewhere

i have the same problem with github on localhost for testing.is it impossible?

ok,thanks you.I will try it.

The Drone server must be available at a public address; GitHub cannot send webhooks to a private address such as localhost, which means no build can ever be triggered. You should therefore use a service like ngrok, which provides a public address, if you want to test Drone locally with GitHub.