Skip to content

restic hangs on "Access Denied" #5683

@fkusche

Description

@fkusche

Output of restic version

restic 0.18.1 compiled with go1.25.1 on linux/amd64

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

IONOS S3

Problem description / Steps to reproduce

For some reason my S3 provider sometimes answers requests with "Access Denied" instead of something more suitable like "Service not available" (sorry, I don't have the HTTP status numbers). Sometimes (normally?), restic just quits in that case with an error. However, it seems that it hangs when this happens during refreshment of a lock.

Command line:

RESTIC_PROGRESS_FPS=0.016666
/usr/local/bin/restic backup --compression max --limit-upload 5000 --json -v --no-scan --tag=lexware --stdin-filename lexware.raw --stdin-from-command -- /usr/bin/dd if=/dev/zd0 bs=1M status=none

stderr:

Save(<data/8a931060d5>) failed: client.PutObject: Access Denied
Save(<lock/e8ee2874cb>) failed: client.PutObject: Access Denied
unable to refresh lock: client.PutObject: Access Denied
^[[2Ksignal terminated received, cleaning up
{"message_type":"exit_error","code":1,"message":"Fatal: unable to save snapshot: client.PutObject: Access Denied"}

(this is the complete stderr output of the process)

stdout:

{"message_type":"status","seconds_elapsed":2040,"percent_done":0,"bytes_done":36750905076,"current_files":["/lexware.raw"]}
{"message_type":"status","seconds_elapsed":2100,"percent_done":0,"bytes_done":42268325309,"current_files":["/lexware.raw"]}
{"message_type":"status","seconds_elapsed":2160,"percent_done":0,"bytes_done":47079060936,"current_files":["/lexware.raw"]}
{"message_type":"status","seconds_elapsed":2220,"percent_done":0,"bytes_done":49900395805,"current_files":["/lexware.raw"]}
{"message_type":"status","seconds_elapsed":2280,"percent_done":0,"bytes_done":49900395805,"current_files":["/lexware.raw"]}
{"message_type":"status","seconds_elapsed":2340,"percent_done":0,"bytes_done":49900395805,"current_files":["/lexware.raw"]}

Note that from seconds_elapsed = 2220, the bytes_done did not increase anymore. The process hangs for hours until my script kills it with signal 15. Then, a proper cleanup is done. (Normally - in the meantime - the S3 service works again. So when getting SIGTERM, restic is able to correctly remove all its lock files.)

Expected behavior

When an Access Denied error occurs, restic should exit immediately (after trying to clean up locks), because this is something where a retry will not help and must be resolved by the administrator. (Well, in my case, a retry would help, but we should not work around provider bugs here.)

Actual behavior

restic hangs until signal 15. see above

Do you have any idea what may have caused this?

nothing specific

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

restic helps me already for years. Please keep up the good work!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions