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

restic with rclone using MEGZ.nz - net/http: request canceled (Client.Timeout exceeded while awaiting headers) #3511

Closed
phcreery opened this issue Sep 13, 2021 · 0 comments · Fixed by #3514

Comments

@phcreery
Copy link
Contributor

phcreery commented Sep 13, 2021

The output of restic version

$ restic version
restic 0.9.4 compiled with go1.11.6 on linux/amd64
~$ rclone version
rclone v1.56.0
- os/version: debian 10.10 (64 bit)
- os/kernel: 5.10.0-0.bpo.7-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.16.5
- go/linking: static
- go/tags: none

How did you run restic exactly?

$ sudo restic -r rclone:mega:/folder_rclone_restic --verbose backup /folder_to_backup
open repository

or even

$ sudo restic -r rclone:mega:/folder_rclone_restic  -o rclone.args="serve restic --stdio --b2-hard-delete --contimeout 5m --timeout 5m --expect-continue-timeout 5m --verbose" --verbose backup /folder_to_backup
open repository

results in

Fatal: unable to open repo at rclone:mega:/folder_rclone_restic: error talking HTTP to rclone: Get http://localhost/file-5577006791947779410: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

What backend/server/service did you use to store the repository?

internal rclone serve and MEGA.nz

Expected behavior

Proper backup

Actual behavior

I got a timeout error (which I was half expecting). Mega is notorious for being slow upon loading up its website, especially with large amounts of data. (In my case, ~2TB). Their website usually hangs at a "Loading" or "Decrypting" screen for 2 mins before showing my files.

Steps to reproduce the behavior

Do a restic -r rclone:mega:/ backup / (successfully backing up 2TB)
Attempt again with the SAME command. (Timeout)

Do you have any idea what may have caused this?

Doing a google search of net/http: request canceled (Client.Timeout exceeded while awaiting headers) brings up a lot of info about the net/http go lib, so it can be rclone (written in go) or restic (also go)
I did a

$ rclone serve restic -v mega:/folder_rclone_restic
2021/09/12 20:16:03 NOTICE: mega root 'folder_rclone_restic': Serving restic REST API on http://localhost:8080/

though it takes a minute, it seemed to have no issues. That rules our rclone.

Looking at restic, I think it is this line here : Line 222 of https://github.com/restic/restic/blob/master/internal/backend/rclone/backend.go

	// send an HTTP request to the base URL, see if the server is there
	client := &http.Client{
		Transport: debug.RoundTripper(tr),
		Timeout:   60 * time.Second,
	}

Only allowing a 60-second timeout.

Do you have an idea how to solve the issue?

Allow for a CLI argument to override the 60s?

Did restic help you today? Did it make you happy in any way?

Yes, by far the fastest and best backup solution out of the multiple I have tested.
I would love to contribute but I know nothing about go and am far too busy to learn it at the moment.
If you'd like, I could test a compiled binary with the proposed changes that should fix this issue. Heck, I will add it to the docs too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant