Bug 1936946

Summary: bootdisks are left in privatetmp of httpd
Product: Red Hat Satellite Reporter: Jan Jansky <jjansky>
Component: Bootdisk PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: high    
Version: 6.11.0CC: ehelms, gpadholi, jsenkyri, jtougne, ktordeur, lzap, pdwyer, pmendezh, ramsingh, smajumda, wclark
Target Milestone: UnspecifiedKeywords: Regression, Reopened
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_bootdisk-19.0.4-1.el7sat.noarch.rpm Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-01 12:50:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
HOTFIX tfm-rubygem-foreman_bootdisk RPM for Satellite 6.9.7 none

Description Jan Jansky 2021-03-09 14:15:04 UTC
Description of problem:
When generating any bootdisk for host it will stay forever in PrivateTmp.

for example:

# ls -al /tmp/systemd-private-97a048f3f7074e34b204f5f3ccd867f8-httpd.service-mk41vo/tmp/
total 4
drwxrwxrwt. 10 root    root    4096  9. bře 15.03 .
drwx------.  3 root    root      17  3. bře 11.56 ..
drwx------.  3 foreman foreman   19  5. bře 14.51 bootdisk-iso-20210305-31878-1820308
drwx------.  3 foreman foreman   37  9. bře 13.53 bootdisk-iso-20210309-17692-1gzp36
drwx------.  3 foreman foreman   37  9. bře 13.53 bootdisk-iso-20210309-17692-svhj11
drwx------.  3 foreman foreman   37  9. bře 13.54 bootdisk-iso-20210309-17692-xgh2jm
drwx------.  3 foreman foreman   37  9. bře 14.28 bootdisk-iso-20210309-21133-ka0iql
drwx------.  3 foreman foreman   37  9. bře 13.52 bootdisk-iso-20210309-30111-bo7bsp
drwxr-xr-x.  3 foreman foreman   18  3. bře 11.56 bundler
drwx------.  2 foreman foreman   71  5. bře 14.51 d20210305-31878-1n0nvh9

I have tested the same on Satellite 6.7 and file got created apx for 1 seconds and then its cleaned.

This is causing filling up /tmp and possible crash of other services.


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

How reproducible: Always


Steps to Reproduce:
1. Generate any type of Boot Disk (WebUI -> Hosts -> select Host -> Bootdisk -> *)
2. file got created in /tmp/systemd-private*httpd.service*/tmp/

Actual results:
File stays forever

Expected results:
Removed when its not needed as in 6.7.

Comment 1 Lukas Zapletal 2021-03-09 14:16:35 UTC
Important bug, disk can be filled with this one, CUs need to call in and fix their Satellites. I will fix this right away, can do 6.9 as well.

The fix will be small but a packaging change will be needed to introduce new tmpfiles entry.

Comment 2 Lukas Zapletal 2021-03-16 16:08:28 UTC
For the record, the upstream patch was modified to delete old bootdisks directly. It can be a nice workaround until this is released.

Comment 3 Bryan Kearney 2021-04-15 10:46:10 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32057 has been resolved.

Comment 6 Roman Plevka 2021-07-02 07:56:26 UTC
VERIFIED
on sat6.10.0 snap #7

after generating of the host image, the tmp dir is empty:

```
# ls -la /tmp/systemd-private-9888238d758641448424e63c474fec60-httpd.service-eXISfa/tmp/
total 0
drwxrwxrwt. 2 root root  6 Jul  1 18:50 .
drwx------. 3 root root 17 Jul  1 18:50 ..

```

Comment 9 errata-xmlrpc 2021-11-16 14:10:21 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 (Moderate: Satellite 6.10 Release), 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/RHSA-2021:4702

Comment 10 wclark 2021-11-17 22:58:48 UTC
Created attachment 1842446 [details]
HOTFIX tfm-rubygem-foreman_bootdisk RPM for Satellite 6.9.7

Comment 11 wclark 2021-11-17 23:00:18 UTC
HOTFIX RPMs are available for Satellite 6.9.7

To obtain the Hotfix RPMs, download the below Bugzilla attachments:
- HOTFIX tfm-rubygem-foreman_bootdisk RPM for Satellite 6.9.7

INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of Satellite 6.9.7 server

2. Copy the downloaded Hotfix RPM to Satellite server

3. # yum install tfm-rubygem-foreman_bootdisk-17.0.2-3.HOTFIXRHBZ1936946.el7sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 12 Lukas Zapletal 2021-12-15 07:31:14 UTC
*** Bug 1980223 has been marked as a duplicate of this bug. ***

Comment 13 Lukas Zapletal 2021-12-15 07:33:43 UTC
For the record, this is how Satellite 6.10 cleans bootdisk ISOs now:

- temporary directory which is used to build the ISO is removed right after it is used
- all tmp/bootdisk-iso-* files which are older than 30 minutes are deleted on every bootdisk build.

Comment 17 Lukas Zapletal 2022-03-01 12:50:11 UTC
I have found the bug, the fix was not correct. This patch solves it:

https://github.com/theforeman/foreman_bootdisk/pull/114

On top of that, bootdisks do not belong to tmpfs and they should be created in /var/tmp instead as they can be big. So I am filing a new BZ:

https://bugzilla.redhat.com/show_bug.cgi?id=2059566

TRIAGE: The bugfix was incorrect, I am reopening this for 7.0.

Comment 18 RHEL Program Management 2022-03-01 12:50:20 UTC
This bug was previously closed after it was shipped in the Red Hat Errata linked above. Unfortunately our workflow does not support re-opening bugs that have already been shipped. If you are still effected by this bug please open a new bug and reference this pre-existing Bugzilla and indicate that it does not appear to be resolved.

Comment 21 Lukas Zapletal 2022-05-03 09:41:29 UTC
Due to a process problem, this was not properly released. Creating a new BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2081280