Bug 1655860 - some systemd log messages contain hex coded dashes that make the messages hard to read
Summary: some systemd log messages contain hex coded dashes that make the messages har...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-04 06:09 UTC by Steve
Modified: 2019-01-11 12:41 UTC (History)
7 users (show)

Fixed In Version: systemd-240-1.fc30
Clone Of:
Environment:
Last Closed: 2019-01-11 12:40:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Screenshot showing systemd messages with hex coded dashes (63.31 KB, image/png)
2018-12-04 06:17 UTC, Steve
no flags Details
log file snippet showing hex coded dashes (1.05 KB, text/plain)
2018-12-04 06:21 UTC, Steve
no flags Details

Description Steve 2018-12-04 06:09:54 UTC
Description of problem:
Some systemd log messages contain hex coded dashes the make the messages hard to read. In particular, UUIDs are cluttered with them. UUIDs are already hard to read, and hex coded dashes make them even harder to read:

systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-aaaaaaaa\x2daaaa\x2daaaa\x2daaaa\x2daaaaaaaaaaaa.device.

Version-Release number of selected component (if applicable):
systemd-239-6.git9f3aed1.fc29.x86_64

How reproducible:
Always.

Steps to Reproduce:
See:

Bug 1655194 - systemd stalls boot for 1 min. 30 sec. when swap UUID refers to nonexistent device

Additional info:

Comment 1 Steve 2018-12-04 06:17:36 UTC
Created attachment 1511205 [details]
Screenshot showing systemd messages with hex coded dashes

This screenshot shows two systemd boot messages with hex coded dashes:

"Created slice system-systemd\x2dfsck.slice."

"A start job is running for dev-disk-by\x2duuid-aaaa ... aaaa.device (42s / 1min 30s)"

(I replaced part of the UUID with an ellipsis.)

Note that there is actually a mix of dashes and hex coded dashes. Dashes are printable characters, so they should be displayed as such.

Comment 2 Steve 2018-12-04 06:21:37 UTC
Created attachment 1511206 [details]
log file snippet showing hex coded dashes

Comment 3 Jan Synacek 2018-12-04 08:33:51 UTC
(In reply to Steve from comment #0)
> systemd[1]: Timed out waiting for device
> dev-disk-by\x2duuid-aaaaaaaa\x2daaaa\x2daaaa\x2daaaa\x2daaaaaaaaaaaa.device.

If I recall correctly, this is working as expected. The unit name gets translated and escaped from the actual path of the device, which in this case would be "/dev/disk/by-uuid/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa". For more information, you can take a look at systemd.unit(5), section "STRING ESCAPING FOR INCLUSION IN UNIT NAMES".

Comment 4 Steve 2018-12-04 09:24:28 UTC
(In reply to Jan Synacek from comment #3)
> (In reply to Steve from comment #0)
> > systemd[1]: Timed out waiting for device
> > dev-disk-by\x2duuid-aaaaaaaa\x2daaaa\x2daaaa\x2daaaa\x2daaaaaaaaaaaa.device.
> 
> If I recall correctly, this is working as expected. The unit name gets
> translated and escaped from the actual path of the device, which in this
> case would be "/dev/disk/by-uuid/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa". For
> more information, you can take a look at systemd.unit(5), section "STRING
> ESCAPING FOR INCLUSION IN UNIT NAMES".

Thanks for pointing that out. I didn't realize those strings are encoded file or directory names:

$ systemctl list-units | grep '\x2d' | head -1
sys-devices-virtual-block-dm\x2d0.device  ...   /sys/devices/virtual/block/dm-0 

That's all the more reason to provide some readable log messages for context:

Bug 1655194, Comment 10

Closing as not a bug.

Comment 5 Zbigniew Jędrzejewski-Szmek 2018-12-04 14:55:43 UTC
https://github.com/systemd/systemd/pull/11047

Comment 6 Steve 2018-12-04 18:12:08 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #5)
> https://github.com/systemd/systemd/pull/11047

Thanks. IIUC, your patch results in this showing a file system path in the "DESCRIPTION" column, even when the unit is "dead":

$ systemctl list-units --all \*uuid\*.device | grep dead
dev-disk-by\x2duuid-aaaaaaaa\x2daaaa\x2daaaa\x2daaaa\x2daaaaaaaaaaaa.device loaded inactive dead    dev-disk-by\x2duuid-aaaaaaaa\x2daaaa\x2daaaa\x2daaaa\x2daaaaaaaaaaaa.device

"systemctl" accepts file system paths, so this works fine:

$ systemctl status /dev/disk/by-uuid/7122eda4-f3a6-445c-9b4f-76d0337eb13f

Further, the UUID can be copied and pasted into non-systemd commands:

$ findfs UUID=7122eda4-f3a6-445c-9b4f-76d0337eb13f
/dev/vda1

Comment 7 Zbigniew Jędrzejewski-Szmek 2019-01-11 12:40:37 UTC
This will be available in F30. Possibly also in F29 if systemd is upgraded to 241 there, but this is not certain yet.


Note You need to log in before you can comment on or make changes to this bug.