cloudflare / cloudflared

Cloudflare Tunnel client (formerly Argo Tunnel)
https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide
Apache License 2.0
9.39k stars 837 forks source link

Failed to serve quic connection #510

Closed Barre closed 2 years ago

Barre commented 3 years ago

While running cloudflared using --protocol quic, our origin fails a few times per day with the error:

Nov 17 02:24:46  ERR Failed to serve quic connection, err: failed to accept QUIC stream: timeout: no recent network activity
Nov 17 07:01:42 ERR Failed to serve quic connection, err: failed to accept QUIC stream: timeout: no recent network activity
[...]

When it happens, cloudflared seems to register a new connection. Before a new connection is registered, cloudflare returns 502 - Bad gateway responses while accessing our services.

Nov 17 15:08:31 2021-11-17T14:08:31Z INF Connection f5a6067a-bb51-41e9-abae-539e56707072 registered connIndex=2 location=AMS

jleach commented 6 months ago

Ran into this today on cloudflared 2024.1.1 for macOS for no reason, doing what I normally do. I just restarted to install some updates and the problem fixed itself.

failed to accept QUIC stream: Application error 0x0 (remote)
PMach17 commented 4 months ago

For me it was firewall blocking the ports.

kingname commented 4 months ago

来信已收到,我会尽快回复。

parthpatel-simbiotik commented 4 months ago

I am also facing the same.

Jul 29 12:39:23 dash-parking-server cloudflared[2444]: 2024-07-29T04:39:23Z INF Unregistered tunnel connection connIndex=1 event=0 ip=198.41.192.57 Jul 29 12:39:23 dash-parking-server cloudflared[2444]: 2024-07-29T04:39:23Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=1 event=0 ip=198.41.192.57 Jul 29 12:39:23 dash-parking-server cloudflared[2444]: 2024-07-29T04:39:23Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=1 event=0 ip=198.41.192.57 Jul 29 12:39:23 dash-parking-server cloudflared[2444]: 2024-07-29T04:39:23Z INF Retrying connection in up to 1s connIndex=1 event=0 ip=198.41.192.57 Jul 29 12:39:25 dash-parking-server cloudflared[2444]: 2024-07-29T04:39:25Z WRN Connection terminated error="Application error 0x0 (remote)" connIndex=1 Jul 29 12:39:53 dash-parking-server cloudflared[2444]: 2024-07-29T04:39:53Z INF Registered tunnel connection connIndex=1 connection=0b6f4f5f-6dac-4e53-85cd-44fd19017060 event=0 ip=198.41.192.57 location=kul01 protocol=quic

AN3Orik commented 4 months ago

Same here for last 2 days:

2024-08-03T05:47:59Z INF Starting tunnel tunnelID=d68eca7f-0bf3-481f-96e0-43ad6f937cee 2024-08-03T05:47:59Z INF Version 2024.6.1 2024-08-03T05:47:59Z INF GOOS: linux, GOVersion: go1.22.2, GoArch: amd64 2024-08-03T05:47:59Z INF Settings: map[config:/tmp/config.json cred-file:/data/tunnel.json credentials-file:/data/tunnel.json metrics:0.0.0.0:36500 no-autoupdate:true origincert:/data/cert.pem] 2024-08-03T05:47:59Z INF Generated Connector ID: 414d1982-e522-4b96-9d40-fb88b92794e7 2024-08-03T05:47:59Z INF Initial protocol quic 2024-08-03T05:47:59Z INF ICMP proxy will use 172.30.33.1 as source for IPv4 2024-08-03T05:47:59Z INF ICMP proxy will use ::1 in zone lo as source for IPv6 2024-08-03T05:47:59Z INF Starting metrics server on [::]:36500/metrics 2024-08-03T05:48:04Z ERR Failed to serve quic connection error="context deadline exceeded" connIndex=0 event=0 ip=198.41.192.7 2024-08-03T05:48:04Z ERR Register tunnel error from server side error="context deadline exceeded" connIndex=0 event=0 ip=198.41.192.7 2024-08-03T05:48:04Z INF Retrying connection in up to 2s connIndex=0 event=0 ip=198.41.192.7 2024-08-03T05:48:04Z INF Tunnel server stopped 2024-08-03T05:48:04Z ERR Initiating shutdown error="context deadline exceeded" 2024-08-03T05:48:04Z ERR icmp router terminated error="context canceled" 2024-08-03T05:48:04Z INF Metrics server stopped context deadline exceeded

sbouillon commented 3 months ago

This just started happening for me using cloudflare/cloudflared:latest. Did a docker pull and created a new container... Same result..

