Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fails on raspberry pi - context deadline exceeded #253

Open
KommX opened this issue Oct 27, 2020 · 32 comments
Open

Update fails on raspberry pi - context deadline exceeded #253

KommX opened this issue Oct 27, 2020 · 32 comments
Labels
Priority: Deferred Issue has been placed in backlog

Comments

@KommX
Copy link

KommX commented Oct 27, 2020

Since #249 got closed I want to create a new issue for the problem that was mentioned there and that some of us including me face:
When I run sudo cloudflare update I get the error:
failed to update cloudflared: context deadline exceeded (Client.Timeout or context cancellation while reading body)

More info:

cloudflared --version

cloudflared version 2020.10.0 (built 2020-10-06-1530 UTC)
cat /etc/os-release 

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
@ImaginaryElephant
Copy link

I get this error too when I run sudo cloudflared update.

ERROR[2020-10-27T20:30:44Z] update check failed: context deadline exceeded (Client.Timeout or context cancellation while reading body) failed to update cloudflared: context deadline exceeded (Client.Timeout or context cancellation while reading body)

Previously I used to get

failed to update cloudflared: no release found

before the update to the API #249

I'm running cloudflared on a raspberry pi 3B
cloudflared -v cloudflared version 2020.10.0 (built 2020-10-06-1530 UTC)

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

@tamhamilton
Copy link

Same issue here.

cloudflared version 2020.10.0 (built 2020-10-06-1530 UTC)

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

@tamhamilton
Copy link

OK, fixed it. Well, more specifically, they fixed it...

This is how:

Roll back cloudflared to an older, stable, version:
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz
sudo systemctl stop cloudflared
sudo cp ./cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
sudo systemctl start cloudflared
cloudflared -v

Then update cloudflared (to 2020.10.2):
sudo cloudflared update
sudo systemctl restart cloudflared

Run the update command again, and you should get a sensible response about cloudflared being up to date

@kosymodo
Copy link

Thanks @tamhamilton - this worked a treat!

@denisinla
Copy link

sudo cloudflared update

Nope, still getting failed to update cloudflared: context deadline exceeded (Client.Timeout or context cancellation while reading body)

@tamhamilton
Copy link

Cloudflared definitely reporting v2020.10.2?

@denisinla
Copy link

denisinla commented Oct 31, 2020

Cloudflared definitely reporting v2020.10.2?

Negative, it is still reporting 2020.10.0.

Looks like I forgot a step sudo systemctl stop cloudflared.
I can confirm sudo cloudflared update runs properly now.

Thanks @tamhamilton

@KommX
Copy link
Author

KommX commented Nov 1, 2020

OK, fixed it. Well, more specifically, they fixed it...

This is how:

Roll back cloudflared to an older, stable, version:
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz
sudo systemctl stop cloudflared
sudo cp ./cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
sudo systemctl start cloudflared
cloudflared -v

Then update cloudflared (to 2020.10.2):
sudo cloudflared update
sudo systemctl restart cloudflared

Run the update command again, and you should get a sensible response about cloudflared being up to date

I would say, that this is more of a workaround than a fix. What do the people do, that don't see this issue report here?

@ddarnell1
Copy link

ddarnell1 commented Nov 3, 2020

Thank you, the re-install stable then update method worked for me as well.

@denisinla
Copy link

Actually that wasn't a rollback. It's a re-install since the stable version is always the latest one.

@tamhamilton
Copy link

