cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

🐛 Graceful shutdowns shouldn't produce error logs

Open firecow opened this issue 2 years ago • 5 comments

Describe the bug When i send a SIGTERM to my cloudflared tunnel run i get like 8-9 error logs.

To Reproduce Steps to reproduce the behavior:

  1. Run cloudflared tunnel run $tunnel_id
  2. Let is start fully
  3. Call kill -15 $pid

Expected behavior I would expect a graceful shutdown didn't print error logs

Logs and errors

2023-08-04T09:42:19Z INF Initiating graceful shutdown due to signal terminated ...
2023-08-04T09:42:19Z ERR writing finish: Application error 0x0 (remote)
2023-08-04T09:42:19Z INF Unregistered tunnel connection connIndex=3 event=0 ip=198.41.200.43
2023-08-04T09:42:19Z ERR Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.200.43
2023-08-04T09:42:19Z ERR Serve tunnel error error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.200.43
2023-08-04T09:42:19Z INF Retrying connection in up to 1s connIndex=3 event=0 ip=198.41.200.43
2023-08-04T09:42:19Z INF Unregistered tunnel connection connIndex=0 event=0 ip=198.41.192.67
2023-08-04T09:42:19Z ERR Failed to serve quic connection error="context canceled" connIndex=0 event=0 ip=198.41.192.67
2023-08-04T09:42:19Z INF Retrying connection in up to 1s connIndex=0 event=0 ip=198.41.192.67
2023-08-04T09:42:19Z INF Unregistered tunnel connection connIndex=1 event=0 ip=198.41.200.33
2023-08-04T09:42:19Z ERR Failed to serve quic connection error="context canceled" connIndex=1 event=0 ip=198.41.200.33
2023-08-04T09:42:19Z INF Retrying connection in up to 1s connIndex=1 event=0 ip=198.41.200.33
2023-08-04T09:42:20Z INF Unregistered tunnel connection connIndex=2 event=0 ip=198.41.192.167
2023-08-04T09:42:20Z ERR Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.192.167
2023-08-04T09:42:20Z ERR Serve tunnel error error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.192.167
2023-08-04T09:42:20Z INF Retrying connection in up to 1s connIndex=2 event=0 ip=198.41.192.167
2023-08-04T09:42:20Z ERR no more connections active and exiting
2023-08-04T09:42:20Z INF Tunnel server stopped
2023-08-04T09:42:20Z ERR icmp router terminated error="context canceled"
2023-08-04T09:42:20Z INF Metrics server stopped

firecow avatar Aug 04 '23 09:08 firecow

That's true. Thanks for the report.

Would you like to open a PR to address this?

joliveirinha avatar Aug 14 '23 19:08 joliveirinha

That's true. Thanks for the report.

Would you like to open a PR to address this?

I think this is beyond my golang "skills".

I'll give it a go, but don't get your hopes up 🤣

firecow avatar Aug 14 '23 19:08 firecow

Does this still need to be fixed? I can give it a go

Lumexralph avatar Oct 29 '23 06:10 Lumexralph

image

It's present in 2023.8.2, which is the latest version. @Lumexralph

Here is how we deploy the tunnel in docker swarm

services:

  cloudflared:
    image: cloudflare/cloudflared:2023.8.2
    command: tunnel run ${TUNNEL_UUID}
    configs:
      - source: cloudflared-cred-file
        target: /etc/cloudflared/${TUNNEL_UUID}.json
    environment:
      TUNNEL_URL: http://webserver:80
    deploy:
      update_config: { order: start-first, parallelism: 0 }

firecow avatar Oct 29 '23 08:10 firecow

I don't know if anyone from Cloudflare can give more insights on this before jumping into the wild

Lumexralph avatar Oct 29 '23 08:10 Lumexralph