Issues with Restic Snapshot Removal and Pruning

I have a script that automates the backup of a specific folder on my server using Restic, which saves the backups to OneDrive. This workflow has functioned smoothly for the past year. However, in the last few days, I’ve been experiencing issues with Restic when trying to remove and prune snapshots. I would appreciate any guidance on how to resolve this issue.

The script performs the following tasks:

  1. Backups the specified folder.
  2. Removes snapshots (the full command is provided below).
  3. Checks the repository for errors.

OS Information

OS: Debian GNU/Linux 11 (bullseye) aarch64
Kernel: 6.1.31-v8+

Restic Version

restic 0.17.2 compiled with go1.23.2 on linux/arm64

Rclone Version

rclone v1.68.1
- os/version: raspbian 11.11 (64 bit)
- os/kernel: 6.1.31-v8+ (aarch64)
- os/type: linux
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.23.1
- go/linking: static
- go/tags: none

The Restic command that failed to complete.

restic -r "myrepo" forget \
	--verbose \
	--password-file "secretfile" \
	--tag myrepo \
	--prune \
	--group-by host,tags \
	--keep-daily 8 \
	--keep-weekly 5 \
	--keep-monthly 13 \
	--keep-yearly 4 \
	>> "mylog.log" 2>&1

Errors

[0:00] 100.00%  1 / 1 files deleted
1 snapshots have been removed, running prune
loading indexes...
loading all snapshots...
finding data that is still in use for 23 snapshots
[0:00] 100.00%  23 / 23 snapshots
searching used packs...
collecting packs for deletion and repacking
[0:09] 100.00%  1750 / 1750 packs processed

used:              47677 blobs / 25.729 GiB
unused:             5326 blobs / 1.735 GiB
total:             53003 blobs / 27.464 GiB
unused size: 6.32% of total size

to repack:          1923 blobs / 444.324 MiB
this removes:        763 blobs / 275.512 MiB
to delete:           180 blobs / 115.567 MiB
total prune:         943 blobs / 391.080 MiB
remaining:         52060 blobs / 27.082 GiB
unused size after prune: 1.353 GiB (5.00% of remaining size)

totally used packs:        904
partly used packs:         839
unused packs:                7

to keep:            1714 packs
to repack:            29 packs
to delete:             7 packs
repacking packs
Load(<data/55d725cb28>, 1607840, 9341463) failed: <data/55d725cb28> does not exist
rclone: 2024/11/03 04:02:21 ERROR : data/e5/e5d329df3a921473ebee5beb38edb69b92b02eaa74d7b80a11a565013e1b6034: Didn't finish writing GET request (wrote 3117056/9802011 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/e5d329df3a>, 9802011, 0) returned error, retrying after 914.441421ms: unexpected EOF
rclone: 2024/11/03 04:02:21 NOTICE: data/90/90eefd9753c7ef9e36b41e34450e3bfbfa4d672ac97990fdd3a7bd0f996de730: Failed to cancel multipart upload: unauthenticated: Unauthenticated (upload failed due to: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close)
rclone: 2024/11/03 04:02:21 ERROR : data/90/90eefd9753c7ef9e36b41e34450e3bfbfa4d672ac97990fdd3a7bd0f996de730: Post request put error: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close
rclone: 2024/11/03 04:02:21 ERROR : data/90/90eefd9753c7ef9e36b41e34450e3bfbfa4d672ac97990fdd3a7bd0f996de730: Post request rcat error: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close
Save(<data/90eefd9753>) returned error, retrying after 1.080089364s: unexpected HTTP response (500): 500 Internal Server Error
Load(<data/e5d329df3a>, 9802011, 0) operation successful after 1 retries
rclone: 2024/11/03 04:02:26 ERROR : data/97/976fdcd577e50580698fb315b97e49dd371a66f1cc9f47d679d7f3849b7eaf6b: Didn't finish writing GET request (wrote 282624/4850402 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/976fdcd577>, 4850402, 12319648) returned error, retrying after 1.1560658s: unexpected EOF
Load(<data/47a3f12faa>, 33113, 9759841) failed: <data/47a3f12faa> does not exist
Load(<data/55d725cb28>, 180461, 9952618) failed: <data/55d725cb28> does not exist
Load(<data/55d725cb28>, 180461, 9952618) failed: <data/55d725cb28> does not exist
rclone: 2024/11/03 04:02:26 ERROR : data/e5/e5d329df3a921473ebee5beb38edb69b92b02eaa74d7b80a11a565013e1b6034: Didn't finish writing GET request (wrote 315392/5374892 bytes): http2: stream closed
[0:15] 34.48%  10 / 29 packs repacked
rclone: 2024/11/03 04:02:26 ERROR : data/d6/d6b543eb5df1374945d2f0e802f7e1765f948997e3aeb55434b06d380537aea0: Post request put error: Post "https://graph.microsoft.com/v1.0/drives/80CF088D41A1A034/items/80CF088D41A1A034!20682:/d6b543eb5df1374945d2f0e802f7e1765f948997e3aeb55434b06d380537aea0:/createUploadSession": context canceled
rclone: 2024/11/03 04:02:26 ERROR : data/d6/d6b543eb5df1374945d2f0e802f7e1765f948997e3aeb55434b06d380537aea0: Post request rcat error: Post "https://graph.microsoft.com/v1.0/drives/80CF088D41A1A034/items/80CF088D41A1A034!20682:/d6b543eb5df1374945d2f0e802f7e1765f948997e3aeb55434b06d380537aea0:/createUploadSession": context canceled
rclone: 2024/11/03 04:02:26 NOTICE: data/90/90eefd9753c7ef9e36b41e34450e3bfbfa4d672ac97990fdd3a7bd0f996de730: Failed to cancel multipart upload: Delete "https://my.microsoftpersonalcontent.com/bla bla bla": context canceled (upload failed due to: Put "https://my.microsoftpersonalcontent.com/bla bla bla": context canceled)
rclone: 2024/11/03 04:02:26 ERROR : data/90/90eefd9753c7ef9e36b41e34450e3bfbfa4d672ac97990fdd3a7bd0f996de730: Post request put error: Put "https://my.microsoftpersonalcontent.com/bla bla bla": context canceled
rclone: 2024/11/03 04:02:26 ERROR : data/90/90eefd9753c7ef9e36b41e34450e3bfbfa4d672ac97990fdd3a7bd0f996de730: Post request rcat error: Put "https://my.microsoftpersonalcontent.com/bla bla bla": context canceled
Fatal: StreamPack: ReadFull(<data/55d725cb28>): <data/55d725cb28> does not exist

