Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1771404

Summary: Failed to remove life cycle environment from the capsule due to error in the option "--environment-id"
Product: Red Hat Satellite Reporter: Devendra Singh <desingh>
Component: Satellite CloneAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: ekohlvan, jomitsch, jyejare, pcreech
Target Milestone: 6.7.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:26:24 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 Devendra Singh 2019-11-12 10:03:55 UTC
Description of problem: Failed to remove life cycle environment from the capsule due to error in the option "--environment-id"

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

How reproducible:
1/1

Steps to Reproduce:
1. Use a specific customer database to perform satellite clone operation.
2. Satellite-clone started successfully.
3. During Lifecycle environment cleanup we get some unknown option error. 

Actual results:
Warning: Option --environment-id is deprecated. Use --lifecycle-environment-id instead
Could not remove the lifecycle environment from the capsule:
Error: Option '--environment-id': Numeric value is required..


Expected results:
Life cycle environment dissociation should be completed successfully without any warning or error.

Additional info:

We are using the upstream master branch for satellite cloning.

Comment 7 John Mitsch 2019-12-09 18:36:50 UTC
The issue seems to be with a leftover "/etc/hammer/cli.modules.d/csv.yml" file, which is for the unsupported hammer_cli_csv rpm. This file still marks the hammer module as enabled. The workaround is to remove /etc/hammer/cli.modules.d/csv.yml from config_files.tar.gz in the backup or add a step in sat-clone code to do so.

I can add a step in sat-clone to ensure this file is removed, which should help things, and also make sure that the hammer warnings don't cause errors like this for all commands. I'm not clear if the installer needs any changes. That file is not owned by any packages so it may be left hanging around other installations. 

Ewoud, do you think any changes will be needed for the installer?

Comment 8 Ewoud Kohl van Wijngaarden 2019-12-10 12:43:10 UTC
No, the installer has never been aware of the hammer cli csv plugin. In a normal workflow the /etc/hammer/cli.modules.d/csv.yml file is owned by (tfm-)rubygem-hammer_cli_csv and cleaned up when you yum remove it. Potentially leaving it as .rpmsave. That means it's a problem that sat-clone needs to solve.

Comment 9 John Mitsch 2019-12-11 14:57:26 UTC
> In a normal workflow the /etc/hammer/cli.modules.d/csv.yml file is owned by (tfm-)rubygem-hammer_cli_csv and cleaned up when you yum remove it. Potentially leaving it as .rpmsave.

It doesn't look like this file is owned by the rpm and this is why it is sticking around on upgrades, even after the rpm is removed. I'll add a step to remove it from clone, but iiuc it will still be there on non-cloned systems. 

Should the installer ensure that this file is removed to be sure its properly cleaned up?

Comment 10 Ewoud Kohl van Wijngaarden 2019-12-13 16:40:34 UTC
Are you sure the RPM is actually installed on the system you're testing? https://github.com/theforeman/foreman-packaging/blob/96875ed2cfd5454b304c3db8b2eb7824c8bfd87d/packages/katello/rubygem-hammer_cli_csv/rubygem-hammer_cli_csv.spec#L63 suggests it's owned by the RPM.

It feels odd to let the installer ensure a file is absent while it never installed the plugin. AFAIK it was always pulled in via the satellite-cli meta-package. On a clone, do you install the old (6.5, right?) RPM that actually contains the files or do you install 6.6 straight away?

Comment 11 John Mitsch 2019-12-16 19:59:56 UTC
A sat-clone PR to fix this was merged: https://github.com/RedHatSatellite/satellite-clone/pull/367

Comment 17 errata-xmlrpc 2020-04-14 13:26:24 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/RHSA-2020:1454