cloudflare / cloudflare/cloudflared
Tunnel hangs after upstream router restart
- Dominant language
- Go
- Stars
- 15.6k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
The tunnel thinks everything is fine but the Teams web UI shows the tunnel is inactive. Attempts to connect to protected resources end up in a "too many redirects" loop.
```
$ cftun
Trying to pull docker.io/cloudflare/cloudflared:2021.10.2...
Getting image source signatures
Copying blob 6b34ec2e9ecc done
Copying blob 9411f38bb959 done
Copying blob 792ac47b91a1 done
Copying config 364d068eff done
Writing manifest to image destination
Storing signatures
2021-10-15T03:06:23Z INF Starting tunnel tunnelID=82bee42b-83c7-4800-86ab-b6755b1be1b6
2021-10-15T03:06:23Z INF Version 2021.10.2-dev
2021-10-15T03:06:23Z INF GOOS: linux, GOVersion: go1.17.1, GoArch: amd64
2021-10-15T03:06:23Z INF Settings: map[config:/etc/cloudflared/ha.yaml cred-file:/etc/cloudflared/82bee42b-83c7-4800-86ab-b6755b1be1b6.json credentials-file:/etc/cloudflared/82bee42b-83c7-4800-86ab-b6755b1be1b6.json metrics:0.0.0.0:12345 no-autoupdate:true]
2021-10-15T03:06:23Z INF cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/run-as-service
2021-10-15T03:06:23Z INF Generated Connector ID: 12050563-9a9d-4fcd-b361-254c40b5b816
2021-10-15T03:06:23Z INF Initial protocol http2
2021-10-15T03:06:23Z INF Starting metrics server on [::]:12345/metrics
2021-10-15T03:06:23Z INF Connection 05207bf5-9047-4e1a-a26d-f8e304b0874d registered connIndex=0 location=IAD
2021-10-15T03:06:24Z INF Connection f42347e5-42a1-4958-bcba-f3ab0d79d460 registered connIndex=1 location=IAD
2021-10-15T03:06:25Z INF Connection 0ec3d734-aebd-4f5f-a31c-f1440e8a81f2 registered connIndex=2 location=IAD
2021-10-15T03:06:26Z INF Connection 42b8bf9e-225d-4a45-86f1-f4839e7c9736 registered connIndex=3 location=IAD
```
Router restarts here. No more logs are printed to the cftun console.
```
$ curl -s localhost:12345/ready | jq .
{
"status": 200,
"readyConnections": 4
}
```
The ready endpoint says everything is fine but the Teams console has marked the tunnel as INACTIVE. This is fairly reproducible for me. Am I missing a setting on the tunnel client?
```
$ cat ~/.cloudflared/ha.yaml
tunnel: 82bee42b-83c7-4800-86ab-b6755b1be1b6
credentials-file: /etc/cloudflared/82bee42b-83c7-4800-86ab-b6755b1be1b6.json
metrics: 0.0.0.0:12345
ingress:
- hostname: XXX
service: XXX
- service: http_status:404
```
Contributor guide
Assessment
This issue has not been assessed yet.