songtianyi
(songtianyi)
1
this is the agent config i’m using
DRONE_RPC_PROTO=http
DRONE_RPC_HOST=drone.sky-cloud.net
DRONE_RPC_SECRET=ce65d1400bde94542718bd1d87d
DRONE_LOG_FILE=/var/log/drone-runner-exec/log.txt
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
songtianyi
(songtianyi)
4
#!bin/sh
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_PASSWORD=NDM2OTA1ND3CaNCvfr6QyKNhH3jgVKwKOpZF \
--env=DRONE_GIT_USERNAME=songtianyi \
--env=DRONE_STASH_SERVER=http://git.sky-cloud.net:7990 \
--env=DRONE_STASH_CONSUMER_KEY=OauthKey \
--env=DRONE_STASH_PRIVATE_KEY=/etc/bitbucket/key.pem \
--env=DRONE_RUNNER_CAPACITY=2 \
--env=DRONE_SERVER_HOST=drone.sky-cloud.net \
--env=DRONE_SERVER_PROTO=http \
--env=DRONE_TLS_AUTOCERT=false \
--env=DRONE_SECRET=ce65d14c6a0e94542718bd1d87d \
--env=DRONE_AGENTS_ENABLED=true \
--publish=80:80 \
--publish=443:443 \
--restart=always \
--detach=true \
--name=drone \
drone/drone:1
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
songtianyi
(songtianyi)
7
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 …