cysystemd icon indicating copy to clipboard operation
cysystemd copied to clipboard

Can't access the logs of systemd 249

Open PaulAnnekov opened this issue 1 year ago • 1 comments

I have a script which reads logs from journal in a loop: https://github.com/PaulAnnekov/log-trigger/blob/d7e55fb29584286d7cdb4170caad5c422bfda334/log_trigger.py#L189. It was working fine, until I was using ubuntu 18.04 (systemd 237). But when I upgraded to ubuntu 22.04 (systemd 249), it can't read the fresh logs generated after the upgrade.

I started to dig around and found that the problem is probably in pre-built wheels of the package. I was using them instead of building from sources. Looks like it was built on older version of the systemd library which just can't read the newer format of the logs. E.g. systemd 246 introduced the incompatible change:

systemd-journald gained support for zstd compression of large fields in journal files. The hash tables in journal files have been hardened against hash collisions. This is an incompatible change and means that journal files created with new systemd versions are not readable with old versions. If the $SYSTEMD_JOURNAL_KEYED_HASH boolean environment variable for systemd-journald.service is set to 0 this new hardening functionality may be turned off, so that generated journal files remain compatible with older journalctl implementations.

I started to build the package from sources and it works. Probably, you need to upgrade the CI to build using newer version of the systemd.

PaulAnnekov avatar Sep 04 '23 20:09 PaulAnnekov

I can confirm this, it would be great to have a new release to fix this issue.

jasperjonker avatar Sep 25 '23 09:09 jasperjonker