Bug 1206700

Summary: systemd: Failed to start Create missing directories from rpmdb
Product: [openSUSE] openSUSE Tumbleweed Reporter: B <reiokorn>
Component: MicroOSAssignee: Stanislav Brabec <sbrabec>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: fvogt, henrik.dermer, kukuk
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description B 2022-12-26 15:51:02 UTC
sudo journalctl -b | grep rpm

Dez 26 16:48:07 microos-pc systemd[1]: Starting Create missing directories from rpmdb...
Dez 26 16:48:07 microos-pc create_dirs_from_rpmdb[921]: Failed to resolve uuidd/uuidd
Dez 26 16:48:07 microos-pc systemd[1]: create-dirs-from-rpmdb.service: Main process exited, code=exited, status=1/FAILURE
Dez 26 16:48:07 microos-pc systemd[1]: create-dirs-from-rpmdb.service: Failed with result 'exit-code'.
Dez 26 16:48:07 microos-pc systemd[1]: Failed to start Create missing directories from rpmdb.
Comment 1 Henrik Dermer 2022-12-30 14:52:56 UTC
Got this issue as well and started to investigate it a little. Running the command in the unit file with the debug flag yields some more info, 
localhost:~ # /usr/sbin/create_dirs_from_rpmdb --debug
Missing /var/lib/libuuid (drwxr-xr-x,uuidd,uuidd,2022-12-23,10:26)
Failed to resolve uuidd/uuidd

I can clearly see that /var/lib/libuuid isn't present in my filesystem, but searching for it gives a hit in every snapshot.
localhost:~ # find / -name libuuid
/.snapshots/2/snapshot/var/lib/libuuid
/.snapshots/3/snapshot/var/lib/libuuid
/.snapshots/5/snapshot/var/lib/libuuid
/.snapshots/6/snapshot/var/lib/libuuid

Checking my mounts show that /dev/sda3 is mounted to /var
localhost:~ # mount | grep sda3
/dev/sda3 on /var type btrfs (rw,relatime,seclabel,space_cache=v2,subvolid=5,subvol=/)

Checking my mounts when inside a transactional-update shell it shows something completely different and I can clearly see that that neither /var nor /var/lib is mounted
transactional update # mount | grep sda3
/dev/sda3 on /var/log type btrfs (rw,relatime,seclabel,space_cache=v2,subvolid=5,subvol=/)
/dev/sda3 on /var/lib/zypp type btrfs (rw,relatime,seclabel,space_cache=v2,subvolid=5,subvol=/)
/dev/sda3 on /var/lib/ca-certificates type btrfs (rw,relatime,seclabel,space_cache=v2,subvolid=5,subvol=/)
/dev/sda3 on /var/lib/selinux type btrfs (rw,relatime,seclabel,space_cache=v2,subvolid=5,subvol=/)
/dev/sda3 on /var/cache type btrfs (rw,relatime,seclabel,space_cache=v2,subvolid=5,subvol=/)

If I mount /var and then do the update from within the transactional-update shell (zypper up or zypper dup) and reboot. The create_dirs_from_rpmdb program (and create-dirs-from-rpmdb.service) work just fine.


Since I started using MicroOS about a week ago I don't fully understand if this is by design or not. Not mounting /var that is... Since transactional-update print the message "Separate /var detected." and looking in the man pages (https://manpages.opensuse.org/Tumbleweed/transactional-update/transactional-update.8.en.html) it states (in the important section),
"... There is also limited handling for adding files and directories to /var, however modifications of existing files (e.g. migrating databases) are supposed to be handled by systemd jobs at startup (see the initial configuration and deployment section of the packaging guidelines[1])."
Comment 2 B 2023-01-08 13:41:57 UTC
(In reply to Henrik Dermer from comment #1)
> (...)
> Since I started using MicroOS about a week ago I don't fully understand if
> this is by design or not. Not mounting /var that is... Since
> transactional-update print the message "Separate /var detected." and looking
> in the man pages
> (https://manpages.opensuse.org/Tumbleweed/transactional-update/transactional-
> update.8.en.html) it states (in the important section),
> "... There is also limited handling for adding files and directories to
> /var, however modifications of existing files (e.g. migrating databases) are
> supposed to be handled by systemd jobs at startup (see the initial
> configuration and deployment section of the packaging guidelines[1])."

https://en.opensuse.org/Portal:MicroOS/Design
look into /etc/fstab, /var is mounted:
/var btrfs subvol=/@/var,x-initrd.mount 0 0
https://www.freedesktop.org/software/systemd/man/systemd.special.html#initrd-fs.target
Comment 3 Thorsten Kukuk 2023-01-09 10:06:24 UTC
(In reply to B from comment #0)
> Dez 26 16:48:07 microos-pc create_dirs_from_rpmdb[921]: Failed to resolve
> uuidd/uuidd

That's the problem: util-linux packages a directory owned by the uuidd:uuidd user and group, but does not create the account.

Either the package list is wrong (directory should be part of a sub-package or so) or the user(uuid)/group(uuid) requires are wrong.
Comment 4 Fabian Vogt 2023-01-09 14:18:13 UTC
This is also broken on plain Tumbleweed: bug 1206690

Let's close this as a dup.

*** This bug has been marked as a duplicate of bug 1206690 ***