3

I followed this Digital Ocean's Drone Setup Tutorial but didn't manage to get Drone CI correctly setup. It doesn't response to any requests when I tried to access until it is timeout. I can confirm that I have expose port in the config.

Log from drone agent.
The log simply says that rpc: error re-connecting: dial tcp <ADDRESS:PORT>: getsockopt: connection timed out

*UPDATE 1: Log from drone agent now output pipeline: request next execution

docker-compose version 1.14.0, build c7bdf9e

docker-compose.yml

version: '3'

services:
  drone-server:
    image: drone/drone:0.7
    ports:
      - 127.0.0.1:10010:8000
    volumes:
      - /var/lib/drone:/var/lib/drone
    restart: always
    env_file:
      - /etc/drone-ci/server.env

  drone-agent:
    image: drone/drone:0.7
    command: agent
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: always
    env_file:
      - /etc/drone-ci/agent.env

server.env

# Service settings
DRONE_SECRET=<SECRET>
DRONE_HOST=https://drone.example.com

# Registration settings
DRONE_OPEN=true
DRONE_ADMIN=<BitBucket USERNAME>
DRONE_ORGS=<BitBucket TEAM>

# SCM Settings
DRONE_BITBUCKET=true
DRONE_BITBUCKET_CLIENT=<BitBucket-CLIENT>
DRONE_BITBUCKET_SECRET=<BitBucket-SECRET>

agent.env

DRONE_SECRET=<SECRET>
DRONE_SERVER=ws://drone-server:8000/ws/broker

docker ps

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                      NAMES
cfec5951861f        drone/drone:0.7     "/drone agent"      5 minutes ago       Up 5 minutes        80/tcp, 443/tcp, 8000/tcp                  droneci_drone-agent_1
b6111c091bbd        drone/drone:0.7     "/drone server"     5 minutes ago       Up 5 minutes        80/tcp, 443/tcp, 0.0.0.0:10010->8000/tcp   droneci_drone-server_1

