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 1921453 - Global Registration: page generate command without Satellite or capsule hostname
Summary: Global Registration: page generate command without Satellite or capsule hostname
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Registration
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.10.0
Assignee: satellite6-bugs
QA Contact: Stephen Wadeley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-28 02:20 UTC by Ashfaqur Rahaman
Modified: 2021-11-16 14:10 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:09:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 31240 0 Normal New Registration Form - React way & UX improvements 2021-02-15 03:22:41 UTC
Foreman Issue Tracker 31821 0 Normal New Host Registration - Different current URL than in CA certificate subject 2021-02-15 03:22:41 UTC
Red Hat Knowledge Base (Solution) 5909271 0 None None None 2021-03-26 14:34:56 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:10:05 UTC

Description Ashfaqur Rahaman 2021-01-28 02:20:28 UTC
Description of problem:
In Global Registration page if we do not select Capsule and generate the command, it generates the command with Satellite IP 

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


How reproducible:
Always

Steps to Reproduce:
1. In global registration page, Select "Operating System" as Ubuntu
2. Do not select any Capsule
3. Generate Command 

Actual results:

the url generated with satellite IP: 

----
curl -X GET "https://10.71.133.16/register?location_id=2&operatingsystem_id=2&organization_id=1" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MTE4MDAxNDEsImp0aSI6IjNhYjNhYmJiNzNmZmI4YmJiMGZmODE5ZDk3OTIyOGVlZjU0ZmVhMTU2NDU5OGEwNGYxYTJlMWMwODA2YjExZjEiLCJleHAiOjE2MTE4MTQ1NDF9.9B5ldgHdua--hZ826dQh-n1Qj840Yy1HBwEDiAUTmgE' | bash
----

After selecting the capsule : 
----
curl -X GET "https://sat69.apac-mps.anzlab.bne.redhat.com:9090/register?location_id=2&operatingsystem_id=2&organization_id=1" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MTE4MDAxNjIsImp0aSI6IjY0ZmY4ZTBhMDYyMTM1YmYyM2RmNmYxMTk1MmNjOTQ3OTE2ZmEzNTkwZmIxZjZkODMzMjk4MDFhNWUxOTM2MjMiLCJleHAiOjE2MTE4MTQ1NjJ9.Z6QtK78tC4r2nS7X1Vl6OPup1UflzfFYysSxycfSIbA' | bash
----

Expected results:
1. It must check and if the field is blank it should give notification that no capsule has selected and force user to select one

2. If there is only 1 Satellite/capsule it should select the one by default. 


Additional info:
n/a

Comment 1 Ashfaqur Rahaman 2021-01-28 02:28:20 UTC
Attempting to register failing with below error: 

----
# curl -X GET --insecure "https://10.71.133.16/register?location_id=2&operatingsystem_id=3&organization_id=1" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MTE4MDA2NDgsImp0aSI6IjI5NGUzNDg0OTU2OGRiNzFmZTU1OTBhYTEwYWM2ZWVmYmZjOTA3Y2E0OGMxN2M1ZDljNjU5OTdkOTdiNWYyNDgiLCJleHAiOjE2MTE4MTUwNDh9._QznlxLsTvXcHl6YwiWeKyI3I2GtZ0LJ5x_yLtfhAtc' | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10267    0 10267    0     0  27378      0 --:--:-- --:--:-- --:--:-- 27451
#
# Running registration
#
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL: no alternative certificate subject name matches target host name '10.71.133.16'
More details here: https://curl.haxx.se/docs/sslcerts.html
-----

It works when I tried with hostname. 

~~~~~~
[root@localhost ~]# curl -X GET --insecure "https://sat69.apac-mps.anzlab.bne.redhat.com:9090/register?location_id=2&operatingsystem_id=3&organization_id=1" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MTE4MDA3ODIsImp0aSI6ImU1ZWUxZWYzZThhYjM3YTJiY2U5MTYzNTZmZDBkZDdmNmFjZDZlNWQwOGU1YjI0MTlhZjFjNmY1MDFkMzAxMWQiLCJleHAiOjE2MTE4MTUxODJ9.ozZrm4jQa1jNolZ9T7Ph7vxBAuBza4Phb_qAki9NJIQ' | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10349  100 10349    0     0  21077      0 --:--:-- --:--:-- --:--:-- 21077
#
# Running registration
#
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10678  100 10549  100   129  13898    169 --:--:-- --:--:-- --:--:-- 14068
/usr/sbin/restorecon
Relabeled /root/.ssh from unconfined_u:object_r:ssh_home_t:s0 to system_u:object_r:ssh_home_t:s0
Relabeled /root/.ssh/authorized_keys from unconfined_u:object_r:ssh_home_t:s0 to system_u:object_r:ssh_home_t:s0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    27  100    27    0     0    245      0 --:--:-- --:--:-- --:--:--   247
Successfully enrolled host localhost with Foreman.
~~~~~~

Comment 2 Leos Stejskal 2021-02-05 11:39:59 UTC
Hi,
this is expected behavior, if you don't select capsule, Satellite's URL is going to be use.
But I guess it would be good idea to tell it user, instead of just showing blank value.
Added to https://projects.theforeman.org/issues/31240

The second issue, with the error "SSL: no alternative certificate subject name matches target host name '10.71.133.16'".
When you generated the registration command, what was the URL of the Satellite in that moment?
Command URL is generated from current URL (& protocol), like this:

- http://satellite.example.com => "curl -X GET http://satellite.example.com/register ..."
- https://satellite.example.com => "curl -X GET https://satellite.example.com/register ..."
- http://1.1.1.1 => "curl -X GET http://1.1.1.1/register ..."
- https://1.1.1.1 => "curl -X GET https://1.1.1.1/register ..."

I would say its expected behavior and users should not access Satellite by IP but rather by domain name,
but I'll look think about it and discuss it with the team.

Comment 3 Stephen Wadeley 2021-02-11 12:07:44 UTC
Hello Leos


We can ask DocsTeam to not state that step is optional, as docs currently does.

Connecting using FQDN (not IP or shortname) is stated in docs.

Thank you

Comment 4 Stephen Wadeley 2021-02-11 14:49:24 UTC
(In reply to Stephen Wadeley from comment #3)
> Hello Leos
> 
> 
> We can ask DocsTeam to not state that step is optional, as docs currently
> does.
> 
> Connecting using FQDN (not IP or shortname) is stated in docs.
> 
> Thank you

Hello Leos

Please approve or amend these changes:
https://github.com/theforeman/foreman-documentation/pull/386/files

Thank you

Comment 9 Stephen Wadeley 2021-07-14 18:34:33 UTC
(In reply to Stephen Wadeley from comment #4)
> (In reply to Stephen Wadeley from comment #3)
> > Hello Leos
> > 
> > 
> > We can ask DocsTeam to not state that step is optional, as docs currently
> > does.
> > 

Docs [1] now states

From the Capsule list, select the Capsule to register hosts through. You must select the internal Capsule if you do not want to use an external Capsule. 


[1] https://access.redhat.com/documentation/en-us/red_hat_satellite/6.9/html/managing_hosts/registering_hosts#registering-a-host-to-project-using-the-global-registration-template_managing-hosts

Comment 14 errata-xmlrpc 2021-11-16 14:09:54 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 (Moderate: Satellite 6.10 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-2021:4702


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