[SOLVED] agent cannot connect to server

when I run drone agent, got the following logs
{“level”:“info”,“server”:“http://139.196.138.87”,“threads”:2,“time”:“2018-11-15T03:45:56Z”,“message”:“starting the build runner”}

2018/11/15 03:45:56 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:45:56 [DEBUG] POST http://139.196.138.87/rpc/v1/request

interrupt received, terminating process

2018/11/15 03:45:59 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context canceled

{"level":"error","error":"context canceled","platform":"linux/amd64","time":"2018-11-15T03:45:59Z","message":"cannot get queue item"}

2018/11/15 03:45:59 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context canceled

{"level":"error","error":"context canceled","platform":"linux/amd64","time":"2018-11-15T03:45:59Z","message":"cannot get queue item"}

{"level":"fatal","error":"context canceled","time":"2018-11-15T03:45:59Z","message":"program terminated"}

{"level":"info","server":"http://139.196.138.87","threads":2,"time":"2018-11-15T03:46:00Z","message":"starting the build runner"}

2018/11/15 03:46:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:46:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:46:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:46:31 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:47:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:47:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:47:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:47:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:47:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:47:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:48:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:48:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:48:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:48:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:48:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:48:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:49:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:49:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:49:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:49:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:49:31 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:49:31 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:50:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:50:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:50:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:50:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:50:33 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:50:33 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:51:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:51:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:51:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:51:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:51:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:51:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:52:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:52:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:52:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:52:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:52:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:52:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:53:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:53:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:53:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:53:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:53:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:53:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:54:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:54:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:54:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:54:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:54:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:54:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:55:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:55:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:55:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:55:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:55:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:55:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:56:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:56:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:56:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:56:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:56:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:56:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:57:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:57:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:57:00 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: context deadline exceeded

2018/11/15 03:57:00 [DEBUG] POST http://139.196.138.87/rpc/v1/request

2018/11/15 03:57:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:57:30 [DEBUG] POST http://139.196.138.87/rpc/v1/request (status: 524): retrying in 1s (30 left)

2018/11/15 03:57:32 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: EOF

2018/11/15 03:57:32 [DEBUG] POST http://139.196.138.87/rpc/v1/request: retrying in 2s (29 left)

2018/11/15 03:57:32 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: EOF

2018/11/15 03:57:32 [DEBUG] POST http://139.196.138.87/rpc/v1/request: retrying in 2s (29 left)

2018/11/15 03:57:34 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: dial tcp 139.196.138.87:80: connect: connection refused

2018/11/15 03:57:34 [DEBUG] POST http://139.196.138.87/rpc/v1/request: retrying in 4s (28 left)

2018/11/15 03:57:35 [ERR] POST http://139.196.138.87/rpc/v1/request request failed: Post http://139.196.138.87/rpc/v1/request: dial tcp 139.196.138.87:80: connect: connection refused

2018/11/15 03:57:35 [DEBUG] POST http://139.196.138.87/rpc/v1/request: retrying in 4s (28 left)

can you describe the actual problem you are experiencing?

My drone:agent seems cann’t connect to drone:server
server’s log is
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:23:57Z”,“message”:“request stage”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:23:57Z”,“message”:“request stage”}
{“level”:“debug”,“error”:“context deadline exceeded”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:24:27Z”,“message”:“context cancelled”}
{“level”:“debug”,“error”:“context deadline exceeded”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:24:27Z”,“message”:“context cancelled”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:24:28Z”,“message”:“request stage”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:24:28Z”,“message”:“request stage”}
{“level”:“debug”,“error”:“context canceled”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:24:57Z”,“message”:“context cancelled”}
{“level”:“debug”,“error”:“context canceled”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:24:57Z”,“message”:“context cancelled”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:24:57Z”,“message”:“request stage”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:24:57Z”,“message”:“request stage”}
{“level”:“debug”,“error”:“context deadline exceeded”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:25:27Z”,“message”:“context cancelled”}
{“level”:“debug”,“error”:“context deadline exceeded”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:25:27Z”,“message”:“context cancelled”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:25:28Z”,“message”:“request stage”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:25:28Z”,“message”:“request stage”}
{“level”:“debug”,“error”:“context canceled”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:25:57Z”,“message”:“context cancelled”}
{“level”:“debug”,“error”:“context canceled”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:25:57Z”,“message”:“context cancelled”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:25:57Z”,“message”:“request stage”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:25:57Z”,“message”:“request stage”}
{“level”:“debug”,“error”:“context deadline exceeded”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:26:27Z”,“message”:“context cancelled”}
{“level”:“debug”,“error”:“context deadline exceeded”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:26:27Z”,“message”:“context cancelled”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:26:28Z”,“message”:“request stage”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:26:28Z”,“message”:“request stage”}
{“level”:“debug”,“error”:“context canceled”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:26:33Z”,“message”:“context cancelled”}
{“level”:“debug”,“error”:“context canceled”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:26:33Z”,“message”:“context cancelled”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:26:38Z”,“message”:“request stage”}
{“level”:“debug”,“os”:“linux”,“arch”:“amd64”,“kernel”:"",“variant”:"",“time”:“2018-11-15T08:26:38Z”,“message”:“request stage”}

sorry.
I have resolve this problem.Agent has connected server.
The problem is I write wrong DRONE_SERVER_HOST