0

I can't connect to Drone.io with my GitHub. And have several problems with the app:

1) drone-agent can't connect to server

dodge@comp:$drone agent    
28070:M 15 Nov 22:04:01.906 * connecting to server http://<my_ip>
28070:M 15 Nov 22:04:01.906 # connection failed, retry in 15s. websocket.Dial http://<my_ip>: bad scheme

2) I can't add Postgresql to docker-compose. When I add this text from your site

DRONE_DATABASE_DRIVER: postgres
DRONE_DATABASE_DATASOURCE: postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable

I have this error

INFO: 2017/11/15 19:42:33 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>}

3) When I use only a server and an agent in docker-compose I have this error

dodge@comp:$drone server

ERRO[0000] sql: unknown driver "sqlite3" (forgotten import?) 
FATA[0000] database connection failed 

docker-compose.yml

version: '2'
services:
  drone-server:
    image: drone/drone:0.8
    ports:
      - 80:8000
      - 9000
    volumes:
      - /var/lib/drone:/var/lib/drone/
      - ./drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_DEBUG=true
      - DRONE_OPEN=true
      - DRONE_HOST=http://172.18.0.2
      - DRONE_GITHUB=true
      - DRONE_GITHUB_CLIENT=secretid
      - DRONE_GITHUB_SECRET=secretpass
      - DRONE_SECRET=password

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

4) I cannot start tests in my project. Maybe I missed something during the setup.

Oliver
  • 11,857
  • 2
  • 36
  • 42
Dmytro
  • 61
  • 2
  • 13
  • This question is a bit difficult to answer because it sounds like you maybe tried 3 different installation methods (docker-compose, binary, self-compiler), using multiple versions of drone (0.7 and 0.8). Instead perhaps consider editing your question to only document your issues with 1 installation method for 1 version of drone. This will make it easier to provide an answer. – Brad Rydzewski Nov 15 '17 at 21:13
  • Also point number 4 is a little vague. Can you provide more detail regarding "cannot start tests"? Does this mean you got drone up and running (in which case points 1-3 are resolved)? Do you mean you push to GitHub but a build is not invoked in drone? If yes did you check the server logs? Did you look at your GitHub webhook settings in GitHub to see if and why hooks are failing? – Brad Rydzewski Nov 15 '17 at 21:21
  • @BradRydzewski I used drone.io version 0.8 in docker-compose. I also installed CLI for check drone. About point number 4. Webhooks in GitHub works. Drone dont see .drone.yml file and can't start tests. – Dmytro Nov 16 '17 at 08:04
  • @BradRydzewski I was delete all file (volumes and images), reconnect to github and restart docker-compose. All works fine. Thank you for your time! – Dmytro Nov 16 '17 at 10:32

2 Answers2

0

$ drone server

$ drone agent

I see the above commands in your examples. These commands are only available in drone 0.7 and below. Drone 0.8 uses drone-server and drone-agent binaries. There seems to be some version disconnect here.

connection failed, retry in 15s. websocket.Dial

drone 0.7 and below used websockets. I see in the docker-compose example you are using drone 0.8 which uses http2 and grpc. There seems to be a disconnect in your configuration vs the version of drone you are using.

sql: unknown driver "sqlite3"

this happens when you compile drone with CGO disabled, or use a version of drone that has been compiled with CGO disabled. If CGO is disabled the sqlite3 driver is not compiled into the binary. Are you trying to build drone from source?

grpc: addrConn.resetTransport failed to create client transport

This error comes from the agent, and is therefore unrelated to a postgres configuration. You should not be providing your agent with a postgres configuration, only the server.

Community
  • 1
  • 1
Brad Rydzewski
  • 2,523
  • 14
  • 18
0
version: '2'

services:
  drone-server:
    image: drone/drone:latest
    ports:
      - 80:8000
      - 9000:9000
    volumes:
      - /var/lib/drone:/var/lib/drone/
      - ./drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_DEBUG=true
      - DRONE_HOST=http://<container_ip_server>
      - DRONE_OPEN=true
      - DRONE_GITHUB=true
      - DRONE_GITHUB_CLIENT=<client_git>
      - DRONE_GITHUB_SECRET=<secret_git>
      - DRONE_SECRET=<secret_drone>
      - DRONE_GITHUB_MERGE_REF=true 

  drone-agent:
    image: drone/agent:latest
    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=<drone_secret>

This workes fine.

Dmytro
  • 61
  • 2
  • 13