Long timeouts in restic and resticprofile when using restic-server

Posted by ads on Wednesday, 2026-10-21
Posted in [Backup][Restic]

At home I have a restic-server running, which serves as one of the backup destinations for backups (among several other destinations). Over time I found that there is a small problem in this setup: when I am traveling, the backup kicks off - and needs a long time to finish when the repository is not available. The backup process runs into long timeouts, and on top of that, restic keeps the laptop from going to sleep.

Default settings

Turns out, the defaults for the timeouts are quite high. According to the fine documentation, the stuck-request-timeout setting is 5 minutes.

But that’s not all! backend_retry.go has retry logic which exponentially attempts to retry several times, up to 15 minutes or so.

There is no easy way to get the current default settings, some of this is hard-coded and only available in the code, not in the config.

What’s happening

If the 15 minutes wait time per repository is good is really a personal question everyone has to answer for themselves.

In my case, with several repositories, that’s about 3 hours of waiting - if my laptop is not connected to my home network. During the three hours, the laptop won’t go to sleep.

What is usually happening, and how I found out:

  • Laptop sits in the hotel on the desk
  • It’s open over night
  • In the morning I want to close it and place in my backpack
  • The laptop does not go to sleep, but stays awake

Which by itself is not a big deal. There’s a NVram disk, no spinning rust. Nothing really breaks if I carry it while the device is awake. But somehow rectis also consumes a lot of CPU cycles just trying to reach the repository. That heats up my backpack, and drains the battery.

The “fix”

In my case, 30 seconds to one minute per repository is more than enough. Since I use resticprofile, I added the stuck-request-timeout directly in the config template:

1
2
3
[global]
  [default.flags]
    stuck-request-timeout = "30s"

Deploy the config, and next time the backup will “finish” (well, fail, but that’s expected) a lot faster.

I also verify that the config is parsed correctly:

1
2
resticprofile -c /etc/resticprofile/resticprofile-restic-home.conf --verbose --name="root" show | grep stuck
    flags:                   stuck-request-timeout:30s

Categories: [Backup] [Restic]

Comments

With an account on the Fediverse or Mastodon, you can respond to this post. Known replies are displayed below:



Note: This will load data from mastodon.social.

Learn how this is implemented here.


Share: