[Solved] Systematic `context deadline exceeded` when updated to Duplicacy 3

TLDR

If you’re getting a context deadline exceeded error when backing up to a Swift storage, add timeout=1000 to the url.

Context

I recently updated my backup setup and realized that I was way behind with Duplicacy. I updated from 2.7.2 to 3.2.3 and now I keep getting context deadline exceeded errors while trying to backup to my OpenStack Swift v3. Those are mostly Failed to upload chunk, but I also get the occasional Failed to fossilize the chunk.

From what I gathered on the forum, this error is not common and is mostly due to connectivity issue. Yet, I never had this error before and I didn’t change anything but duplicacy’s version. I have a stable, 1Gb/s fiber connection and didn’t change anything on my router either.

When the backup fails because of the error, I re-run in right away and a few more chunks are uploaded before it fails again. I am able to do that until the backup is complete but I don’t thing that’s a viable solution long term.

Solution

context deadline exceeded is a generic Go error that means that something is taking too long and has been aborted. Looking at the code for the Swift backend (maybe there was an easier way to find that information), I saw that I could specify a timeout argument in the url of the storage, for it to be parsed and override the default of 60 (s?) given to the context (whatever that context does). I put 1000 just to put a big number and now I don’t get this error anymore. My storage url looks like this:

swift://username@swiftstorage.example.com/identity/v3/default/duplicacy?tenant=usr_or_project&domain=default&timeout=1000"

I couldn’t find this solution anywhere else so I’m sharing it here in case it’s useful for anyone.

edit: the option is indeed listed in the parameters of the storage backend, but the error is not obviously connected in my opinion