I ran several commands to identify potential corruption or other issues with the repository stored in OneDrive. Based on the recommendations from the restic check command, I attempted a restic prune. Although the command completed, it returned numerous errors. However, a subsequent restic check showed no errors. I’m still seeking guidance, as I’m concerned about potential data loss

restic -r “myrepo” check --read-data --password-file “secret.file”

restic -r "myrepo" check --read-data --password-file "secret.file"
using temporary cache in /tmp/restic-check-cache-2995416811
create exclusive lock for repository
repository 36ceec1e opened (version 2, compression level auto)
created new cache in /tmp/restic-check-cache-2995416811
load indexes
[0:01] 100.00%  3 / 3 index files loaded
check all packs
2 additional files were found in the repo, which likely contain duplicate data.
This is non-critical, you can run `restic prune` to correct this.
check snapshots, trees and blobs
[0:05] 100.00%  23 / 23 snapshots
read all data
[34:36] 100.00%  1750 / 1750 packs
no errors were found

restic -r “myrepo” prune --password-file “secret.file”

repository 36ceec1e opened (version 2, compression level auto)
loading indexes...
[0:00] 100.00%  3 / 3 index files loaded
loading all snapshots...
finding data that is still in use for 23 snapshots
[0:00] 100.00%  23 / 23 snapshots
searching used packs...
collecting packs for deletion and repacking
[0:08] 100.00%  1750 / 1750 packs processed

to repack:          1923 blobs / 444.324 MiB
this removes:        763 blobs / 275.512 MiB
to delete:           180 blobs / 150.074 MiB
total prune:         943 blobs / 425.586 MiB
remaining:         52060 blobs / 27.082 GiB
unused size after prune: 1.353 GiB (5.00% of remaining size)

