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

Expose more connection parameters to users + define reasonable defaults #981

Open
johansmitsnl opened this issue Dec 31, 2023 · 7 comments
Labels
A-backends Area: Related to backends in `rustic-core` A-config Area: Related to the config file functionality and format A-core Area: Generally related to `rustic_core` A-docs Area: Improvements or additions to documentation A-ui-ux Area: Related to user interfaces and user experience C-enhancement Category: New feature or request

Comments

@johansmitsnl
Copy link

johansmitsnl commented Dec 31, 2023

I'm restoring files from the backup (rclone+sftp). Sometimes it panics:

[INFO] total restore size: 2.3 GiB
[00:01:16] restoring file contents...     ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  11.99 MiB/2.35 GiB   49.92 KiB/s  (ETA 4h)The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: RusticError(Rest(BackoffError(Permanent(reqwest::Error { kind: Status(404), url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(33267), path: "/data/2718a0219090412984e200b92c7a6079952db0f3e677127e0de31b6c31f31116", query: None, fragment: None } }))))
Location: /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustic_core-0.1.2/src/commands/restore.rs:496

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  <empty backtrace>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
fish: Job 1, 'env RUST_BACKTRACE=full rustic …' terminated by signal SIGABRT (Abort)

It is making to much connections. Running with debug:

[INFO] rclone output: <7>DEBUG : pacer: low level retry 10/10 (error couldn't initialise SFTP: ssh: subsystem request failed)

[INFO] rclone output: <7>DEBUG : data/29/2952ec748c8d6a0549af7d2e9b95075cdc212dc35f9c74ea1fc63d23db596c35: GET request error: stat failed: stat: couldn't initialise SFTP: ssh: subsystem request failed
@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Dec 31, 2023
@johansmitsnl
Copy link
Author

I did some searching and it is making to much connections. I see there is a default constant of 20 defined in the core lib src/commands/restore.rs. Reducing it to less then 10 (in my Hetzner case) makes it work perfect.

Can this made an option so that you can steer the amount of readers you can support? I also found #61 and #72. So this is related.

@simonsan simonsan changed the title Panic during restore Expose more connection parameters to users + define reasonable defaults Jan 1, 2024
@simonsan simonsan added A-docs Area: Improvements or additions to documentation C-enhancement Category: New feature or request A-backends Area: Related to backends in `rustic-core` A-core Area: Generally related to `rustic_core` A-ui-ux Area: Related to user interfaces and user experience A-config Area: Related to the config file functionality and format and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Jan 1, 2024
@jvandenbroek
Copy link

I have the same problem, also rclone+sftp with Hetzner:

Message:  called `Result::unwrap()` on an `Err` value: backoff failed: Permanent(reqwest::Error { kind: Sta
tus(404), url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4
(127.0.0.1)), port: Some(36595), path: "/data/6f31da73b4a59d23778f734df05c1a58a5fa697569486fb0f6d9b2d08c999
d9b", query: None, fragment: None } })                                                                     
                                                                                                           
Caused by:                                                                                                 
    HTTP status client error (404 Not Found) for url (http://127.0.0.1:36595/data/6f31da73b4a59d23778f734df
05c1a58a5fa697569486fb0f6d9b2d08c999d9b) 

While I agree the number of connections / threads should be configurable, I don't think it should panic on such occurrence. Instead I'd expect it to temporary back off and try again later.

@simonsan simonsan added the A-errors Area: error handling needs improvement label Feb 10, 2024
@aawsome aawsome removed the A-errors Area: error handling needs improvement label Feb 10, 2024
@aawsome
Copy link
Member

aawsome commented Feb 10, 2024

I removed the error label because the abort is a different story (and I think it wouldn't help you to let rustic just gracefully exit in this case).

The main problem is that rclone does return a permanent http error code in some cases where the error might be non-permanent.

We could add a configuration which allows rustic to retry for permanent errors - this IMO is a feature request. Better would be to open a rclone issue to ask if they can treat this case better.

Did you try rustic 0.7.0 and sftp using opendal, see https://github.com/rustic-rs/rustic/blob/main/config/services/sftp_hetzner_sbox.toml? This circumvents the rclone issue.

@simonsan
Copy link
Contributor

rustic-rs/rustic_core#155 starts to implement some logic regarding that topic, but only for the OpenDAL-supported backends.

github-merge-queue bot pushed a commit to rustic-rs/rustic_core that referenced this issue Mar 9, 2024
CC: rustic-rs/rustic#981

Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
@k9withabone
Copy link

For the opendal backend, it would also be nice to be able to set a bandwidth limit via a ThrottleLayer. That's the only thing that's stopping me from using the opendal backend instead of the rclone one.

@aawsome
Copy link
Member

aawsome commented May 7, 2024

@k9withabone has been implemented in rustic-rs/rustic_core#216 (and should be available in the next nightly build)

@k9withabone
Copy link

Thanks! I'll test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backends Area: Related to backends in `rustic-core` A-config Area: Related to the config file functionality and format A-core Area: Generally related to `rustic_core` A-docs Area: Improvements or additions to documentation A-ui-ux Area: Related to user interfaces and user experience C-enhancement Category: New feature or request
Projects
Status: Todo
Development

No branches or pull requests

5 participants