Bug 1745081 - Hammer content view import failing to import when using relative path.
Summary: Hammer content view import failing to import when using relative path.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Inter Satellite Sync
Version: 6.5.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-23 15:06 UTC by Rudnei Bertol Jr.
Modified: 2022-03-18 19:44 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-18 19:44:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Rudnei Bertol Jr. 2019-08-23 15:06:56 UTC
Description of problem:

When using a relative path to run the `hammer content-view version import` the import is failing due to the command search the files unpacked from the tarball on the root ('/') directory.  


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

~~~
~]# hammer --version
hammer (0.15.1.2)
 * hammer_cli_csv (unknown version)
 * hammer_cli_foreman (0.15.1.1)
 * hammer_cli_foreman_admin (0.0.8)
 * hammer_cli_foreman_ansible (unknown version)
 * hammer_cli_foreman_bootdisk (0.1.3.3)
 * hammer_cli_foreman_discovery (1.0.0)
 * hammer_cli_foreman_docker (unknown version)
 * hammer_cli_foreman_openscap (0.1.6)
 * hammer_cli_foreman_remote_execution (unknown version)
 * hammer_cli_foreman_tasks (unknown version)
 * hammer_cli_foreman_templates (0.1.2)
 * hammer_cli_foreman_virt_who_configure (unknown version)
 * hammer_cli_katello (0.16.0.11)
~~~


How reproducible:

Generate an exported content view version and import it on a Satellite, cd into '/var/lib/pulp/katello-export' directory and run the 'hammer content-view version import' using the relative path.


I have confirmed that if you place the tarball into /var/lib/pulp/katello-export, cd into /var/lib/pulp/katello-export, and run the import using the fully qualified path to the export file that it does work, as we can see on the following output

~~~
[root@rhel2 katello-export]# hammer content-view version import --export-tar export-gluster-3.tar --organization-id 1
[...............................................................................................................................................................................................................................] [100%]
No new packages.
Error: RPM1004: Error retrieving metadata: [Errno 2] No such file or directory: '//./export-gluster-3/My_Laptop/content_views/gluster/1.0/content/dist/rhel/server/7/7Server/x86_64/rhgs-server/3.1/os/repodata/repomd.xml'
Could not impot the content view:
  augeas-devel-1.4.0-9.el7.x86_64.rpm not available in repository Red_Hat_Gluster_Storage_3_Server_RPMs_x86_64_7Server
~~~

Steps to Reproduce:
1. Copy the tarball file exported to '/var/lib/pulp/katello-export' directory
2. Cd into '/var/lib/pulp/katello-export'
3. Run the `hammer content-view version import` command using the relative path. 

Actual results:

The importer process is failing to import the rpm files due to the permission.


Expected results:

The rpm files would be imported on the Satellite.


Additional info:

Comment 3 Jeffrey Cutter 2019-08-23 16:10:07 UTC
Similarly, it will fail if you do not change directory to /var/lib/pulp/katello-export before running the command.  It would be desirable to be able to run the command from anywhere.

If you are in /var/lib/pulp/katello-export and specify a relative path to the file it errors:

[root@rhel2 katello-export]# hammer content-view version import --export-tar export-gluster-3.tar --organization-id 1
[...............................................................................................................................................................................................................................] [100%]
No new packages.
Error: RPM1004: Error retrieving metadata: [Errno 2] No such file or directory: '//./export-gluster-3/My_Laptop/content_views/gluster/1.0/content/dist/rhel/server/7/7Server/x86_64/rhgs-server/3.1/os/repodata/repomd.xml'
Could not import the content view:
  augeas-devel-1.4.0-9.el7.x86_64.rpm not available in repository Red_Hat_Gluster_Storage_3_Server_RPMs_x86_64_7Server


If you are not in /var/lib/pulp/katello-export and specify a full path to the file it also errors:

[root@rhel2 ~]# hammer content-view version import --export-tar /var/lib/pulp/katello-export/export-ansible-8.tar --organization-id 1
[....................................                                                                       ] [33%]
No new packages.
Error: RPM1004: Error retrieving metadata: [Errno 2] No such file or directory: '///var/lib/pulp/katello-export/export-ansible-8/My_Laptop/content_views/ansible/4.0/content/dist/rhel/server/7/7Server/x86_64/ansible/2.6/os/repodata/repomd.xml'
[..........................................................................................................] [100%]
[root@rhel2 ~]#

Comment 4 Mike McCune 2022-01-28 22:30:40 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team. Thank you.

Comment 5 Mike McCune 2022-03-18 19:44:22 UTC
Thank you for your interest in Red Hat Satellite. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this feel free to contact your Red Hat Account Team. Thank you.


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