RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1431687 - journal: Cannot read journal written by Fedora 24 and later
Summary: journal: Cannot read journal written by Fedora 24 and later
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jan Rybar
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On: 1432958
Blocks: 1466365
TreeView+ depends on / blocked
 
Reported: 2017-03-13 15:39 UTC by Rich Megginson
Modified: 2018-04-10 11:20 UTC (History)
7 users (show)

Fixed In Version: systemd-219-47.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 11:19:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0711 0 None None None 2018-04-10 11:20:54 UTC

Description Rich Megginson 2017-03-13 15:39:42 UTC
Description of problem:

OpenShift logging needs to be able to read logs from the journal when docker is configured to use --log-driver=journald.  One of the use cases is running containerized.  In this case, the log collector, fluentd, will be running in an el7 container (centos 7 or rhel 7), and will mount /run/log/journal and/or /var/log/journal from the host to be able to read log messages.  This worked on Fedora 23, but doesn't work on Fedora 24 and later.

Version-Release number of selected component (if applicable):


How reproducible:

$ docker run --privileged -it -v /var/log/journal:/var/log/journal centos:7 bash
[root@a225107b2a98 /]# journalctl -D /var/log/journal 
Error was encountered while opening journal files: Protocol not supported


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Peter Portante 2017-03-14 02:13:17 UTC
So are you saying if the host journald is from a version of systemd that ships with Fedora 24, a container built for centos7 or rhel 7 cannot read /var/log/journal mount from the Fedora 24 host?

So we need to build the fluentd image with the right version of systemd libraries it seems.  Or am I missing a subtly here?

