Hammer content export fails with "Path '/the/path' is not an allowed export path"

Solution Verified - Updated

Environment

Red Hat Satellite 6.12

Issue

When exporting content from a Satellite 6.12 the provided custom path from the Satellite Settings page is not allowed.

Resolution

The correct method to set a custom export path for a Satellite is to use the installer option --foreman-proxy-content-pulpcore-additional-export-paths followed by the path you wish to export the content to.

  1. Create a custom location or edit one that exists.
    NOTE: Please ensure the path is readable and writable by the pulp user and group.
    NOTE: It is best practice to make a custom path for this content and avoid using a likely shared path with other processes on the server.
    Example:
    Do Not use: /tmp/
    Instead, USE: /tmp/satellite-export

  2. Once you have your custom folder created and permissions set to allow pulp user and group read/write access, use the following command to set this custom location on the Satellite: (Using /var/lib/pulp/new-export as an example)

    [root@host ~]# satellite-installer --foreman-proxy-content-pulpcore-additional-export-paths /var/lib/pulp/new-export
    
  3. After adding the new path to the list of allowed paths, you will need to set the default export path in the Satellite WebUI or using the hammer command:
    Satellite WebUI:

     Administrator > Settings > search for `pulpcore_export_destination`
    

    Hammer CLI: (Replace /var/lib/pulp/new-export with whatever path you desire)

     # hammer settings set --name pulpcore_export_destination --value /var/lib/pulp/new-export
    

Root Cause

Setting the pulpcore_export_destination alone on the Satellite WebUI or via the hammer command does not change the settings for pulp to use this new additional location. An RFE for having the installer option set this value to the new value provided to the installer has been opened here This content is not included.2217525.

Diagnostic Steps

Setting the pulpcore_export_destination only on the Settings page or via hammer will result in the error like the one seen below:

[root@bombsat612 ~]# hammer content-export complete repository --id 6
[...................................................................................................................................................................] [100%]
Error: Error message: the server returns an error
HTTP status code: 400
Response headers: {"Date"=>"Wed, 17 May 2023 16:24:38 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"GET, POST, HEAD, OPTIONS", "X-Frame-Options"=>"DENY", "Content-Length"=>"171", "X-Content-Type-Options"=>"nosniff", "Referrer-Policy"=>"same-origin", "Correlation-ID"=>"80d36b95-7540-4268-adb0-1db9302f56be", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 bombsat612.d.sysmgmt.cee.redhat.com", "Connection"=>"close"}
Response body: {"path":["Path '/tmp/Default_Organization/Export-Red_Hat_Satellite_Client_6_for_RHEL_7_Server_RPMs_x86_64-6/6.0/2023-05-17T12-24-38-04-00' is not an allowed export path"]}

A request to have this information added to the documentation has been filed here This content is not included.2217528.

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.