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 1534827 - docker journald log driver keeps file descriptors to deleted /var/log/journal/*/*.journal files
Summary: docker journald log driver keeps file descriptors to deleted /var/log/journal...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Nalin Dahyabhai
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1186913 1513780
TreeView+ depends on / blocked
 
Reported: 2018-01-16 02:53 UTC by Takayoshi Kimura
Modified: 2021-06-10 14:12 UTC (History)
17 users (show)

Fixed In Version: docker-1.13.1-52.gitce62987.el7_4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-07 09:51:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0436 0 normal SHIPPED_LIVE docker bug fix and enhancement update 2018-03-07 14:51:35 UTC

Description Takayoshi Kimura 2018-01-16 02:53:44 UTC
Description of problem:

Disk is getting full because docker journald log driver keeps file descriptors to deleted /var/log/journal/*/*.journal files.

The following command shows a lot of deleted file descriptors.

# find /proc/*/fd -ls | grep  '(deleted)'

854653876    0 lr-x------   1 root     root           64 Jan 15 19:52 /proc/8004/fd/6793 -> /var/log/journal/aab77f0af404433695f49265761415c7/system\ (deleted)
854653877    0 lr-x------   1 root     root           64 Jan 15 19:52 /proc/8004/fd/6794 -> /var/log/journal/aab77f0af404433695f49265761415c7/system\ (deleted)
854653879    0 lr-x------   1 root     root           64 Jan 15 19:52 /proc/8004/fd/6796 -> /var/log/journal/aab77f0af404433695f49265761415c7/system\ (deleted)

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

docker-1.12.6-55
docker-1.12.6-68

How reproducible:

Always when running a lot of containers

Steps to Reproduce:
1.
2.
3.

Actual results:

Disk full due to deleted journal files

Expected results:

Journal files deleted and free disk space

Additional info:

Upstream issue: https://github.com/moby/moby/issues/27343

Comment 2 Takayoshi Kimura 2018-01-16 03:47:31 UTC
To workaround, truncate the deleted files manually in a cron job:

# cd /proc/`pidof dockerd-current`/fd
# ls -l |grep var.log.journal |grep deleted.$ |awk '{print $9}' |while read x; do :> $x; done;

Comment 3 Peter Portante 2018-01-18 00:46:05 UTC
Is it docker code that is doing this? Or is this really the systemd journal API interfaces doing this? The reason to ask is because we seem the same behavior with rsyslog configured to use imjournal.

Comment 6 Nalin Dahyabhai 2018-01-18 21:48:02 UTC
It looks like the journal reading logic in dockerd isn't handling SD_JOURNAL_INVALIDATE status results from sd_journal_process(), which would be a good time for it to close and reopen the handle that it's using to follow the journal as entries get added to it.  A patch to handle that shouldn't be very large.

Comment 8 Peter Portante 2018-01-19 01:22:36 UTC
It looks like rsyslog already handles this, see https://github.com/rsyslog/rsyslog/blob/v8-stable/plugins/imjournal/imjournal.c#L505

Comment 17 errata-xmlrpc 2018-03-07 09:51:51 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:0436

Comment 21 42wimdroid 2019-10-20 17:11:04 UTC
This issue still exists in docker-1.13.1-103.git7f2769b

I'm using the truncate deleted files workaround, at the moment, but upstream now has recently fixed this in https://github.com/moby/moby/pull/38859

Can this be backported?


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