[Bug 1127766] New: installation aborted if snapper fails
http://bugzilla.suse.com/show_bug.cgi?id=1127766 Bug ID: 1127766 Summary: installation aborted if snapper fails Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.1 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 Assignee: yast2-maintainers@suse.de Reporter: ohering@suse.com QA Contact: jsrain@suse.com Found By: --- Blocker: --- per bug#1048338, subvolume handing is (or was) suboptimal. Today I tried to upgrade an existing subvolume to 15.1. I set the default to this subvolume and booted with 'upgrade=1'. Since I do not use snapshots, there is no /.snapshots. Something does not like that fact: [Ruby] yast2/fs_snapshot.rb:317 Executing: "/usr/lib/snapper/installation-helper --step 5 --root-prefix=/mnt --snapshot-type pre --description before\ update --userdata "important=yes" --cleanup number" [bash] ShellCommand.cc(shellcommand):78 reading failed [bash] ShellCommand.cc(shellcommand):78 terminate called after throwing an instance of 'snapper::IOErrorException' [bash] ShellCommand.cc(shellcommand):78 what(): open failed path:/mnt//.snapshots errno:2 (No such file or directory) [Ruby] yast2/fs_snapshot.rb:323 Snapshot could not be created: /usr/lib/snapper/installation-helper --step 5 --root-prefix=/mnt --snapshot-type pre --description before\ update --userdata "important=yes" --cleanup number returned: {"exit"=>134, "stderr"=>"reading failed\nterminate called after throwing an instance of 'snapper::IOErrorException'\n what(): open failed path:/mnt//.snapshots errno:2 (No such file or directory)\n", "stdout"=>""} [Ruby] yast/builtins.rb:586 tostring builtin called on wrong type Class [Ruby] yast/wfm.rb:253 Client /mounts/mp_0001/usr/share/YaST2/clients/inst_update_partition.rb failed with 'Filesystem snapshot could not be created.' (Yast2::SnapshotCreationFailed). It seems the expectation is btrfs == snapshots. Did all of our fresh btrfs installs have a /.snapshots? If yes, the assumption might be valid, except for bug#1048338. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c1
--- Comment #1 from Stefan Hundhammer
http://bugzilla.suse.com/show_bug.cgi?id=1127766
Arvin Schnell
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c2
Ancor Gonzalez Sosa
http://bugzilla.suse.com/show_bug.cgi?id=1127766
Olaf Hering
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c4
--- Comment #4 from Ancor Gonzalez Sosa
This "installation-helper" call tries to create a pre-update snapshot. It shouldn't do that in the first place. That this fails because there is no .snapshots directory is only a consequence of that.
Now I wonder why it even wants to create that snapshot.
From the attached logs:
Checking if Snapper is configured: "/usr/bin/snapper --no-dbus --root=%{root} list-configs | /usr/bin/grep "^root " >/dev/null" returned: {"exit"=>0, "stderr"=>"", "stdout"=>""} Since the exit code of that command is zero, the installer concludes Snapper if configured and a snapshot can/must be performed. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c5
Ancor Gonzalez Sosa
(In reply to Stefan Hundhammer from comment #1)
This "installation-helper" call tries to create a pre-update snapshot. It shouldn't do that in the first place. That this fails because there is no .snapshots directory is only a consequence of that.
Now I wonder why it even wants to create that snapshot.
From the attached logs:
Checking if Snapper is configured: "/usr/bin/snapper --no-dbus --root=%{root} list-configs | /usr/bin/grep "^root " >/dev/null" returned: {"exit"=>0, "stderr"=>"", "stdout"=>""}
Since the exit code of that command is zero, the installer concludes Snapper if configured and a snapshot can/must be performed.
Needless to say, %{root} is substituted by /mnt when the command is executed. Olaf, since your system is so special, would you mind to paste the full output of this command? /usr/bin/snapper --no-dbus --root=/mnt list-configs Executed in the installation media, after the system to upgrade has been mounted. ==== If that's too hard, I guess it would be enough to just execute this in any of the systems that are installed into that filesystem: /usr/bin/snapper --no-dbus list-configs ==== Or alternatively do something like this with a rescue system ...activate the volume... mount -t btrfs /dev/sd240_crypt_lvm/sd240_btrfs /mnt /usr/bin/snapper --no-dbus --root=/mnt list-configs The first alternative would be the best, but whatever works for you... I guess you get the idea. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c6
Olaf Hering
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c7
--- Comment #7 from Olaf Hering
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c8
--- Comment #8 from Arvin Schnell
Since the exit code of that command is zero, the installer concludes Snapper is configured and a snapshot can/must be performed.
Which normally is fine. But the 'list-configs' command does not verify that the configs are actually sound/available. Here that is not the case. (In reply to Olaf Hering from comment #7)
I'm sure I never used snapper, perhaps a config as included in earlier pkgs?
The config file is not included in an RPM. Likely it was generated during installation by YaST (using snapper). -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c9
Ancor Gonzalez Sosa
(In reply to Ancor Gonzalez Sosa from comment #4)
Since the exit code of that command is zero, the installer concludes Snapper is configured and a snapshot can/must be performed.
Which normally is fine. But the 'list-configs' command does not verify that the configs are actually sound/available. Here that is not the case.
And how can YaST check that? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c10
Arvin Schnell
And how can YaST check that?
So far there is no snapper command to do that. Adding one might look trivial at first but likely is not. Apart from checking mount points one would also have to check mount flags (e.g. read-only, which btrfs also sets during certain errors). Additional ACLs and SELinux might make the checks more complicated. I suggest to inform the user about the failure to create the snapshot and let the user decide whether to continue or abort. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127766
Ancor Gonzalez Sosa
http://bugzilla.suse.com/show_bug.cgi?id=1127766
http://bugzilla.suse.com/show_bug.cgi?id=1127766#c11
Ancor Gonzalez Sosa
http://bugzilla.suse.com/show_bug.cgi?id=1127766
Arvin Schnell
participants (1)
-
bugzilla_noreply@novell.com