Backup fails (and services won't restart)

Last night, on my Pioneer with SSD, backup failed:

oct. 29 02:54:34 fbox /usr/bin/plinth[20655]: Running backup_pre hooks
oct. 29 02:54:34 fbox /usr/bin/plinth[20655]: # backups..dump_settings(…) 
oct. 29 02:54:34 fbox sudo[19375]:   plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/actions backups dump_settings --write-fd 16
oct. 29 02:54:34 fbox sudo[19375]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=115)
oct. 29 02:54:40 fbox sudo[19375]: pam_unix(sudo:session): session closed for user root
oct. 29 02:54:40 fbox /usr/bin/plinth[20655]: # backups..create_archive(…) 
oct. 29 02:54:40 fbox sudo[19379]:   plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/actions backups create_archive --write-fd 16
oct. 29 02:54:40 fbox sudo[19379]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=115)
oct. 29 02:54:53 fbox /usr/share/plinth/actions/actions[19381]: Error executing action: Command '['borg', 'create', '--json', '--comment', '{{"type": "scheduled", "periods": ["daily", "weekly"]}}', '/media/9a052f38-a343-11ed-ba94-02990b>
                                                                Traceback (most recent call last):
                                                                  File "/usr/share/plinth/actions/actions", line 93, in _call
                                                                    return_values = func(*arguments['args'], **arguments['kwargs'])
                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                  File "/usr/lib/python3/dist-packages/plinth/modules/backups/privileged.py", line 166, in create_archive
                                                                    _run(command, encryption_passphrase)
                                                                  File "/usr/lib/python3/dist-packages/plinth/modules/backups/privileged.py", line 352, in _run
                                                                    return subprocess.run(cmd, check=check, env=env, **kwargs)
                                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                  File "/usr/lib/python3.11/subprocess.py", line 571, in run
                                                                    raise CalledProcessError(retcode, process.args,
                                                                subprocess.CalledProcessError: Command '['borg', 'create', '--json', '--comment', '{{"type": "scheduled", "periods": ["daily", "weekly"]}}', '/media/9a052f38-a343-11ed-ba94>
oct. 29 02:54:54 fbox sudo[19379]: pam_unix(sudo:session): session closed for user root
oct. 29 02:54:54 fbox /usr/bin/plinth[20655]: Error running action backups..create_archive(*('/media/9a052f38-a343-11ed-ba94-02990b41e22a::scheduled: daily, weekly: 2023-10-29:02:52', ['/etc/ez-ipupdate/', '/etc/letsencrypt/', '/etc/cot>
oct. 29 02:54:54 fbox /usr/bin/plinth[20655]: Error running scheduled backup: Command '['borg', 'create', '--json', '--comment', '{{"type": "scheduled", "periods": ["daily", "weekly"]}}', '/media/9a052f38-a343-11ed-ba94-02990b41e22a::sc>
                                              Traceback (most recent call last):
                                                File "/usr/lib/python3/dist-packages/plinth/modules/backups/__init__.py", line 106, in backup_by_schedule
                                                  repository.schedule.run_schedule()
                                                File "/usr/lib/python3/dist-packages/plinth/modules/backups/schedule.py", line 205, in run_schedule
                                                  self._run_backup(periods)
                                                File "/usr/lib/python3/dist-packages/plinth/modules/backups/schedule.py", line 297, in _run_backup
                                                  repository.create_archive(name, app_ids, archive_comment=comment)
                                                File "/usr/lib/python3/dist-packages/plinth/modules/backups/repository.py", line 183, in create_archive
                                                  api.backup_apps(_backup_handler, path=archive_path, app_ids=app_ids,
                                                File "/usr/lib/python3/dist-packages/plinth/modules/backups/api.py", line 131, in backup_apps
                                                  _run_operation(backup_handler, packet,
                                                File "/usr/lib/python3/dist-packages/plinth/modules/backups/api.py", line 423, in _run_operation
                                                  handler(packet, encryption_passphrase=encryption_passphrase)
                                                File "/usr/lib/python3/dist-packages/plinth/modules/backups/__init__.py", line 96, in _backup_handler
                                                  privileged.create_archive(packet.path, paths,
                                                File "/usr/lib/python3/dist-packages/plinth/actions.py", line 57, in wrapper
                                                  return _run_privileged_method_as_process(module_name, action_name,
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                File "/usr/lib/python3/dist-packages/plinth/actions.py", line 116, in _run_privileged_method_as_process
                                                  return _wait_for_return(*wait_args)
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                File "/usr/lib/python3/dist-packages/plinth/actions.py", line 154, in _wait_for_return
                                                  raise exception
                                              subprocess.CalledProcessError: Command '['borg', 'create', '--json', '--comment', '{{"type": "scheduled", "periods": ["daily", "weekly"]}}', '/media/9a052f38-a343-11ed-ba94-02990b41e22a::sch>

Do these messages allow to know what caused the failure? I searched, the remote machine on which the backups are done seems perfectly functional.

Following this, none of the stopped service were restarted, I’ll try rebooting now.

@Avron: unfortunately the log is cropped so i can’t read the juicy parts…

@Avron , could you please run the backup on this repository manually from the backups app and see if there are any errors? Could you please post the full log messages for that?

I have posted a patch for fixing the issue with services not restarting after failed backup: backups: Don't leave services stopped if backup fails (!2430) · Merge requests · FreedomBox / FreedomBox · GitLab . Should be available in the next release in a couple of weeks.

1 Like