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 2124047 - Accessing an external capsule from UI, shows "Last sync failed: 404 Not Found" even if the last capsule content sync was successful in Satellite 6.12
Summary: Accessing an external capsule from UI, shows "Last sync failed: 404 Not Found...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Capsule - Content
Version: 6.12.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: 6.12.0
Assignee: Chris Roberts
QA Contact: Vladimír Sedmík
URL: https://projects.theforeman.org/issue...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-04 08:57 UTC by Sayan Das
Modified: 2022-11-16 13:35 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-katello-4.5.0.17-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:35:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
UI error while accessing the capsule (26.86 KB, image/png)
2022-09-04 08:58 UTC, Sayan Das
no flags Details
Search query used to see the capsule related tasks by Satellite (11.51 KB, image/png)
2022-09-04 08:58 UTC, Sayan Das
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35552 0 Normal Closed Accessing an external capsule from UI, shows "Last sync failed: 404 Not Found" even if the last capsule content sync was... 2022-09-23 13:26:47 UTC
Github Katello katello pull 10287 0 None open Fixes #35552 - Filter failed capsule tasks by only sync 2022-09-22 15:39:53 UTC
Red Hat Issue Tracker SAT-12792 0 None None None 2022-09-07 14:48:57 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:35:49 UTC

Description Sayan Das 2022-09-04 08:57:24 UTC
Description of problem:

Accessing an external capsule from UI, shows "Last sync failed: 404 Not Found" even if the last capsule content sync was successful.

But it does not seems like the error is related to Capsule sync but If the very last task related to that capsule [ lest say a REX job ] fails, then also It shows that error and It can give a very wrong impression to the customer. 

The type of search it does for the tasks is "resource_id = 2 AND resource_type = SmartProxy" which is fine but It lists not just the sync tasks but the REX jobs via that capsule as well.


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

Satellite\Capsule 6.12


How reproducible:

Always


Steps to Reproduce:

1. Install A Satellite and External Capsule 6.12

2. Sync some content in satellite as well as capsule

3. Ensure that Ansible feature is not enabled in capsule ( which should be happening by default ).

4. Register a system with capsule via global registration method

5. Turn on the "Prefer registered through Capsule for remote execution" setting in Administer --> Settings --> Content tab of Satellite/

6. Run an Ansible-based job on the target server (ensuring that REX smart-proxy is selected as capsule) and let the job fail.

7. Come back to the Infrastructure --> Capsules page and click open the capsule.



Actual results:


In Step 7, 

* Top right corner of the UI will immediately show "Last sync failed: 404 Not Found"

* Under the Content Sync section, the progress bar will be red and halfway filled, giving the notion that Capsule may not have been properly synced.


Expected results:

The "Content Sync" segment or the Capsule sync status in Satellite UI , should only rely on the last successful\failed capsule sync task and It should not show the status based on the status of the last REX job executed on a target host via the capsule. 


Additional info:

Screenshots attached

Comment 1 Sayan Das 2022-09-04 08:58:04 UTC
Created attachment 1909458 [details]
UI error while accessing the capsule

Comment 2 Sayan Das 2022-09-04 08:58:49 UTC
Created attachment 1909459 [details]
Search query used to see the capsule related tasks by Satellite

Comment 4 Brad Buckingham 2022-09-07 14:28:27 UTC
Is this a regression from Satellite 6.11?

Comment 5 Sayan Das 2022-09-07 15:23:09 UTC
Yes. It is indeed.

On 6.11, No matter how hard I try to get the Ansible REX job executed via a capsule that does not have the ansible feature enabled, It will tell me this:

~~
Failed to initialize: RuntimeError - Could not use any Capsule for the Ansible job. Consider configuring remote_execution_global_proxy, remote_execution_fallback_proxy in settings
~~


And then the task will not even trigger.


For 6.12, The task will trigger via that bad capsule and raise the tracebacks as I had reported.

Comment 7 Vladimír Sedmík 2022-09-30 10:23:28 UTC
Reproduced in 6.12.0 snap 12, verified in 6.12.0 snap 13:
1) Had a Satellite, Capsule (with Ansible enabled) and a host registered through the Capsule.
2) Triggered an Ansible REX job, checked it run through the Capsule -> it succeeded.
3) Removed Capsule's key from the host's authorized_keys and rerun the job -> it failed, leaving a failed task related to the Capsule.
4) Checked the Capsule's page in WebUI -> no errors were displayed, no red bar.
5) Triggered a Capsule sync task and stopped the services on the Capsule side -> correct error was displayed.
6) Reloaded the Capsule page -> correct error was displayed for the last sync task (even after the services were restarted).

Comment 11 errata-xmlrpc 2022-11-16 13:35:39 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 (Important: Satellite 6.12 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:8506


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