Journalctl logs not categorized by unit anymore

Around May 3rd, I accidentally deleted my /etc/machine-id file and had to recreate a new one with systemd-machine-id-setup. Since then, my user logs have not been showing correctly, despite numerous rebuilds and reboots.

For example, if I try:

journalctl --user -u syncthing.service

I get some results up until May 3rd, but nothing after. However, if I do:

sudo journalctl | grep syncthing

Then I see recent logs as expected. Strangely, this second command requires sudo, even though the journalctl manpage says being in the wheel group should be sufficient. Witihout sudo, I again only see log entries up to May 3rd.

This goes for other services as well.

No logs shown:
sudo systemctl status nixos-upgrade.service

Shows recent logs:
sudo journalctl | grep nixos-upgrade

What would cause these logs to not be categorized by unit anymore? And why are they no longer visible without using sudo?

2 Likes

As a follow-up, I seem to have corrected this by deleting everything in /var/log/journal and rebooting.

I’m obviously only seeing new logs, history is gone, but at least service status logs are showing properly now, and all permissions errors have disappeared.

I also added myself to the systemd-journal group before the reboot, but I was already in the wheel and adm groups, so I doubt this made a difference (in fact I removed myself from adm when adding systemd-journal, as it felt redundant).