Bug 2030715

Summary: hammer content-[import,export] uses /tmp directory for temporary decompression location
Product: Red Hat Satellite Reporter: Taft Sanders <tasander>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lai <ltran>
Severity: high Docs Contact:
Priority: medium    
Version: 6.10.1CC: ahumbe, dkliban, ggainey, jjansky, msunil, pcreech, pratshar, rchan, rmynar, saydas, snarya, sraut, wpinheir
Target Milestone: 6.11.0Keywords: PrioBumpGSS, Triaged, UserExperience
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: pulpcore-3.16.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2059395 (view as bug list) Environment:
Last Closed: 2022-07-05 14:31:01 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:

Description Taft Sanders 2021-12-09 14:57:09 UTC
Description of problem:
When importing or exporting content from Satellite using hammer, the python tempfile library that is used is the /tmp folder in most cases. There is no mention that this /tmp directory would need to be of any specific size exporting or importing content into Satellite 6.

Version-Release number of selected component (if applicable):
python3-pulpcore-3.14.9-1.el7pc.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Have a Satellite with a separate /tmp partition from /var/lib/pulp.
2. Sync a bunch of content on the Satellite under immediate sync policy and export it as a library export.
3. Import this into another organization and watch the decompression of the export tarball use the /tmp directory as its decompression folder

Actual results:
/tmp runs out of space in most cases because no recommendation/requirement is mentioned for this process. Also, no option to use as a tempdir is offered with hammer.

Expected results:
1. Set the tempdir location in (https://github.com/pulp/pulpcore/blob/d6f5d00ef47d1cdb00863339336d65f399b59ee7/pulpcore/app/tasks/importer.py#L118) to /var/lib/pulp where the largest available space would possibly be.

or

2. Allow the option to set the tempdir with the hammer content-import command

or

3. Note in the documentation that the /tmp directory will be used as the temporary decompression location for all content-import operations. Please make sure to have the available space on the server as required.

Additional info:
Opening the bugzilla with the source (pulp) to see if this default behavior for using tempfile with no location specified is what is wanted for the default. If not then perhaps having the option with hammer to set an env variable used by python tempfile library (TMPDIR, TEMP, TMP) could be set so that the location for a larger available location can be specified. If not this, then maybe a documentation change to call out /tmp as potentially needing a LOT of available space for this process.

Comment 3 Grant Gainey 2022-01-26 18:53:19 UTC
*** Bug 2042335 has been marked as a duplicate of this bug. ***

Comment 9 Lai 2022-04-18 17:42:47 UTC
Steps to reproduce

1. Change settings for rhel and custom repos to use "Immediate" download policy
2. enable a few rhel repos (ansible + collections)
3. Sync repos
4. Create custom repos
5. sync custom repos
6. create cv and add rhel and custom repos
7. publish cv
8. check /var/lib/pulp/tmp and get the size of the folder (du -sh <folder>)
9. check /var/tmp and get the size of the folder
10. export cv or library
11. check 8,9 for any changes

expected:
/tmp dir on both /var/lib/pulp/tmp and /var/tmp should not have change

actual: 
/tmp dir on both /var/lib/pulp/tmp and /var/tmp should not have change

Each tmp dir has 4k of space and after export, they still have 4k or export.

Verified on 6.11 snap 16 with python38-pulpcore-3.16.6-1.el8pc.noarch on rhel7 and rhel8

Comment 13 errata-xmlrpc 2022-07-05 14:31:01 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.11 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-2022:5498