Skip to content

QEMU still using old credential after rename until state dir deleted #448

@ujaandas

Description

@ujaandas

I renamed a credential file in my Nix config (ie; at /run/agenix/pocketid to /run/agenix/pocketid_enc_key, which I previously passed in with microvm.credentialFiles), rebuilt, and restarted the VM - but the MicroVM kept trying to load the old credential path.

The logs showed the old -fw_cfg entry even though the config was updated:

Dec 22 19:41:44 homelab systemd[1]: Started MicroVM 'auth'.
Dec 22 19:41:44 homelab microvm@auth[688251]: microvm@auth: -fw_cfg name=opt/io.systemd.credentials/POCKETID,file=/run/agenix/pocketid: can't load /run/agenix/pocketid: Failed to open file “/run/agenix/pocketid”: No such file or directory
Dec 22 19:41:44 homelab systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Dec 22 19:41:44 homelab systemd[1]: [email protected]: Failed with result 'exit-code'.
Dec 22 19:41:49 homelab systemd[1]: [email protected]: Scheduled restart job, restart counter is at 1.
Dec 22 19:41:49 homelab systemd[1]: Stopped MicroVM 'auth'.

It only picked up the new credential after I deleted the VM’s state directory. After that, it worked as expected.
Feels like the generated systemd unit or QEMU args weren’t being refreshed properly unless the state dir was cleared.

Might be worth checking whether stale state is being reused when it shouldn’t be.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions