[solved] Cannot ping the remote server

this is the agent config i’m using


but not work

time="2019-09-02T02:42:55-04:00" level=error msg="cannot ping the remote server" error=Forbidden

The DRONE_RPC_SECRET is same with DRONE_SECRET which was set in drone server

this means either your secret is incorrect or you did not install the server with DRONE_AGENTS_ENABLED

you can also examine the source code. the only way to receive a 403 forbidden is when the token is empty in your server configuration. A token mismatch would return a 401. See https://github.com/drone/drone/blob/master/operator/manager/rpc2/server.go#L49

docker run \
  --volume=/var/run/docker.sock:/var/run/docker.sock \
  --volume=/etc/bitbucket/key.pem:/etc/bitbucket/key.pem \
  --volume=/var/lib/drone:/data/drone \
  --volume=/etc/localtime:/etc/localtime:ro \
  --env=DRONE_GIT_ALWAYS_AUTH=false \
  --env=DRONE_LOGS_DEBUG=true \
  --env=DRONE_GIT_USERNAME=songtianyi \
  --env=DRONE_STASH_SERVER=http://git.sky-cloud.net:7990 \
  --env=DRONE_STASH_PRIVATE_KEY=/etc/bitbucket/key.pem \
  --env=DRONE_SERVER_HOST=drone.sky-cloud.net \
  --env=DRONE_SERVER_PROTO=http \
  --env=DRONE_TLS_AUTOCERT=false \
  --env=DRONE_SECRET=ce65d14c6a0e94542718bd1d87d \
  --publish=80:80 \
  --publish=443:443 \
  --restart=always \
  --detach=true \
  --name=drone \

This is how i start the server now, but still not work.
Note. I deleted some chars in secret, they are same actually.

this is not the correct variable. It is DRONE_RPC_SECRET

Yes. I just checked the docs, they are updated, there was no that env var before. Thanks a lot.

there has not been any change to the documentation, but glad you got it working …