Cloudflared Tunnel Loosing Connection

I have an AWS system running a Cloudflared tunnel. I am also running WARP. The Cloudflared tunnel has worked fine for the past 5 days, but then approximately 12 hours ago it went down and I noticed this in my logs:
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Failed to serve tunnel connection error="timeout: no recent network activity">
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Serve tunnel error error="timeout: no recent network activity" connIndex=1 ev>
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z INF Retrying connection in up to 1s connIndex=1 event=0 ip=2606:4700:a0::5
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Failed to serve tunnel connection error="failed to accept QUIC stream: timeou>
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Serve tunnel error error="failed to accept QUIC stream: timeout: no recent ne>
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z INF Retrying connection in up to 1s connIndex=0 event=0 ip=2606:4700:a8::5
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Failed to serve tunnel connection error="timeout: no recent network activity">
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Serve tunnel error error="timeout: no recent network activity" connIndex=3 ev>
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z INF Retrying connection in up to 1s connIndex=3 event=0 ip=2606:4700:a0::8
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Failed to serve tunnel connection error="timeout: no recent network activity">
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Serve tunnel error error="timeout: no recent network activity" connIndex=1 ev>
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z INF Retrying connection in up to 1s connIndex=1 event=0 ip=2606:4700:a0::5
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Failed to serve tunnel connection error="failed to accept QUIC stream: timeou>
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Serve tunnel error error="failed to accept QUIC stream: timeout: no recent ne>
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z INF Retrying connection in up to 1s connIndex=0 event=0 ip=2606:4700:a8::5
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Failed to serve tunnel connection error="timeout: no recent network activity">
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z WRN Serve tunnel error error="timeout: no recent network activity" connIndex=3 ev>
Dec 04 22:55:45 ip-172-31-95-88 cloudflared[1386]: 2024-12-05T03:55:45Z INF Retrying connection in up to 1s connIndex=3 event=0 ip=2606:4700:a0::8
This has happened before and running sudo systemctl restart cloudflared always seems to fix the issue. Does anyone know why this might be happening and what I can try to avoid it? Also, is there some way I can auto restart if my system gets in this state? Thanks for any help!
1 Reply
Bot Mhann
Bot MhannOP2mo ago
This is the output when I type sudo nano /etc/systemd/system/cloudflared.service if it's helpful:
Description=cloudflared
After=network-online.target
Wants=network-online.target

[Service]
TimeoutStartSec=0
Type=notify
ExecStartPre=/bin/sleep 15
ExecStart=/usr/bin/cloudflared --no-autoupdate tunnel --edge-ip-version 6 run --token XXXXXXXXXXXXXXXXX>Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
Description=cloudflared
After=network-online.target
Wants=network-online.target

[Service]
TimeoutStartSec=0
Type=notify
ExecStartPre=/bin/sleep 15
ExecStart=/usr/bin/cloudflared --no-autoupdate tunnel --edge-ip-version 6 run --token XXXXXXXXXXXXXXXXX>Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
Thanks again!

Did you find this page helpful?