Setting cloud config raises unrelated error

We are trying to enable a custom cloud config in order to get past the Docker Hub limits. We use this cloud config (based off of the example given in the autoscaler docs). The only real difference being that it uses AWS linux extras to setup docker and the registry mirror is set as part of the daemon.json:

#cloud-config
package_update: false
package_upgrade: false

packages:
  - docker

bootcmd:
  - amazon-linux-extras enable docker

write_files:
  - path: /etc/systemd/system/docker.service.d/override.conf
    content: |
      [Service]
      ExecStart=
      ExecStart=/usr/bin/dockerd
  - path: /etc/default/docker
    content: |
      DOCKER_OPTS=""
  - path: /etc/docker/daemon.json
    content: |
      {
        "hosts": [ "0.0.0.0:2376", "unix:///var/run/docker.sock" ],
        "tls": true,
        "tlsverify": true,
        "tlscacert": "/etc/docker/ca.pem",
        "tlscert": "/etc/docker/server-cert.pem",
        "tlskey": "/etc/docker/server-key.pem",
        "registry-mirrors": ["https://internal.docker.corp.net"],
      }
  - path: /etc/docker/ca.pem
    encoding: b64
    content: {{ .CACert | base64 }}
  - path: /etc/docker/server-cert.pem
    encoding: b64
    content: {{ .TLSCert | base64 }}
  - path: /etc/docker/server-key.pem
    encoding: b64
    content: {{ .TLSKey | base64 }}

runcmd:
  - [ systemctl, daemon-reload ]
  - [ systemctl, restart, docker ]

We then built our own autoscaler image based off of the Drone one:

FROM drone/autoscaler

COPY init.yml /config/

And then in our ECS task definition we set the env var to point towards the cloud config file:

    - name: DRONE_AMAZON_USERDATA_FILE
      value: /config/init.yml

However when the autoscaler starts it exits with this error:

drone-runner-docker: error: required key DRONE_RPC_HOST missing value, try --help

I can’t tell what the issue is here. The deployment works perfectly before we set the env var. We set the autoscaler env var DRONE_SERVER_HOST and as soon as I comment out DRONE_AMAZON_USERDATA_FILE the autoscaler comes up like normal.

I found this old thread about a envconfig printing the wrong env var ([Documentation] Potential Documentation Error) but I was wondering if there was insight as to what is going on here.

1 Like

Hello @rchui,

Looking into the error “error: required key DRONE_RPC_HOST missing value” looks like drone server host is not configured, could you please set the server host as mentioned below and try once.

https://docs.drone.io/runner/docker/configuration/reference/drone-rpc-host/

Regards,
Harness support

Hi @csgit ,

This is for the Drone autoscaler not for the Drone runner. The Drone autoscaler has a configuration for DRONE_SERVER_HOST but not the DRONE_RPC_HOST (note we do set DRONE_SERVER_HOST). Does the error mean that the env var DRONE_RPC_HOST needs to be set on the Drone autoscaler if the DRONE_AMAZON_USERDATA_FILE parameter is set even if it is not a Drone runner?

Drone Autoscaler Config: Configuration Reference | Drone