Skip to content

Backup fails due to missing sqlite file

Quick Information

  • Operating System: UnRAID
  • Install Type: Docker

What Happened?

I have an automatic backup action that will backup the server every 12 hours. This was working a while back just fine but out of no where it started failing and has been for a while with no changes. I was ignoring it at first but now five of the six backups that occurred are broken. Looking in the logs seems to show the following:

2025-02-07 11:58:39,244 - [Crafty] - INFO     - app.classes.shared.server - Getting Stats for Server [removed] ...
2025-02-07 11:59:09,244 - [Crafty] - INFO     - app.classes.shared.server - Getting Stats for Server [removed] ...
2025-02-07 11:59:39,245 - [Crafty] - INFO     - app.classes.shared.server - Getting Stats for Server [removed] ...
2025-02-07 12:00:00,003 - [Crafty] - INFO     - audit_log - Task with id 3 completed successfully
2025-02-07 12:00:00,403 - [Crafty] - INFO     - cmd_queue - Current queued commands: [{'server_id': '34cc55f2-96d7-4ed4-89ca-c604c4b48463', 'user_id': 2, 'command': 'backup_server', 'action_id': 'b04a017c-99dd-49ba-b7cc-0c7988b010a2'}]
2025-02-07 12:00:00,404 - [Crafty] - INFO     - app.classes.shared.server - Starting Backup Thread for server [removed].
2025-02-07 12:00:00,405 - [Crafty] - INFO     - app.classes.shared.server - Starting server [removed] (ID 34cc55f2-96d7-4ed4-89ca-c604c4b48463) backup
2025-02-07 12:00:00,406 - [Crafty] - INFO     - app.classes.shared.server - Backup Thread started for server [removed].
2025-02-07 12:00:08,413 - [Crafty] - INFO     - app.classes.shared.server - Creating backup of server '[removed]' (ID#34cc55f2-96d7-4ed4-89ca-c604c4b48463, path=/crafty/servers/34cc55f2-96d7-4ed4-89ca-c604c4b48463) at '/crafty/backups/34cc55f2-96d7-4ed4-89ca-c604c4b48463/b04a017c-99dd-49ba-b7cc-0c7988b010a2/2025-02-07_12-00-08'
2025-02-07 12:00:09,244 - [Crafty] - INFO     - app.classes.shared.server - Getting Stats for Server [removed] ...
2025-02-07 12:00:10,845 - [Crafty] - WARNING  - app.classes.shared.file_helpers - Error backing up: /crafty/servers/34cc55f2-96d7-4ed4-89ca-c604c4b48463/db_stats/crafty_server_stats.sqlite-wal! - Error was: [Errno 2] No such file or directory: '/crafty/servers/34cc55f2-96d7-4ed4-89ca-c604c4b48463/db_stats/crafty_server_stats.sqlite-wal'
2025-02-07 12:00:10,846 - [Crafty] - ERROR    - app.classes.shared.server - Failed to create backup of server [removed] (ID 34cc55f2-96d7-4ed4-89ca-c604c4b48463)
Traceback (most recent call last):
  File "/crafty/app/classes/shared/server.py", line 1199, in backup_server
    self.file_helper.make_backup(
  File "/crafty/app/classes/shared/file_helpers.py", line 337, in make_backup
    total_bytes += os.path.getsize(os.path.join(root, file))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen genericpath>", line 62, in getsize
FileNotFoundError: [Errno 2] No such file or directory: '/crafty/servers/34cc55f2-96d7-4ed4-89ca-c604c4b48463/db_stats/crafty_server_stats.sqlite-wal'
2025-02-07 12:00:39,244 - [Crafty] - INFO     - app.classes.shared.server - Getting Stats for Server [removed] ...
2025-02-07 12:01:09,244 - [Crafty] - INFO     - app.classes.shared.server - Getting Stats for Server [removed] ...
2025-02-07 12:01:39,244 - [Crafty] - INFO     - app.classes.shared.server - Getting Stats for Server [removed] ...

Not quite sure what it means, since going into the folder shows that the file definitely exists.

Expected result

The server should back up without any problems, or skip over the file instead of killing the entire backup.

Steps to reproduce

Not quite sure how to reproduce. I have a task which runs the default backup command every 12 hours and that is all. One other thing to note is every time time it failed it would fail with the exact same error with the same missing file, and as stated earlier, this problem doesn't always occur; it seems to be random.

Screenshots

This is the configuration of the backup. Gl2qDPFx18

The log that occurs can be seen in the above section.

Priority/Severity

  • High (anything that impacts the normal user flow or blocks app usage)
  • Medium (anything that negatively affects the user experience)
  • Low (anything else e.g., typos, missing icons/translations, layout/formatting issues, etc.)