cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

Cloudflare Tunnel randomly stops serving traffic

Open Albonycal opened this issue 2 years ago • 29 comments

Cloudflare tunnel randomly not working The daemon is still running but no traffic reaches it.. restarting the daemon fixes it for a while, but then it happens again. No pattern observed, just randomly stops working

Environment and versions

  • OS: Ubuntu Server 20.04
  • Architecture: AMD64
  • Version: 2022.7.1
  • Running as a systemd service

Logs and errors

Jul 17 12:08:33 phoenix cloudflared[470354]: 2022-07-17T06:38:33Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:33 phoenix cloudflared[470354]: 2022-07-17T06:38:33Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:34 phoenix cloudflared[470354]: 2022-07-17T06:38:34Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:34 phoenix cloudflared[470354]: 2022-07-17T06:38:34Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:34 phoenix cloudflared[470354]: 2022-07-17T06:38:34Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:34 phoenix cloudflared[470354]: 2022-07-17T06:38:34Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:35 phoenix cloudflared[470354]: 2022-07-17T06:38:35Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:35 phoenix cloudflared[470354]: 2022-07-17T06:38:35Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:36 phoenix cloudflared[470354]: 2022-07-17T06:38:36Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:36 phoenix cloudflared[470354]: 2022-07-17T06:38:36Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:36 phoenix cloudflared[470354]: 2022-07-17T06:38:36Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:36 phoenix cloudflared[470354]: 2022-07-17T06:38:36Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>
Jul 17 12:08:36 phoenix cloudflared[470354]: 2022-07-17T06:38:36Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>

Its showing this error, but it used to show some TCP connect error for the URL inside LAN

Additional context I am using the --protocol http2 flag because quic doesn't work host: mirror.albony.xyz cloudflare email: [email protected]

Albonycal avatar Jul 17 '22 09:07 Albonycal

I am using the --protocol http2 flag because quic doesn't work

Can you explain what you mean by doesn't work? We'll need a little more information to help you. :)

Incoming request ended abruptly: context canceled

This basically means the requests to your tunnel were cancelled because of a timeout. Is your origin service slow my any chance?

sudarshan-reddy avatar Jul 17 '22 10:07 sudarshan-reddy

This basically means the requests to your tunnel were cancelled because of a timeout. Is your origin service slow my any chance?

no? when cloudflared is "down" my origin services works fine, and at gigabit LAN speeds.

Albonycal avatar Jul 17 '22 10:07 Albonycal

Can you explain what you mean by doesn't work? We'll need a little more information to help you. :)

it fails to connect using quic, I have tried everything, even setting up port triggering for it so now I force it to use HTTP2 before cloudflared use to use HTTP2 by default idk why it tries to use quic now

Albonycal avatar Jul 17 '22 10:07 Albonycal

This basically means the requests to your tunnel were cancelled because of a timeout. Is your origin service slow my any chance?

and even if it's slow, cloudflare tunnel shouldn't just crash ?

Albonycal avatar Jul 17 '22 10:07 Albonycal

also, I have two instances of cloudflared now, both do the same thing.

Albonycal avatar Jul 17 '22 10:07 Albonycal

it fails to connect using quic, I have tried everything, even setting up port triggering for it so now I force it to use HTTP2 before cloudflared use to use HTTP2 by default idk why it tries to use quic now

What is your system running on? Do you have UDP egress enabled? quic is the direction we want to take the future of cloudflared for, for both performance and stability reasons.

sudarshan-reddy avatar Jul 17 '22 10:07 sudarshan-reddy

and even if it's slow, cloudflare tunnel shouldn't just crash ?

Can you share crash logs? I only see

Jul 17 12:08:36 phoenix cloudflared[470354]: 2022-07-17T06:38:36Z ERR  error="Incoming request ended abruptly: context canceled" cfRay=>

sudarshan-reddy avatar Jul 17 '22 10:07 sudarshan-reddy

uh by "crash" it doesn't really crash, the daemon is still running but it doesn't serve traffic

Albonycal avatar Jul 17 '22 10:07 Albonycal

also, is this normal behaviour? image notice the space between the bars, it drops the speed when I am downloading something and then regains it

Albonycal avatar Jul 17 '22 11:07 Albonycal

That is expected behaviour since your bandwidth is shared.