Comment 3 Rich Megginson 2017-03-14 02:53:53 UTC
(In reply to Peter Portante from comment #2)
> So are you saying if the host journald is from a version of systemd that
> ships with Fedora 24, a container built for centos7 or rhel 7 cannot read
> /var/log/journal mount from the Fedora 24 host?

Correct.

> So we need to build the fluentd image with the right version of systemd
> libraries it seems.  Or am I missing a subtly here?

Correct.  We need an EL7 fluentd image with EL7 systemd journal libraries that can read journal files created with Fedora 24 and later.  In order to do that, we need EL7 systemd journal libraries that can read journal files created with Fedora 24 and later.  Where can we get such libraries?

Comment 4 Peter Portante 2017-03-14 03:09:02 UTC
Let's hope journalctl is written in such a way that the vary latest version of the journal can read older versions of journald data.  If it can't, and we ship with the latest, we'll lock ourselves out entirely.

Can we build the container for fluentd local to the host on which it will be deployed so that we can pick up those compatible versions of the journalctl libraries?

Comment 5 Michal Sekletar 2017-03-14 07:52:35 UTC
RHEL7 version of sd-journal doesn't support LZ4 compressed journal files (now default on Fedora). We may need to backport this support to RHEL7. However I don't know how "backportable" those patches are.

Comment 6 Lukáš Nykrýn 2017-03-14 08:05:50 UTC
I think that our systemd has the support for lz4, but we turn it off during compilation. And to be honest I am quite hesitant to turn it on. We had some issues with it in fedora and we will also break forward compatibility in rhel, since new journals would be automatically created with lz4 and older version of rhel, would not be able to read it.

Comment 8 Michal Sekletar 2017-03-14 08:23:16 UTC
(In reply to Lukáš Nykrýn from comment #6)
> I think that our systemd has the support for lz4, but we turn it off during
> compilation. And to be honest I am quite hesitant to turn it on. We had some
> issues with it in fedora and we will also break forward compatibility in
> rhel, since new journals would be automatically created with lz4 and older
> version of rhel, would not be able to read it.

That is a good point. Compression option in journald.conf is boolean option and compression algorithm is not configurable at runtime.

Comment 9 Peter Portante 2017-03-14 12:27:13 UTC
Isn't the problem here that journalctl can't *read* a compressed journal?  I don't think this is about turning on compression by default for what journald writes in RHEL 7.

Comment 10 Michal Sekletar 2017-03-14 12:51:45 UTC
(In reply to Peter Portante from comment #9)
> Isn't the problem here that journalctl can't *read* a compressed journal?  I
> don't think this is about turning on compression by default for what
> journald writes in RHEL 7.

Compression is turned on by default. If you compile journal with both lz4 and xz support then journalctl will be able to read both formats. However journald from such rpm package will start producing lz4 compressed journals that older RHEL7 releases can't read.

I think that one possible solution would be turning on lz4 across the board but I am not sure how viable this is (especially for RHEL-7.1 where we still have systemd-208).

Comment 11 Lukáš Nykrýn 2017-03-14 12:57:27 UTC
I think better approach would be a small downstream patch, that would swap the order of xz and lz4 here:
https://github.com/lnykryn/systemd-rhel/blob/staging/src/journal/compress.h#L36

Comment 12 Michal Sekletar 2017-03-14 13:16:27 UTC
I guess that would work. However, I am not sure how I feel about such patch. We would then end up with different default compared to upstream.

Comment 13 Rich Megginson 2017-03-14 22:01:47 UTC
(In reply to Peter Portante from comment #4)
> Let's hope journalctl is written in such a way that the vary latest version
> of the journal can read older versions of journald data.  If it can't, and
> we ship with the latest, we'll lock ourselves out entirely.
> 
> Can we build the container for fluentd local to the host on which it will be
> deployed so that we can pick up those compatible versions of the journalctl
> libraries?

I don't understand what you mean by "build the container for fluentd local to the host on which it will be deployed".  I don't understand what you mean by "pick up those compatible versions of the journalctl libraries".

Comment 14 Peter Portante 2017-03-14 22:14:24 UTC
I probably don't understand what I am talking about either! ;)

I was trying to communicate that on the host on which the fluentd pod will be deployed would be some version of systemd/journald that if we could link against that version at the time we deploy the fluentd pod, we would not have to link against the right version ahead of time.

Comment 15 Lukáš Nykrýn 2017-03-15 11:39:36 UTC
Maybe to summarize:

The problem here is that rhel7 journal and all of its API are able to only process journal logs compressed with xz, but fedora uses lz4. So you are asking for support of lz4 in rhel7 :-)

Our problem is, that you can't choose compression algorithm, which journal will be using and if it knows lz4 it starts writing logs using that. So if we blindly turn on lz4 support in rhel7 it will mean that all new logs will be compressed with lz4 instead of xz and that might upset some customers.

But I just found out, that all of this does not matter much, since we don't build lz4 library for rhel7.

So if you really need to build your image on top of rhel7 you will have to start with a different bug for component "distribution" and ask for adding lz4 package.

Comment 16 Rich Megginson 2017-03-15 14:50:12 UTC
The only way I think we could do this is to configure the host to use systemd-journal-remote to send to a fluentd http listener running in the container.

Feel free to close this bug if it isn't feasible for rhel7.

Comment 18 Peter Portante 2017-03-16 01:37:19 UTC
Can somebody explain why this is a problem with the default compression that is used when writing on RHEL 7 and not that this is about journalctl (and really the journald apis) being able to read lz4 journals on rhel 7 box?

This seems really simple: get a change in rhel 7 so that journals written using either xz or lz4 can be read by the journal handling library used by fluentd (and for that matter journalctl, rsyslog (via imjournal), etc.).

(In reply to Lukáš Nykrýn from comment #15)
> Maybe to summarize:
> 
> The problem here is that rhel7 journal and all of its API are able to only
> process journal logs compressed with xz, but fedora uses lz4. So you are
> asking for support of lz4 in rhel7 :-)

This seems like we have a good summary ... but ...

> Our problem is, that you can't choose compression algorithm, which journal
> will be using and if it knows lz4 it starts writing logs using that.

And here is where it seems we go off track.  Why are we talking about writing journals when we need to talk about reading them?

> So if we blindly turn on lz4 support in rhel7

Is the request to turn on lz4 support for writing journals in rhel7?  Seems like it is endow journalctl and its libraries with the ability to read lz4 journal files.

> it will mean that all new logs will
> be compressed with lz4 instead of xz and that might upset some customers.

Right, this is really bad, and nobody in this BZ seems to want that.  Well ... do they?

> But I just found out, that all of this does not matter much, since we don't
> build lz4 library for rhel7.

How hard would it be to build lz4 for RHEL 7?

> So if you really need to build your image on top of rhel7 you will have to
> start with a different bug for component "distribution" and ask for adding
> lz4 package.

Sounds like a path forward, as long as we get to the point where we talk about reading journals with lz4 and not writing them.  ;)

Comment 19 Lukáš Nykrýn 2017-03-16 06:25:07 UTC
> > Our problem is, that you can't choose compression algorithm, which journal
> > will be using and if it knows lz4 it starts writing logs using that.
> 
> And here is where it seems we go off track.  Why are we talking about
> writing journals when we need to talk about reading them?

Again, current code does not support choosing between compression of algorithms. If you compile journal, so it is able to read lz4, it starts also writing logs with lz4. It is an implementation detail, that is not interesting for you, but we need to deal with it via some downstream patch.

Comment 20 Peter Portante 2017-03-16 12:33:32 UTC
(In reply to Lukáš Nykrýn from comment #19)
> If you compile journal, so it is able to read lz4, it starts
> also writing logs with lz4.

So what prevents us from filing an issue upstream against systemd, motivating the use case (which seems really obvious in a containerized environment), and working to get this patched upstream first?

Comment 21 Lukáš Nykrýn 2017-03-16 13:10:49 UTC
I don't think there is any problem with the upstream, since there we want to push lz4 and upstream version is able to read the older journals.

Again only blocker here is the missing lz4 package in rhel.

Comment 29 Lukáš Nykrýn 2017-11-16 12:50:30 UTC
fix merged to staging branch -> https://github.com/lnykryn/systemd-rhel/pull/169 -> post

Comment 34 errata-xmlrpc 2018-04-10 11:19:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0711


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