Bug 1907514 - Can not delete a host when the capsule it's registered to is down
Summary: Can not delete a host when the capsule it's registered to is down
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.8.0
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: 6.9.5
Assignee: Adam Ruzicka
QA Contact: Peter Ondrejka
URL:
Whiteboard:
: 1942366 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-14 16:41 UTC by Julio Entrena Perez
Modified: 2024-03-25 17:32 UTC (History)
18 users (show)

Fixed In Version: tfm-rubygem-foreman_remote_execution-4.2.3.1-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1973365 (view as bug list)
Environment:
Last Closed: 2021-08-31 12:04:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32606 0 Normal Closed Reimplement known host key removal 2021-07-20 15:25:45 UTC
Red Hat Knowledge Base (Solution) 5647401 0 None None None 2020-12-14 17:27:48 UTC
Red Hat Product Errata RHBA-2021:3387 0 None None None 2021-08-31 12:04:18 UTC

Description Julio Entrena Perez 2020-12-14 16:41:54 UTC
Description of problem:
Attempting to delete a host in the web ui while the capsule that it's registered to is down fails.
Satellite tries to contact the capsule to delete the SSH known host key, fails to contact the capsule because it's down and host is not deleted.

Version-Release number of selected component (if applicable):
satellite-6.8.1-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Register a host to a capsule
2. Run a remote command against the host
3. Shutdown the capsule
4. Attempt to delete the host

Actual results:
Via web ui, error message "Failed to delete <hostname>: []" is displayed.
Via hammer, "Host deleted." is returned with a 0 exit code but the host is not deleted.

Expected results:
Host is deleted.
The capsule may have been removed/destroyed and may no longer be available. This should not block deletion of hosts.

Additional info:

Comment 1 Julio Entrena Perez 2020-12-14 16:49:16 UTC
2020-12-14T16:13:13 [W|app|] Remove SSH known hosts for host.example.com task failed with the following error: ERF12-6886 [ProxyAPI::ProxyException]: Unable to remove host from known hosts ([SocketError]: Failed to open TCP connection to capsule.example.com:9090 (getaddrinfo: Name or service not known)) for Capsule https://capsule.example.com:9090/ssh
2020-12-14T16:13:13 [W|app|] Rolling back due to a problem: [#<Orchestration::Task:0x0000000011f995f0 @name="Remove SSH known hosts for host.example.com", @id="ssh_remove_known_hosts_interface_10.33.8.73_2", @status="failed", @priority=200, @action=[#<Nic::Bridge id: 15, mac: "52:54:00:14:4d:08", ip: "10.33.8.73", type: "Nic::Bridge", name: "host.example.com", host_id: 8, subnet_id: 1, domain_id: 1, attrs: {"bridge"=>true}, created_at: "2020-12-14 14:51:07", updated_at: "2020-12-14 15:03:18", provider: nil, username: nil, password: nil, virtual: true, link: true, identifier: "br0", tag: "", attached_to: "", managed: true, mode: "balance-rr", attached_devices: "", bond_options: "", primary: true, provision: true, compute_attributes: {}, execution: true, ip6: "", subnet6_id: nil>, :drop_from_known_hosts, 2], @created=1607962393.0890071, @timestamp=2020-12-14 16:13:13 UTC>]
2020-12-14T16:13:13 [I|bac|] Task {label: Actions::Katello::Host::Destroy, id: e81809da-1c33-4a0c-84ae-ab20536a62e9, execution_plan_id: a8f006df-a5ac-420d-90d3-b49336a39e42} state changed: stopped  result: success
2020-12-14T16:13:13 [I|bac|] Task {label: Actions::Katello::Host::Destroy, id: e81809da-1c33-4a0c-84ae-ab20536a62e9, execution_plan_id: a8f006df-a5ac-420d-90d3-b49336a39e42} state changed: stopped  result: success
2020-12-14T16:13:13 [I|bac|] Task {label: Actions::BulkAction, id: 22c644c1-e0d7-49c2-88f0-514ca9140cf1, execution_plan_id: 9d74e080-ea14-4eb0-8c8d-ca6e30a39790} state changed: stopped  result: success
2020-12-14T16:13:13 [I|bac|] Task {label: Actions::BulkAction, id: 22c644c1-e0d7-49c2-88f0-514ca9140cf1, execution_plan_id: 9d74e080-ea14-4eb0-8c8d-ca6e30a39790} state changed: stopped  result: success

Comment 16 Adam Ruzicka 2021-04-30 11:55:52 UTC
*** Bug 1942366 has been marked as a duplicate of this bug. ***

Comment 21 Adam Ruzicka 2021-07-13 13:41:48 UTC
On another thought, REX has diverged quite a bit since 6.9 went out and a cherry-pick would be better. The patches should still apply cleanly, if not, feel free to ping me.

Comment 25 Peter Ondrejka 2021-08-16 09:52:11 UTC
Verified on Satellite 6.9.5 sn 2, host can be successfully removed even if the rex capsule it was registered to is down

Comment 30 errata-xmlrpc 2021-08-31 12:04:00 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 (Satellite 6.9.5 Async Bug Fix Update), 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/RHBA-2021:3387


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