podman breaks if user account is renamed, cryptic error "database static dir ... does not match our static dir", fix is difficult
Issue Description
I inadvertently created my user account on a new (Fedora Silverblue) system as 'adam', not 'adamw'. So I renamed it and carried on. But when I came to do something with podman (which had obviously somehow created some initial config even though I hadn't directly done anything with it), it failed with a cryptic error:
Error: database static dir "/var/home/adam/.local/share/containers/storage/libpod" does not match our static dir "/var/home/adamw/.local/share/containers/storage/libpod": database configuration mismatchIt was rather difficult to fix this. The error doesn't tell you where the "database" in question is (or what "our" means, exactly). podman system reset and podman system migrate as root do not fix it. podman info as root doesn't clearly tell you where the databases are. Running commands as user with podman --debug doesn't tell you either.
In the end I had to poke around in the source to work out the db in question was in /var/home/adamw/.local/share/containers/storage/db.sql. Then to fix it, since there's no sqlite3 on Silverblue and I couldn't enter a toolbox container because of this exact problem, I had to scp the file off to another system, fix several paths in it with sqlite3, then copy it back to the affected system. Surely there must be a better way?
Steps to reproduce the issue
Steps to reproduce the issue
- Install a Fedora Silverblue system, create the initial user, use the desktop briefly
- Switch to single-user mode and rename the user
- Boot normally, log in as the renamed user, try to use podman (or toolbox)
Describe the results you received
Error: database static dir "/var/home/adam/.local/share/containers/storage/libpod" does not match our static dir "/var/home/adamw/.local/share/containers/storage/libpod": database configuration mismatch
Describe the results you expected
Working podman
podman info output
doesn't seem relevant...this is Fedora Silverblue Rawhide with podman 5.3.1.Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
No response
Source: podman-container-tools/podman