Timeshift-autosnap deleted all previous snapshots

With my update today, all previous timeshift-autosnap snapshot have been deleted and I don’t know why. I have checked whether something messed with my configuration file, but /etc/timeshift-autosnap.conf still contains maxSnapshots=9. Does anyone else have an issue with this?

I do not think the snapshots were deleted by Timeshift, but Timeshift lost all snapshots in the list after some accident. You can check sudo btrfs subvolume list -p / , if the snapshots are already existed.

What is the default level of subvolume sudo btrfs subvolume get-default / ?

1 Like

They were deleted one after the other during the update process, clearly stating every single one and that it was currently being deleted. The snapshots are also indeed gone in the list of subvolumes.

Since then, two new autosnapshots were created and I have not seen a deletion of those yet. So hopefully this was just a dubious one-off occurrence…

> sudo btrfs subvolume get-default /
ID 5 (FS_TREE)

I’ve checked /var/log/pacman.log, these are the corresponding log entries:

[2022-03-05T00:37:30] [ALPM-SCRIPTLET] Detecting snapshots ...
[2022-03-05T00:37:31] [ALPM-SCRIPTLET] Found snapshot: 2022-03-05 00:37:25 | timeshift-btrfs/snapshots/2022-03-05_00-37-25/@ | ondemand | {timeshift-autosnap} {created before upgrade} |
...[other snapshots]
[2022-03-05T00:37:31] [ALPM-SCRIPTLET] Found snapshot: 2022-02-24 11:59:55 | timeshift-btrfs/snapshots/2022-02-24_11-59-55/@ | ondemand | {timeshift-autosnap} {created before upgrade} |
[2022-03-05T00:37:31] [ALPM-SCRIPTLET] Found 9 snapshot(s)
...[Timestamps abbreviated for better legibility]
[17:49:13] [ALPM] running '00-timeshift-autosnap.hook'...
[17:49:14] [ALPM-SCRIPTLET] Using system disk as snapshot device for creating snapshots in BTRFS mode
[17:49:14] [ALPM-SCRIPTLET] Mounted '/dev/dm-0 (nvme0n1p2)' at '/run/timeshift/backup'
[17:49:14] [ALPM-SCRIPTLET] E: JSON data must be UTF-8 encoded
[17:49:14] [ALPM-SCRIPTLET] 
[17:49:14] [ALPM-SCRIPTLET] (process:2366): Json-CRITICAL **: 17:49:14.032: json_node_get_object: assertion 'JSON_NODE_IS_VALID (node)' failed
...[This error message is repeated in total 9 times]
[17:49:14] [ALPM-SCRIPTLET] Creating new backup...(BTRFS)
[17:49:14] [ALPM-SCRIPTLET] Saving to device: /dev/dm-0, mounted at path: /run/timeshift/backup
[17:49:14] [ALPM-SCRIPTLET] Created directory: /run/timeshift/backup/timeshift-btrfs/snapshots/2022-03-06_17-49-14
[17:49:14] [ALPM-SCRIPTLET] Created subvolume snapshot: /run/timeshift/backup/timeshift-btrfs/snapshots/2022-03-06_17-49-14/@
[17:49:14] [ALPM-SCRIPTLET] Created control file: /run/timeshift/backup/timeshift-btrfs/snapshots/2022-03-06_17-49-14/info.json
[17:49:14] [ALPM-SCRIPTLET] BTRFS Snapshot saved successfully (0s)
[17:49:14] [ALPM-SCRIPTLET] Tagged snapshot '2022-03-06_17-49-14': ondemand
[17:49:14] [ALPM-SCRIPTLET] ------------------------------------------------------------------------------
[17:49:14] [ALPM-SCRIPTLET] E: JSON data must be UTF-8 encoded
[17:49:14] [ALPM-SCRIPTLET] 
[17:49:14] [ALPM-SCRIPTLET] (process:2366): Json-CRITICAL **: 17:49:14.257: json_node_get_object: assertion 'JSON_NODE_IS_VALID (node)' failed
...[This error message is repeated in total 30 times]
[17:49:14] [ALPM-SCRIPTLET] Removing snapshots (incomplete):
[17:49:14] [ALPM-SCRIPTLET] ------------------------------------------------------------------------------
[17:49:14] [ALPM-SCRIPTLET] Removing snapshot: 2022-02-24_11-59-55
[17:49:14] [ALPM-SCRIPTLET] Deleted directory: /run/timeshift/backup/timeshift-btrfs/snapshots/2022-02-24_11-59-55
[17:49:14] [ALPM-SCRIPTLET] Removed snapshot: 2022-02-24_11-59-55
[17:49:14] [ALPM-SCRIPTLET] ------------------------------------------------------------------------------
...[other snapshots]
[17:52:39] [ALPM-SCRIPTLET] ------------------------------------------------------------------------------
[17:52:39] [ALPM-SCRIPTLET] Removing snapshot: 2022-03-06_17-41-17
[17:53:03] [ALPM-SCRIPTLET] Deleted directory: /run/timeshift/backup/timeshift-btrfs/snapshots/2022-03-06_17-41-17
[17:53:03] [ALPM-SCRIPTLET] Removed snapshot: 2022-03-06_17-41-17
[17:53:03] [ALPM-SCRIPTLET] ------------------------------------------------------------------------------

It looks like something went wrong with those info.json files and instead of catching this error and stopping, the snapshots were just deleted.
Even more interestingly, I have no idea where the last snapshot even came from. There are no log entries from around 10 minutes earlier. The last update happened one day earlier (with the timestamp from 2022-03-05 that’s stated above).

sudo btrfs subvolume list -p /

Will show you if there are snapshots