sudarshan-reddy avatar Jul 20 '22 10:07 sudarshan-reddy

it fails to connect using quic, I have tried everything, even setting up port triggering for it

Did you enable UDP egress in your firewall?

sudarshan-reddy avatar Jul 20 '22 10:07 sudarshan-reddy

yea I did

On Wed, Jul 20, 2022 at 3:55 PM Sudarshan Reddy @.***> wrote:

it fails to connect using quic, I have tried everything, even setting up port triggering for it

Did you enable UDP egress in your firewall?

— Reply to this email directly, view it on GitHub https://github.com/cloudflare/cloudflared/issues/698#issuecomment-1190101986, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP7TNJ7FXWWHKPJLHPQ6LMDVU7H2TANCNFSM53ZPRVSQ . You are receiving this because you authored the thread.Message ID: @.***>

Albonycal avatar Jul 20 '22 10:07 Albonycal

I added this to my router config image

Albonycal avatar Jul 20 '22 11:07 Albonycal

tried and QUIC works, getting some errors on the console but it seems to work, so ig it's fine? image

update: yea quic seems to work

Albonycal avatar Jul 20 '22 11:07 Albonycal

Nice! Are you still having these issues?

sudarshan-reddy avatar Jul 24 '22 04:07 sudarshan-reddy

hmm no.. but these are still there image and I see some quic errors

Albonycal avatar Jul 24 '22 10:07 Albonycal

still getting a lot of "incoming request ended abruptly"

Albonycal avatar Jul 25 '22 10:07 Albonycal

This is indicative of your clients closing these requests. What is the experience you get on the eyeball side?

sudarshan-reddy avatar Jul 27 '22 08:07 sudarshan-reddy

This is indicative of your clients closing these requests.

That makes sense

what do you mean by the "eyeball" side?

Albonycal avatar Jul 27 '22 09:07 Albonycal

That particular service is being monitored here, https://archlinux.org/mirrors/albony.xyz/ and I see some errors which shouldn't be there.. image

Albonycal avatar Jul 27 '22 09:07 Albonycal

i rechecked and confirmed that the same issue is happening.. and restarting the daemon "fixes" it temperorrily,,, but it happens again

Albonycal avatar Aug 01 '22 11:08 Albonycal

I wonder if a burst of high traffic can trigger a bug in cloudflared or something that makes it unresponsive.. This machine is quite old so maybe that's the issue? but still it shouldn't act like this, looks like a cloudflared bug to me ?

Albonycal avatar Aug 01 '22 17:08 Albonycal

@joliveirinha may have found a possible solution.

sudarshan-reddy avatar Aug 09 '22 15:08 sudarshan-reddy

:eyes: :crossed_fingers:

Albonycal avatar Aug 10 '22 09:08 Albonycal

Hey! has there been any progress on this issue? anything I can help with? Thank you

Albonycal avatar Aug 19 '22 18:08 Albonycal

Hi @Albonycal ,

We did some improvements, but looking at this issue, I don't know if they are related to the particular one you mention here.

Looking at the logs, as @sudarshan-reddy mentioned, it just seems that eyeball left before the request finished. We are doing a release next week, let's see if any of the fixes actually helped here.

joliveirinha avatar Aug 20 '22 12:08 joliveirinha

I am using the --protocol http2 flag because quic doesn't work

Can you explain what you mean by doesn't work? We'll need a little more information to help you. :)

I am going to raise my hand and say we have been very frustrated by this and a litany of issues with the tunnel recently. We were seeing requests truncated (return 200), but have no body, causing P1 downstream issues since standard retry logic wasn't activated. We saw issues under 2022.4.1 and 2022.8.2

@tomhuang12 is working with support under ticket 2535568 -- but please let us know what we can do to support. We would like to see this stabilized ASAP.

don4of4 avatar Aug 24 '22 20:08 don4of4

If it helps, when I say it "stops serving requests" it doesn't return the tunnel error or 503, the requests gets timed out

Albonycal avatar Aug 25 '22 10:08 Albonycal

This still happens :(

Albonycal avatar Sep 17 '22 16:09 Albonycal

can confirm this still happens. running cloudflared v2022.10.3 in kubernetes setup w/ http2 protocol set.

can send some CF-rays through ticket or here if needed.

morpig avatar Nov 08 '22 13:11 morpig