That's what I thought, but I checked the version after my initial steps and it didn't report 2020.10.2 (can't remember what it actually was though). Ran the update command, and it did update (rather than just report that cloudflared is at the latest version), and now reports 2020.10.2.

Anyhow, I apologise if my incorrect terminology offends anyone... Just wanted to share the steps that got me up and running properly.

@ghost
Copy link

ghost commented Nov 7, 2020

Can also Replicate this. 2020.10.0 is what my version was. @KommX steps fixed my issue. Sounds like people will just need to deploy this fix for the updates to work again.

@KommX KommX changed the title Update fails on raspberry pi Update fails on raspberry pi - context deadline exceeded Nov 7, 2020
@ferferga
Copy link

ferferga commented Nov 8, 2020

The provided suggestions doesn't work for me. cloudflared -v output after running the commands:

cloudflared version 2020.10.2 (built 2020-10-21-1858 UTC)

@tamhamilton
Copy link

And what now happens when you run
cloudflared update
?

@ferferga
Copy link

ferferga commented Nov 9, 2020

@tamhamilton failed to update cloudflared: Get "https://update.argotunnel.com?arch=arm&os=linux": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

@tommetje
Copy link

I was on cloudflared version 2020.10.2 (built 2020-10-21-1858 UTC) on a raspberry pi and could not update too (context deadline exceeded error).

Re-installing the older version enabled me to update successfully to
cloudflared version 2020.11.3 (built 2020-11-11-1505 UTC)

@ferferga
Copy link

ferferga commented Nov 11, 2020

@tommetje But, after doing that, now in the latest version, are you able to update using cloudflared's built-in updater?

Because I know I'm able to update it replacing the binary. However, what I want to know is if I'll need to make an script for automatising the updating process, as I was relying in the built-in one for the automation.

Will the built-in updater be fixed at some point?

@daltoniam
Copy link

Howdy everyone. We just release 2020.11.3 which lengthen the timeout on the updater. The timeout was previously a bit short for some connections and thus the timeout error. Updating from the latest version forward should work as expected. A possible work without doing a manual upgrade/replace would to downgrade to the older updater and then upgrade to the latest version.

When running version 2020.10.0 run these commands:

cloudflared update --version=2020.9.3 --force
cloudflared update

This will force a downgrade to version 2020.9.3 with the old updater that will then update to the latest version 2020.11.3

@KommX
Copy link
Author

KommX commented Nov 11, 2020

@daltoniam
Unfortunately the downgrade doesn't work either.

sudo cloudflared update --version=2020.9.3 --force

INFO[2020-11-11T20:42:19+01:00] cloudflared is set to upgrade to the latest publish version regardless of the current version
failed to update cloudflared: context deadline exceeded (Client.Timeout or context cancellation while reading body)

@tommetje
Copy link

@ferferga After running the update command, currently I am told that cloudflared is up to date.

I have a 1000mbit connection and I too got the timeout error message before I re-installed cloudflared, the timeout must have been set very short 😃

@ferferga
Copy link

@daltoniam Pulling the latest release from GitHub and checking for updates worked great! Thank you very much!

@KommX You musy grab the latets release from the releases tab and replace it in your system.

@peloncano
Copy link

OK, fixed it. Well, more specifically, they fixed it...

This is how:

Roll back cloudflared to an older, stable, version:
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz
sudo systemctl stop cloudflared
sudo cp ./cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
sudo systemctl start cloudflared
cloudflared -v

Then update cloudflared (to 2020.10.2):
sudo cloudflared update
sudo systemctl restart cloudflared

Run the update command again, and you should get a sensible response about cloudflared being up to date

This worked well for me. Thanks.

@tamhamilton
Copy link

The forced downgrade mentioned by @daltoniam didn't work for me either, attempting to go from 2020.10.2 to 2020.11.3, and the straight update also failed. However the steps I used previously worked a charm, again. Hopefully 2020.11.3 has cleared up the issue finally.

@tamhamilton
Copy link

Successfully updated cloudflared to 2020.11.4 from 2020.11.3 using the automatic updater; seems like the fix in .3 is functional!

@tommetje
Copy link

Same here, thanks for the fix!

@KommX
Copy link
Author

KommX commented Nov 13, 2020

@KommX You musy grab the latets release from the releases tab and replace it in your system.

I understand that this would be a workaround. But as I stated before, that's not a proper fix, since all the affected people out there would have to have knowledge about this workaround.

@tamhamilton
Copy link

Still intermittently getting this issue, actually. Just updated to 2020.11.10 successfully now, but was getting the error earlier today with 2020.11.9. Is it just 'internet weather'?

@t-reyerf
Copy link

t-reyerf commented Jan 3, 2021

OK, fixed it. Well, more specifically, they fixed it...

This is how:

Roll back cloudflared to an older, stable, version:
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz
sudo systemctl stop cloudflared
sudo cp ./cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
sudo systemctl start cloudflared
cloudflared -v

Then update cloudflared (to 2020.10.2):
sudo cloudflared update
sudo systemctl restart cloudflared

Run the update command again, and you should get a sensible response about cloudflared being up to date

I stumbled about this error because i had to restart my local dns resolver and cloudflared stoped working after that.

If you find yourself in the situation that you are running an older version on Debian/Ubuntu, you can use the following to get things going again:

wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.deb
sudo systemctl stop cloudflared
dpkg -i cloudflared-stable-linux-amd64.deb
sudo systemctl start cloudflared

I was raised to V2020-12 after that and everything is working now again.

@DFlexy
Copy link

DFlexy commented Mar 21, 2021

Same problem here need help

cloudflared version 2021.3.1 (built 2021-03-15-1925 UTC)

Mar 21 14:54:32 raspberrypi cloudflared[516]: 2021-03-21T17:54:32Z ERR failed to connect to an HTTPS backend "https://94.140.15.15/dns-query" error="failed to perform an HTTPS request: Post "https://94.140.15.15/dns-query\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
Mar 21 14:54:32 raspberrypi cloudflared[516]: 2021-03-21T17:54:32Z ERR failed to connect to an HTTPS backend "https://9.9.9.9/dns-query" error="failed to perform an HTTPS request: Post "https://9.9.9.9/dns-query\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Mar 21 14:54:32 raspberrypi cloudflared[516]: 2021-03-21T17:54:32Z ERR failed to connect to an HTTPS backend "https://9.9.9.9/dns-query" error="failed to perform an HTTPS request: Post "https://9.9.9.9/dns-query\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
Mar 21 14:54:32 raspberrypi cloudflared[516]: 2021-03-21T17:54:32Z ERR failed to connect to an HTTPS backend "https://9.9.9.9/dns-query" error="failed to perform an HTTPS request: Post "https://9.9.9.9/dns-query\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Mar 21 14:54:32 raspberrypi cloudflared[516]: 2021-03-21T17:54:32Z ERR failed to connect to an HTTPS backend "https://9.9.9.9/dns-query" error="failed to perform an HTTPS request: Post "https://9.9.9.9/dns-query\": context deadline exceeded"
Mar 21 14:54:32 raspberrypi cloudflared[516]: 2021-03-21T17:54:32Z ERR failed to connect to an HTTPS backend "https://9.9.9.9/dns-query" error="failed to perform an HTTPS request: Post "https://9.9.9.9/dns-query\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Mar 21 14:54:32 raspberrypi cloudflared[516]: 2021-03-21T17:54:32Z ERR failed to connect to an HTTPS backend "https://9.9.9.9/dns-query" error="failed to perform an HTTPS request: Post "https://9.9.9.9/dns-query\": context deadline exceeded"
Mar 21 14:54:32 raspberrypi cloudflared[516]: 2021-03-21T17:54:32Z ERR failed to connect to an HTTPS backend "https://9.9.9.9/dns-query" error="failed to perform an HTTPS request: Post "https://9.9.9.9/dns-query\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Mar 21 14:54:33 raspberrypi cloudflared[516]: 2021-03-21T17:54:33Z ERR failed to connect to an HTTPS backend "https://94.140.15.15/dns-query" error="failed to perform an HTTPS request: Post "https://94.140.15.15/dns-query\": context deadline exceeded"
Mar 21 14:54:33 raspberrypi cloudflared[516]: 2021-03-21T17:54:33Z ERR failed to connect to an HTTPS backend "https://94.140.15.15/dns-query" error="failed to perform an HTTPS request: Post "https://94.140.15.15/dns-query\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"

@tamhamilton
Copy link

What version of cloudflared are you running? There are a couple of workarounds further up this thread...

@ferferga
Copy link

@DFlexy This issue is for that message appearing while running cloudflare update, which is not the exact same circumstance that you're having.

You will probably have better luck opening a new issue for that, as this is completely unrelated to the original issue.

@ouwenxxing
Copy link

I think there's no issues for the cloudflared itself but the upstream server. You can chose the DOH server regionally.
I tried alidns and it works fine me.
--upstream https://dns.alidns.com/dns-query

@abelinkinbio abelinkinbio added Priority: Deferred Issue has been placed in backlog and removed pihole labels Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Deferred Issue has been placed in backlog
Projects
None yet
Development

No branches or pull requests