You are not logged in.

#1 2015-07-02 04:46:12

leothrix
Member
Registered: 2015-07-01
Posts: 2

[Solved] journalctl --user error: Failed to get journal fields

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

#2 2015-07-02 07:10:38

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [Solved] journalctl --user error: Failed to get journal fields

Hi leothrix and welcome to the forums big_smile

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)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#3 2015-07-02 15:50:27

leothrix
Member
Registered: 2015-07-01
Posts: 2

Re: [Solved] journalctl --user error: Failed to get journal fields

Wow, that's an embarrassingly simple mistake on my part. smile

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

Board footer

Powered by FluxBB