Drone Server Log

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /static/*filepath         --> github.com/drone/drone/router.Load.func1 (2 handlers)
[GIN-debug] GET    /login                    --> github.com/drone/drone/server.ShowLogin (13 handlers)
[GIN-debug] GET    /login/form               --> github.com/drone/drone/server.ShowLoginForm (13 handlers)
[GIN-debug] GET    /logout                   --> github.com/drone/drone/server.GetLogout (13 handlers)
[GIN-debug] GET    /api/user                 --> github.com/drone/drone/server.GetSelf (14 handlers)
[GIN-debug] GET    /api/user/feed            --> github.com/drone/drone/server.GetFeed (14 handlers)
[GIN-debug] GET    /api/user/repos           --> github.com/drone/drone/server.GetRepos (14 handlers)
[GIN-debug] GET    /api/user/repos/remote    --> github.com/drone/drone/server.GetRemoteRepos (14 handlers)
[GIN-debug] POST   /api/user/token           --> github.com/drone/drone/server.PostToken (14 handlers)
[GIN-debug] DELETE /api/user/token           --> github.com/drone/drone/server.DeleteToken (14 handlers)
[GIN-debug] GET    /api/users                --> github.com/drone/drone/server.GetUsers (14 handlers)
[GIN-debug] POST   /api/users                --> github.com/drone/drone/server.PostUser (14 handlers)
[GIN-debug] GET    /api/users/:login         --> github.com/drone/drone/server.GetUser (14 handlers)
[GIN-debug] PATCH  /api/users/:login         --> github.com/drone/drone/server.PatchUser (14 handlers)
[GIN-debug] DELETE /api/users/:login         --> github.com/drone/drone/server.DeleteUser (14 handlers)
[GIN-debug] POST   /api/repos/:owner/:name   --> github.com/drone/drone/server.PostRepo (13 handlers)
[GIN-debug] GET    /api/repos/:owner/:name   --> github.com/drone/drone/server.GetRepo (16 handlers)
[GIN-debug] GET    /api/repos/:owner/:name/builds --> github.com/drone/drone/server.GetBuilds (16 handlers)
[GIN-debug] GET    /api/repos/:owner/:name/builds/:number --> github.com/drone/drone/server.GetBuild (16 handlers)
[GIN-debug] GET    /api/repos/:owner/:name/logs/:number/:ppid/:proc --> github.com/drone/drone/server.GetBuildLogs (16 handlers)
[GIN-debug] POST   /api/repos/:owner/:name/sign --> github.com/drone/drone/server.Sign (17 handlers)
[GIN-debug] GET    /api/repos/:owner/:name/secrets --> github.com/drone/drone/server.GetSecretList (17 handlers)
[GIN-debug] POST   /api/repos/:owner/:name/secrets --> github.com/drone/drone/server.PostSecret (17 handlers)
[GIN-debug] GET    /api/repos/:owner/:name/secrets/:secret --> github.com/drone/drone/server.GetSecret (17 handlers)
[GIN-debug] PATCH  /api/repos/:owner/:name/secrets/:secret --> github.com/drone/drone/server.PatchSecret (17 handlers)
[GIN-debug] DELETE /api/repos/:owner/:name/secrets/:secret --> github.com/drone/drone/server.DeleteSecret (17 handlers)
[GIN-debug] GET    /api/repos/:owner/:name/registry --> github.com/drone/drone/server.GetRegistryList (17 handlers)
[GIN-debug] POST   /api/repos/:owner/:name/registry --> github.com/drone/drone/server.PostRegistry (17 handlers)
[GIN-debug] GET    /api/repos/:owner/:name/registry/:registry --> github.com/drone/drone/server.GetRegistry (17 handlers)
[GIN-debug] PATCH  /api/repos/:owner/:name/registry/:registry --> github.com/drone/drone/server.PatchRegistry (17 handlers)
[GIN-debug] DELETE /api/repos/:owner/:name/registry/:registry --> github.com/drone/drone/server.DeleteRegistry (17 handlers)
[GIN-debug] PATCH  /api/repos/:owner/:name   --> github.com/drone/drone/server.PatchRepo (17 handlers)
[GIN-debug] DELETE /api/repos/:owner/:name   --> github.com/drone/drone/server.DeleteRepo (17 handlers)
[GIN-debug] POST   /api/repos/:owner/:name/chown --> github.com/drone/drone/server.ChownRepo (17 handlers)
[GIN-debug] POST   /api/repos/:owner/:name/repair --> github.com/drone/drone/server.RepairRepo (17 handlers)
[GIN-debug] POST   /api/repos/:owner/:name/builds/:number --> github.com/drone/drone/server.PostBuild (17 handlers)
[GIN-debug] POST   /api/repos/:owner/:name/builds/:number/approve --> github.com/drone/drone/server.PostApproval (17 handlers)
[GIN-debug] POST   /api/repos/:owner/:name/builds/:number/decline --> github.com/drone/drone/server.PostDecline (17 handlers)
[GIN-debug] DELETE /api/repos/:owner/:name/builds/:number/:job --> github.com/drone/drone/server.DeleteBuild (17 handlers)
[GIN-debug] GET    /api/badges/:owner/:name/status.svg --> github.com/drone/drone/server.GetBadge (13 handlers)
[GIN-debug] GET    /api/badges/:owner/:name/cc.xml --> github.com/drone/drone/server.GetCC (13 handlers)
[GIN-debug] POST   /hook                     --> github.com/drone/drone/server.PostHook (13 handlers)
[GIN-debug] POST   /api/hook                 --> github.com/drone/drone/server.PostHook (13 handlers)
[GIN-debug] GET    /ws/broker                --> github.com/drone/drone/server.RPCHandler (13 handlers)
[GIN-debug] GET    /ws/rpc                   --> github.com/drone/drone/server.RPCHandler (13 handlers)
[GIN-debug] GET    /ws/feed                  --> github.com/drone/drone/server.EventStream (13 handlers)
[GIN-debug] GET    /ws/logs/:owner/:name/:build/:number --> github.com/drone/drone/server.LogStream (16 handlers)
[GIN-debug] GET    /api/info/queue           --> github.com/drone/drone/server.GetQueueInfo (14 handlers)
[GIN-debug] GET    /authorize                --> github.com/drone/drone/server.GetLogin (13 handlers)
[GIN-debug] POST   /authorize                --> github.com/drone/drone/server.GetLogin (13 handlers)
[GIN-debug] POST   /authorize/token          --> github.com/drone/drone/server.GetLoginToken (13 handlers)
[GIN-debug] GET    /api/builds               --> github.com/drone/drone/server.GetBuildQueue (14 handlers)
[GIN-debug] GET    /api/debug/pprof/         --> github.com/drone/drone/server/debug.IndexHandler.func1 (14 handlers)
[GIN-debug] GET    /api/debug/pprof/heap     --> github.com/drone/drone/server/debug.HeapHandler.func1 (14 handlers)
[GIN-debug] GET    /api/debug/pprof/goroutine --> github.com/drone/drone/server/debug.GoroutineHandler.func1 (14 handlers)
[GIN-debug] GET    /api/debug/pprof/block    --> github.com/drone/drone/server/debug.BlockHandler.func1 (14 handlers)
[GIN-debug] GET    /api/debug/pprof/threadcreate --> github.com/drone/drone/server/debug.ThreadCreateHandler.func1 (14 handlers)
[GIN-debug] GET    /api/debug/pprof/cmdline  --> github.com/drone/drone/server/debug.CmdlineHandler.func1 (14 handlers)
[GIN-debug] GET    /api/debug/pprof/profile  --> github.com/drone/drone/server/debug.ProfileHandler.func1 (14 handlers)
[GIN-debug] GET    /api/debug/pprof/symbol   --> github.com/drone/drone/server/debug.SymbolHandler.func1 (14 handlers)
[GIN-debug] POST   /api/debug/pprof/symbol   --> github.com/drone/drone/server/debug.SymbolHandler.func1 (14 handlers)
[GIN-debug] GET    /api/debug/pprof/trace    --> github.com/drone/drone/server/debug.TraceHandler.func1 (14 handlers)
[GIN-debug] GET    /metrics                  --> github.com/drone/drone/server/metrics.PromHandler.func1 (14 handlers)

**

UPDATE:

**

I eventually solved the problem, this is my docker-compose docker-compose drone v0.8. Although I advised against using this, as newer version of drone has been released and introduced breaking changes with this compose.

XPLOT1ON
  • 2,994
  • 2
  • 20
  • 36
  • at first glance, I think you need `ws://` instead of `wss://`. You should only use `wss://` if the drone server is using tls. – Brad Rydzewski Jun 25 '17 at 18:27
  • I would also recommend consulting the official drone documentation, and using the `drone/drone:0.7` image since using `drone/drone:latest` is the canary build – Brad Rydzewski Jun 25 '17 at 18:29
  • @BradRydzewski I have tried switching to `ws://`, still does not work. For the drone image version, I have tried that before and didn't made changes to this post to reflect my current config. Although, I have just edited my original thread to be the most up to date config now. – XPLOT1ON Jun 25 '17 at 18:46
  • sounds like you got it working ... `pipeline: request next execution` indicates the agent has connected to the server successfully and will pull builds from the queue. – Brad Rydzewski Jun 25 '17 at 23:25
  • @BradRydzewski But if I tried to curl http://127.0.0.1:10010 (on server prompt) or access through reverse proxy, it doesn't response with any http and eventually timeout. I thought there was suppose to be a web UI? – XPLOT1ON Jun 26 '17 at 02:32
  • there is a web user interface. have you taken a look at your server logs to make sure it started and didn't error on startup due to missing configuration? Is your network setup correctly? I run almost the exact same yaml (although I don't specify 127.0.0.1 in my port definition) on digital ocean without issue – Brad Rydzewski Jun 26 '17 at 03:09
  • 1
    also please see https://github.com/nginxinc/docker-nginx/issues/137 where they recommend 0.0.0.0 instead of 127.0.0.1 for port binding. – Brad Rydzewski Jun 26 '17 at 03:12
  • @BradRydzewski Both, Drone Agent and Drone Server seems to start correctly without any error. Drone Server output a long list of routes available. I have also tried changing docker expose interface/port from just localhost:10010 to all interface on port 10010 but still unable to connect to web interface. I have also make sure that docker forward the port by doing `docker ps` Updated original post with log. – XPLOT1ON Jun 26 '17 at 04:09
  • @XPLOT1ON did you find a solution to this? I am facing the exact same problem – MrfksIV Apr 29 '19 at 21:22
  • @MrfksIV I did eventually fix it this is my docker compose without secrets. ** I have not had the chance to migrate to drone 1.0 due to time constrains and breaking changes in config. The version provided is 0.8. Although I have not encountered any problem. https://gist.github.com/panteparak/e577657fac31c0b5bb9f6592704d53a7 – XPLOT1ON Apr 30 '19 at 07:29
  • thanks for your help. Can i use 'localhost' for the the DRONE_HOST env variable? Also, based on your .yml file on your link, should the drone ui be available at port 8880? – MrfksIV Apr 30 '19 at 08:19

1 Answers1

0

You are using the same image for the agent as for the server, try using the agent image that is published in the docker hub as a "drone / agent"