borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
11.19k stars 742 forks source link

Borg does not recover nor quit from connection loss to backend (SFTP backend) #8430

Open mirko opened 1 month ago

mirko commented 1 month ago

When closing my notebook and hence disconnecting it from network while borg backing up to an SFTP backend - and reopen it later, the process neither continues nor quits, despite the connection being gone.

Hitting CTRL+C does/triggers something - but does not quit the process - resulting in a hanging borg proces no matter what I do.

[..]
[chan 0] open(b'/storage/backup_mirko/borg2/data/86/99/mmuqcisp.tmp', 'w') -> 00000000
^C[chan 0] close(00000000)
^Csecurity: saving state for af454f273bbaec6891b7971f6d40101f96a09516ec1040d022efe64a5a5725bd to /root/.local/share/borg/security/af454f273bbaec6891b7971f6d40101f96a09516ec1040d022efe64a5a5725bd
security: current location   ssh://HOST/storage/backup_mirko/borg2
security: key type           64
security: manifest timestamp 2024-09-24T23:34:31.915399+00:00
^C^C^C^C^Cwriting chunks index 16c35a2c72ae5df6 to cache/chunks in repo...
[chan 0] stat(b'/storage/backup_mirko/borg2/cache/chunks')

^C^C^C^C^C[chan 0] Unhandled channel request "keepalive@openssh.com"
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C[chan 0] Unhandled channel request "keepalive@openssh.com"
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^
ThomasWaldmann commented 1 month ago

Looks like it tries to save the chunks index to the repo (that is in the context manager exit of the cache), which then also hangs due to the hanging connection.

Weird that ^C^C doesn't terminate.