2024-08-07T21:58:47Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:58:47Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:58:47Z INF Retrying connection in up to 2s connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:58:48Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:58:48Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:58:48Z INF Retrying connection in up to 2s connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:58:49Z WRN Connection terminated error="rpc: connection closed" connIndex=1 2024-08-07T21:58:49Z WRN Connection terminated error="Application error 0x0 (remote)" connIndex=2 2024-08-07T21:58:50Z WRN Connection terminated error="Application error 0x0 (remote)" connIndex=3 2024-08-07T21:58:58Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:58:58Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:58:58Z INF Retrying connection in up to 4s connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:58:58Z WRN Failed to serve quic connection error="failed to accept QUIC stream: Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:58:58Z WRN Serve tunnel error error="failed to accept QUIC stream: Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:58:58Z INF Retrying connection in up to 4s connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:58:58Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=1 event=0 ip=198.41.192.107 2024-08-07T21:58:58Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=1 event=0 ip=198.41.192.107 2024-08-07T21:58:58Z INF Retrying connection in up to 4s connIndex=1 event=0 ip=198.41.192.107 2024-08-07T21:58:59Z WRN Connection terminated error="Application error 0x0 (remote)" connIndex=1 2024-08-07T21:59:00Z WRN Connection terminated error="Application error 0x0 (remote)" connIndex=3 2024-08-07T21:59:00Z WRN Connection terminated error="failed to accept QUIC stream: Application error 0x0 (remote)" connIndex=2 2024-08-07T21:59:37Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:59:37Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:59:37Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:59:37Z INF Retrying connection in up to 8s connIndex=2 event=0 ip=198.41.200.13 2024-08-07T21:59:37Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:59:37Z INF Retrying connection in up to 8s connIndex=3 event=0 ip=198.41.192.47 2024-08-07T21:59:37Z INF Registered tunnel connection connIndex=1 connection=1e8d53fd-b9c7-4cb6-a45a-bb543ea7820b event=0 ip=198.41.192.107 location=ewr01 protocol=quic 2024-08-07T21:59:39Z WRN Connection terminated error="Application error 0x0 (remote)" connIndex=3 2024-08-07T21:59:40Z WRN Connection terminated error="Application error 0x0 (remote)" connIndex=2 2024-08-07T22:00:59Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.200.13 2024-08-07T22:00:59Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.200.13 2024-08-07T22:00:59Z INF Retrying connection in up to 16s connIndex=2 event=0 ip=198.41.200.13 2024-08-07T22:00:59Z WRN Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.192.47 2024-08-07T22:00:59Z WRN Serve tunnel error error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.192.47 2024-08-07T22:00:59Z INF Retrying connection in up to 16s connIndex=3 event=0 ip=198.41.192.47 2024-08-07T22:01:00Z WRN Connection terminated error="Application error 0x0 (remote)" connIndex=3

KidA001 commented 3 months ago

I just started getting this error too. Running 2024.8.2 (built 2024-08-06-1219 UTC) on Debian

Kawobie commented 3 months ago

Same, I even restored from backup but still same error. Update: I little bit of patience and it is working again.

AN3Orik commented 3 months ago

Same, I even restored from backup but still same error. Update: I little bit of patience and it is working again.

Also it's sometimes working, sometimes not. Resolution is using http2 protocol instead quic via parameter --protocol=http2

axion-labs commented 3 months ago

our record on cloudflare disappeared, and shut as usual

matthewzabikhullaev commented 2 months ago

Sep 30 20:26:34 zabbix-server cloudflared[5662]: 2024-10-01T00:26:34Z WRN Failed to serve quic connection error="timeout: no recent network activity" connIndex=1 event=0 ip=198.41.200.> Sep 30 20:26:34 zabbix-server cloudflared[5662]: 2024-10-01T00:26:34Z WRN Serve tunnel error error="timeout: no recent network activity" connIndex=1 event=0 ip=198.41.200.53 Sep 30 20:26:34 zabbix-server cloudflared[5662]: 2024-10-01T00:26:34Z INF Retrying connection in up to 1s connIndex=1 event=0 ip=198.41.200.53 Sep 30 20:26:34 zabbix-server cloudflared[5662]: 2024-10-01T00:26:34Z WRN Connection terminated error="timeout: no recent network activity" connIndex=1 Sep 30 20:26:35 zabbix-server cloudflared[5662]: 2024-10-01T00:26:35Z INF Unregistered tunnel connection connIndex=0 event=0 ip=198.41.192.47

matthewzabikhullaev commented 2 months ago

Getting this error for the last 3 days

matthewzabikhullaev commented 2 months ago

Can we reopen this?

melihkizmaz commented 1 month ago

Same issue


2024-10-11T09:41:53Z INF Tunnel server stopped
2024-10-11T09:41:53Z ERR Initiating shutdown error="context canceled"
2024-10-11T09:41:53Z INF Metrics server stopped
context canceled
lpw96 commented 6 days ago

has anyone a fix to this yet?

AN3Orik commented 5 days ago

has anyone a fix to this yet?

Due quic is unstable in most cases - use http2 protocol https://github.com/cloudflare/cloudflared/issues/510#issuecomment-2275637312

lpw96 commented 5 days ago

has anyone a fix to this yet?

Due quic is unstable in most cases - use http2 protocol

https://github.com/cloudflare/cloudflared/issues/510#issuecomment-2275637312

How do I do that please?

Barre commented 5 days ago

has anyone a fix to this yet?

Due quic is unstable in most cases - use http2 protocol #510 (comment)

How do I do that please?

Run cloudflared with --protocol=http2

https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-run-parameters/#protocol

timscott commented 5 days ago

http2 protocol works better for me. I also discovered I need to keep the app alive on my machine. Sleep mode will cause interruptions.

lpw96 commented 4 days ago

I am having the same issues with HTTP2 unfortunately. keep what app alive sorry?