Drone 1.0.0-rc.1 cannot login through BitBucket

Hello, I’m trying to setup Drone CI using BitBucket, but it seems there’s some problem. I always keep getting error Invalid redirect_uri. I’ve tried two different accounts and gave all the available permissions, but it was the same. Then I tried GitHub with the same info and it worked.

The env used for BitBucket:

DRONE_RUNNER_CAPACITY=2
DRONE_SERVER_HOST=http://<host>
DRONE_SERVER_PROTO=http
DRONE_OPEN=true
DRONE_BITBUCKET_CLIENT_ID=<id>
DRONE_BITBUCKET_CLIENT_SECRET=<secret>

The env used for GitHub:

DRONE_RUNNER_CAPACITY=2
DRONE_SERVER_HOST=http://<host>
DRONE_SERVER_PROTO=http
DRONE_OPEN=true
DRONE_GITHUB_SERVER=https://github.com
DRONE_GITHUB_CLIENT_ID=<id>
DRONE_GITHUB_CLIENT_SECRET=<secret>

The redirect link was the same for both - http://<host>/login

your DRONE_SERVER_HOST is invalid. It should be set to the hostname, however, in your example you have provided a url, prefixed with http://. You can see examples of all configuration values in the Bitbucket installation documentation: https://docs.drone.io/installation/providers/bitbucket-server/

I used the wrong keyword here maybe, the <host> is just and IP address without the protocol. Anyway this configuration works with GitHub, but not with BitBucket.

I can confirm that I am using Drone + Bitbucket and I do not have any issues with authentication or redirects. If you are having issues with Bitbucket, and not GitHub, perhaps your Bitbucket oauth application configuration [1] is incorrect. Based on the error message it sounds like a problem with your Callback URL configuration. This is the only explanation I can think of.

[1] https://docs.drone.io/installation/providers/bitbucket-server/

Hmm, very strange… Pulled down to use Drone 0.8.6 with the same configuration and just changed redirect from /login to /authorize and it works… But the 1.0.0 does not…

My docker-compose.yml

version: '2'

services:
  drone-server:
    image: drone/drone:1.0.0-rc.1
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/lib/drone:/var/lib/drone/
      - /var/run/docker.sock:/var/run/docker.sock
    restart: always
    environment:
      - DRONE_DEBUG=true // does not work
      - DRONE_OPEN=true
      - DRONE_HOST=http://<ip>
      - DRONE_SERVER_PROTO=http
      - DRONE_RUNNER_CAPACITY=2
      - DRONE_BITBUCKET=true
      - DRONE_BITBUCKET_CLIENT_ID=<id>
      - DRONE_BITBUCKET_CLIENT_SECRET=<secret>

Seems I have found the issue: as I was deploying Drone using GCloud VM instance using their container configuration, where you provide image,arguments, env, volumes. And it seems the arguments were processed, because the host address would get and additional http:// appended so it looked like http://http://<ip>. Once I changed the host to - DRONE_HOST=<ip> without the protocol it worked.

hi ,
can you refresh this link. I get an error " Page Not Found".

Thank you