Bug 1958379

Summary: Incorrect URL associated with the insights hyperlink under cockpit web console > Health Tile
Product: Red Hat Enterprise Linux 8 Reporter: Shivam Gupta <shivagup>
Component: cockpitAssignee: Martin Pitt <mpitt>
Status: CLOSED ERRATA QA Contact: Jan Ščotka <jscotka>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: mpitt, sbarcomb, sbrown, sbunciak
Target Milestone: betaKeywords: Triaged
Target Release: 8.5   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cockpit-244.1-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:33:27 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 Shivam Gupta 2021-05-07 18:56:40 UTC
Description of problem:
The RHEL8 Cockpit Web console integrated with incorrect insights URL and redirecting users to incorrect location at cloud.redhat.com to access the host information. The hyperlink within the cockpit web console integration is leading users to the incorrect location by appending "/insights" at the end of the URL. 


Version-Release number of selected component (if applicable):
RHEL8.3
Cockpit Version 224.2. 

[root@rhel8 ~]# rpm -qa | grep -i cockpit
cockpit-packagekit-224.2-1.el8.noarch
cockpit-bridge-224.2-1.el8.x86_64
cockpit-ws-224.2-1.el8.x86_64
cockpit-224.2-1.el8.x86_64
cockpit-storaged-224.2-1.el8.noarch
subscription-manager-cockpit-1.27.16-1.el8.noarch
cockpit-system-224.2-1.el8.noarch
cockpit-podman-18.1-2.module+el8.3.0+8221+97165c3f.noarch
[root@rhel8 ~]# 


Steps to Reproduce:
1- Go to cockpit web console http://127.0.0.1:9090/system
2- Under "Health" tile, Click on hyperlink "Insights:1 moderate hit"
3- It will redirect user to the wrong url "https://cloud.redhat.com/insights/inventory/xx-xxx-xxx/insights" which results into the below error.

-----
Bad Request:

'insights' does not match '^[0-9a-fA-F]{8}\\-[0-xxx-F]{4}\\-[0-9a-xxx}\\-[0-9a-fA-F]{4}\\-[0-9axxx{12}$|^[0-xxxF]{8}[0-9a-fA-F]{4}[0-9a-fA-F]{4}[0-9a-fA-F]{4}[0-9a-fA-F]{12}$' Failed validating 'pattern' in schema['items']: {'format': 'uuid', 'pattern': '^[0xxx-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}$|^[0-9a-fA-F]{8}[0-9a-fA-F]{4}[xxx-F]{4}[0-9a-fA-F]{4}[xxx]{12}$', 'type': 'string'} On instance[0]: 'insights'
Request Id: xxxxxx
----

Actual results:
We are able to access the appropriate location by removing that "insights" at the very end of the URL.

Expected results:
It should redirect users to the correct URL "https://cloud.redhat.com/insights/inventory/xx-xxx-xxx"

Comment 3 Martin Pitt 2021-05-08 10:06:23 UTC
This is a notification from the subscriptions page, reassigning.

Comment 4 Martin Pitt 2021-05-11 14:57:20 UTC
Moving back.. turns out we never moved that to a proper notification from s-m-cockpit, and cockpit-system has (basically) duplicated insights checking code.

Comment 6 Martin Pitt 2021-05-12 11:57:27 UTC
Fixed in 244, will be packaged for 8.5 in the next days.

Comment 7 Martin Pitt 2021-05-21 14:06:39 UTC
*** Bug 1963108 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2021-11-09 19:33:27 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 (cockpit bug fix and enhancement 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:4380