Drone agent emits DRONE_HOST is not properly configured error

After i’ve upgraded drone from 0.7 to 0.8.1, the drone agent container is crashing with below error

[email protected]:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                          PORTS                                                             NAMES
8e5039ae0d0d        drone/drone:0.8.1   "/bin/drone-server..."   52 seconds ago      Restarting (1) 23 seconds ago                                                                     ubuntu_drone-agent_1
9f889b64623c        drone/drone:0.8.1   "/bin/drone-server"      52 seconds ago      Up 51 seconds                   80/tcp, 0.0.0.0:8000->8000/tcp, 443/tcp, 0.0.0.0:9000->9000/tcp   ubuntu_drone-server_1
b924b0b7a760        nginx:1.13.3        "nginx -g 'daemon ..."   2 days ago          Up 2 days                       80/tcp, 0.0.0.0:443->443/tcp                                      nginx
[email protected]:~$ 
[email protected]:~$ 
[email protected]:~$ docker logs -f ubuntu_drone-agent_1 
time="2017-10-16T04:07:28Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:07:29Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:07:29Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:07:30Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:07:31Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:07:33Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:07:36Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:07:43Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:07:56Z" level=fatal msg="DRONE_HOST is not properly configured" 
time="2017-10-16T04:08:22Z" level=fatal msg="DRONE_HOST is not properly configured" 

I have done docker-compose changes as per http://docs.drone.io/release-0.8.0

My new docker-compose yml

version: '2'

services:
  drone-server:
    image: drone/drone:0.8.1
    ports:
      - 8000:8000
      - 9000:9000
    volumes:
      - /var/lib/drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_GITHUB_URL=${DRONE_GITHUB_URL}
      - DRONE_ORGS=${DRONE_ORGS}
      - DRONE_ADMIN=${DRONE_ADMIN}
      - DRONE_HOST=${DRONE_HOST}
      - DRONE_GITHUB=true
      - DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
      - DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
      - DRONE_SECRET=${DRONE_SECRET}

  drone-agent:
    image: drone/drone:0.8.1
    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}

So how did you config the variable DRONE_HOST? It needs be http[s]://<HOSTNAME>

Yes it is proper, it’s part of .env file in the same directory.
I’ve been using it like this in 0.7 too
My .env has

....
DRONE_HOST=https://drone-ci-xxx.org.com
....

the problem is that you are not using the correct agent image. In 0.8, the agent image is drone/agent and not drone/drone

4 Likes

Awesome @bradrydzewski. It worked.
Shows the importance of reading the doc thoroughly. Will do it from next time :slight_smile:
Thanks a lot.

Please close the issue