deleting unreferenced packs
[0:00] 100.00%  2 / 2 files deleted
repacking packs
rclone: 2024/11/03 06:27:06 ERROR : data/47/479d173faebba35fdd76b9c78dc32d8c0ceb85ff373b66e5a0ecef221aaa0279: Didn't finish writing GET request (wrote 8400896/14767765 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/479d173fae>, 14767765, 0) returned error, retrying after 727.570925ms: unexpected EOF
rclone: 2024/11/03 06:27:06 ERROR : data/47/47a3f12faa6fc17f8d865427f2dfcac0804acd2dba49bc51830354cac020a489: Didn't finish writing GET request (wrote 512000/937867 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/47a3f12faa>, 937867, 0) returned error, retrying after 797.210878ms: unexpected EOF
Load(<data/47a3f12faa>, 937867, 0) operation successful after 1 retries
Load(<data/479d173fae>, 14767765, 0) operation successful after 1 retries
Load(<data/69141b87f2>, 5295667, 1934338) failed: <data/69141b87f2> does not exist
rclone: 2024/11/03 06:27:16 ERROR : data/48/48cd6e2ab9b2edbb57ecfc71e7ed3ee9182b75d50bf31a57b4f0546a9c1320b2: Didn't finish writing GET request (wrote 12288/8963604 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/48cd6e2ab9>, 8963604, 8087262) returned error, retrying after 1.092152595s: unexpected EOF
rclone: 2024/11/03 06:27:16 ERROR : data/f9/f918bbba0c8068a3f6fc8f831ff367180196597176f2e1ef30f9f58a9085e85b: Didn't finish writing GET request (wrote 331776/3118960 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/f918bbba0c>, 3118960, 233976) returned error, retrying after 657.952186ms: unexpected EOF
rclone: 2024/11/03 06:27:16 NOTICE: data/1e/1e3b09fff47ba6c09cd0aa72da1985b55ab5894d3cb7d2f40a9c1e4c879417de: Failed to cancel multipart upload: unauthenticated: Unauthenticated (upload failed due to: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close)
rclone: 2024/11/03 06:27:16 ERROR : data/1e/1e3b09fff47ba6c09cd0aa72da1985b55ab5894d3cb7d2f40a9c1e4c879417de: Post request put error: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close
rclone: 2024/11/03 06:27:16 ERROR : data/1e/1e3b09fff47ba6c09cd0aa72da1985b55ab5894d3cb7d2f40a9c1e4c879417de: Post request rcat error: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close
Save(<data/1e3b09fff4>) returned error, retrying after 1.336366804s: unexpected HTTP response (500): 500 Internal Server Error
Load(<data/f918bbba0c>, 3118960, 233976) failed: <data/f918bbba0c> does not exist
Load(<data/48cd6e2ab9>, 8963604, 8087262) failed: <data/48cd6e2ab9> does not exist
rclone: 2024/11/03 06:27:19 ERROR : data/3e/3ef95d420543a62aeb036d14cf6d3038aec2eacd19aca3f4f7299ddad8742812: Didn't finish writing GET request (wrote 8130560/8747795 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/3ef95d4205>, 8747795, 248910) returned error, retrying after 990.6331ms: unexpected EOF
rclone: 2024/11/03 06:27:19 NOTICE: data/c6/c604653b1a93c1b6967a4fef27fd85b3474370eefc820070055236ae28fab078: Failed to cancel multipart upload: unauthenticated: Unauthenticated (upload failed due to: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close)
rclone: 2024/11/03 06:27:19 ERROR : data/c6/c604653b1a93c1b6967a4fef27fd85b3474370eefc820070055236ae28fab078: Post request put error: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close
rclone: 2024/11/03 06:27:19 ERROR : data/c6/c604653b1a93c1b6967a4fef27fd85b3474370eefc820070055236ae28fab078: Post request rcat error: Put "https://my.microsoftpersonalcontent.com/bla bla bla": http2: client connection force closed via ClientConn.Close
Save(<data/c604653b1a>) returned error, retrying after 629.705899ms: unexpected HTTP response (500): 500 Internal Server Error
Save(<data/1e3b09fff4>) operation successful after 1 retries
rclone: 2024/11/03 06:27:21 ERROR : data/3e/3ef95d420543a62aeb036d14cf6d3038aec2eacd19aca3f4f7299ddad8742812: Didn't finish writing GET request (wrote 1191936/8747795 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/69141b87f2>, 1604871, 2827642) failed: <data/69141b87f2> does not exist
Load(<data/48cd6e2ab9>, 479888, 8087262) failed: <data/48cd6e2ab9> does not exist
Load(<data/48cd6e2ab9>, 479888, 8087262) failed: <data/48cd6e2ab9> does not exist
Load(<data/f918bbba0c>, 831506, 233976) failed: <data/f918bbba0c> does not exist
Load(<data/48cd6e2ab9>, 479888, 8087262) failed: <data/48cd6e2ab9> does not exist
Load(<data/f918bbba0c>, 831506, 233976) failed: <data/f918bbba0c> does not exist
Load(<data/3ef95d4205>, 8747795, 248910) returned error, retrying after 1.66410802s: unexpected EOF
Save(<data/c604653b1a>) operation successful after 1 retries
Load(<data/3ef95d4205>, 8747795, 248910) operation successful after 2 retries
Load(<data/f918bbba0c>, 1047722, 1065482) failed: <data/f918bbba0c> does not exist
rclone: 2024/11/03 06:27:25 ERROR : data/69/69141b87f2789ffaf7f0d84d18dafa1d038f4bdbf38da1620eee506b4ad17d3f: Didn't finish writing GET request (wrote 290816/1604871 bytes): http2: client connection force closed via ClientConn.Close
Load(<data/3ef95d4205>, 4733032, 10296721) failed: <data/3ef95d4205> does not exist
Load(<data/69141b87f2>, 1604871, 2827642) returned error, retrying after 943.876191ms: unexpected EOF
Load(<data/69141b87f2>, 1604871, 2827642) operation successful after 1 retries
[1:11] 100.00%  29 / 29 packs repacked
rebuilding index
[0:05] 100.00%  4 / 4 indexes processed
[0:00] 100.00%  4 / 4 old indexes deleted
removing 36 old packs
[0:01] 100.00%  36 / 36 files deleted
done

restic -r “myrepo” check --password-file “secret.file”

using temporary cache in /tmp/restic-check-cache-658959472
create exclusive lock for repository
repository 36ceec1e opened (version 2, compression level auto)
created new cache in /tmp/restic-check-cache-658959472
load indexes
[0:01] 100.00%  2 / 2 index files loaded
check all packs
check snapshots, trees and blobs
[0:06] 100.00%  23 / 23 snapshots
no errors were found

If prune or check complete successfully, then all temporary errors during the operation could be retried successfully. That means that your backup is fine.

There are a few other OneDrive users in the forum maybe the can chine in regarding the OneDrive errors?