Feedback on a Problem or for Improvement
Summary
snapper configuration fails if it was previously installed
Description
If snapper was previously installed, and a btrfs /.snapshots subvolume already exists, that should be recognized, and the subvolume should be (re)used. Instead setup of Freedombox silently fails, unless one watches the details as they unfold by starting plinth from the command line (and then deleting things in a different terminal).
INFO plinth.operation Operation: snapshot: Installing app: added
INFO plinth.operation Operation: snapshot: Installing app: running
INFO plinth.setup Setup run: snapshot
INFO plinth.actions # snapshot..setup(…)
ERROR plinth.actions Error running action snapshot..setup(*(0,), **{}): Command '['snapper', 'create-config', '/']' returned non-zero exit status 1. (1, ['snapper', 'create-config', '/'], b'', b'Creating config failed (creating btrfs subvolume .snapshots failed since it already exists).\n\x1b[31m ERROR\x1b[0m \x1b[94m__main__ \x1b[0m Error executing action: Command \'[\'snapper\', \'create-config\', \'/\']\' returned non-zero exit status 1.\nTraceback (most recent call last):\n File "/usr/share/plinth/actions/actions", line 92, in _call\n return_values = func(*arguments[\'args\'], **arguments[\'kwargs\'])\n File "/usr/lib/python3/dist-packages/plinth/modules/snapshot/privileged.py", line 29, in setup\n subprocess.run(command, check=True)\n File "/usr/lib/python3.10/subprocess.py", line 526, in run\n raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command \'[\'snapper\', \'create-config\', \'/\']\' returned non-zero exit status 1.\n') [' File "/usr/share/plinth/actions/actions", line 92, in _call\n return_values = func(*arguments[\'args\'], **arguments[\'kwargs\'])\n', ' File "/usr/lib/python3/dist-packages/plinth/modules/snapshot/privileged.py", line 29, in setup\n subprocess.run(command, check=True)\n', ' File "/usr/lib/python3.10/subprocess.py", line 526, in run\n raise CalledProcessError(retcode, process.args,\n']
INFO plinth.setup Setup completed: snapshot: Error installing app: Command '['snapper', 'create-config', '/']' returned non-zero exit status 1. Command '['snapper', 'create-config', '/']' returned non-zero exit status 1.
ERROR plinth.setup Error running setup - Command '['snapper', 'create-config', '/']' returned non-zero exit status 1.
WARNING plinth.setup Unable to complete setup: Command '['snapper', 'create-config', '/']' returned non-zero exit status 1.
INFO plinth.setup Will try again in 10 seconds
Proposed Solution
Setup should just continue and reuse the existing subvolue