You are not logged in.
Howdy; I've got an odd problem that I can't find a solution to either on these forums or on Google; hopefully someone has some ideas.
I've been making use of systemd user instances for a few jobs, and it has been working pretty well generally. However, recently I've started getting the following errors from journalctl:
$ journalctl --user -u test-user-unit
Failed to get journal fields: Cannot assign requested address
-- Logs begin at Wed 2014-08-27 21:53:04 MDT, end at Wed 2015-07-01 22:27:31 MDT. --
Unfortunately I don't have any user units running regularly enough to correlate them with a specific systemd upgrade to try and draw a correlation. Interestingly, this test unit's logs do show up when using more general journactl commands:
$ journalctl --user -f
-- Logs begin at Wed 2014-08-27 21:53:04 MDT. --
...snip...
Jul 01 22:27:31 n40l systemd[8118]: Starting Just a test user unit...
Jul 01 22:27:31 n40l systemd[8118]: Started Just a test user unit.
Jul 01 22:27:31 n40l bash[9646]: Hello, world: Wed Jul 1 22:27:31 MDT 2015
I'm not really sure what's going on here; I have a typical user instance setup (storing units in ~/.config) but don't know why invoking journalctl in the first form would throw those errors. Any ideas? The only related issue I've found another user reporting on these boards was related to a hardware rule, which I haven't messed with.
My specs:
$ pacman -Q systemd
systemd 221-2
Last edited by leothrix (2015-07-02 15:51:06)
Offline
Hi leothrix and welcome to the forums
That message was introduced in systemd 220 [1]: In systemd 219, if journalctl was unable to display the requested log it simply exited with an exit code different than zero and showing no output so errors easily passed unnoticed. Now if journalctl cannot display the requested log, it will also show an error message in the format "Failed to get journal fields: <cause of the failure>".
That error message means that journalctl is unable to find a valid log with the options you specified: the problem is that the option -u will match only system units, but your is a user unit and you are searching in the user journal. For a user unit you should use the option --user-unit:
journalctl --user --user-unit test-user-unit
Last edited by mauritiusdadd (2015-07-02 07:11:48)
Offline
Wow, that's an embarrassingly simple mistake on my part.
For the record, the answer works:
$ journalctl --user --user-unit test-user-unit
-- Logs begin at Wed 2014-08-27 21:53:04 MDT, end at Thu 2015-07-02 09:45:54 MDT. --
Jul 01 22:27:31 n40l systemd[8118]: Starting Just a test user unit...
Jul 01 22:27:31 n40l systemd[8118]: Started Just a test user unit.
Thanks for the help! Marking as solved.
Offline