Bug 1900694 - Global registration fails with Validation failed: Name can't be blank
Summary: Global registration fails with Validation failed: Name can't be blank
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Registration
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.9.0
Assignee: satellite6-bugs
QA Contact: Stephen Wadeley
URL:
Whiteboard:
: 1920231 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-23 14:40 UTC by Peter Ondrejka
Modified: 2021-04-21 13:18 UTC (History)
7 users (show)

Fixed In Version: foreman-2.3.1.3-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 13:18:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 31645 0 Normal Closed Global registration fails with Validation failed: Name can't be blank 2021-02-19 18:04:58 UTC

Description Peter Ondrejka 2020-11-23 14:40:37 UTC
Description of problem:

Attempting to register host via global registration fails on hosts 


ERROR: Validation failed: Name can't be blank, Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123

The curl command:

curl -k -X GET "https://myhg.redhat.com:9090/register?host_group_id=1&location_id=2&operatingsystem_id=1&organization_id=1&setup_insights=true&smart_proxy=1&activation_key=mykey" -H 'Authorization: Bearer ey...VvSI' | bash


Production log excerpt:

2020-11-23T15:21:20 [I|app|4851439e] Started POST "/register?url=https%3A%2F%2Fmyhostname.redhat.com%3A9090" for 2620:52:0:2598:224:e8ff:fe4a:b245 at 2020-11-23 15:21:20 +0100
2020-11-23T15:21:20 [I|app|4851439e] Processing by Api::V2::RegistrationController#host as HTML
2020-11-23T15:21:20 [I|app|4851439e]   Parameters: {"host"=>{"organization_id"=>"1", "location_id"=>"2"}, "setup_insights"=>"true", "url"=>"https://myhostname.redhat.com:9090"}
2020-11-23T15:21:20 [I|app|4851439e] Authorized user admin(Admin User)
2020-11-23T15:21:20 [D|app|4851439e] Post-login processing for admin
2020-11-23T15:21:20 [D|tax|4851439e] Current location set to none
2020-11-23T15:21:20 [D|tax|4851439e] Current organization set to none
2020-11-23T15:21:20 [D|tax|4851439e] Current location set to none
2020-11-23T15:21:20 [D|tax|4851439e] Current organization set to none
2020-11-23T15:21:20 [D|app|4851439e] Unpermitted parameters: :setup_insights, :url
2020-11-23T15:21:20 [D|app|4851439e] Unpermitted parameters: :setup_insights, :url
2020-11-23T15:21:20 [D|app|4851439e] Unpermitted parameters: :setup_insights, :url
2020-11-23T15:21:20 [W|app|4851439e] Not queueing Host::Managed: ["Name can't be blank", "Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123"]
2020-11-23T15:21:20 [W|app|4851439e] Not queueing Host::Managed: ["Name can't be blank", "Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123"]
2020-11-23T15:21:20 [W|app|4851439e] Not queueing Host::Managed: ["Name can't be blank", "Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123"]
2020-11-23T15:21:20 [W|app|4851439e] Not queueing Discovery reboot: Name can't be blank and Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123
2020-11-23T15:21:20 [I|app|4851439e]   Rendering text template
2020-11-23T15:21:20 [I|app|4851439e]   Rendered text template (Duration: 0.0ms | Allocations: 2)
2020-11-23T15:21:20 [I|app|4851439e] Completed 422 Unprocessable Entity in 71ms (Views: 0.4ms | ActiveRecord: 43.4ms | Allocations: 18883)

Version-Release number of selected component (if applicable):
Satellite 6.9 snap 2

How reproducible:
always

Comment 1 Marek Hulan 2021-01-13 15:09:32 UTC
Peter, is this still reproducible on a recent snap? The log shows that the hostname was not sent in the request at all. Was this registration through Capsule or directly to the Satellite? I assume it was through Capsule because of the url parameter. I think I've seen something similar, here is what it fixed in the upstream https://github.com/theforeman/smart-proxy/pull/778/files but I thought this was fixed on time in 2.3, so should be already present in Satellite. IIRC snap 2 was built on RC2, so chances are, this is already fixed.

Comment 2 Leos Stejskal 2021-01-14 11:52:42 UTC
I tried it today and I couldn't reproduce it,
as Marek mention above, I believe that the issue have been already fixed in previous versions.

Comment 3 Peter Ondrejka 2021-01-14 14:15:15 UTC
Marek, Leos, I'm still able to reproduce this on 6.9 snap 8. It is specific to registration via Capsule, direct registration to Satellite works as expected. I confirm that the changes from  https://github.com/theforeman/smart-proxy/pull/778/files are included in the snap.

Comment 4 Leos Stejskal 2021-01-15 07:38:42 UTC
Created redmine issue https://projects.theforeman.org/issues/31645 from this bug

Comment 5 Bryan Kearney 2021-01-15 14:05:15 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31645 has been resolved.

Comment 9 Peter Ondrejka 2021-01-25 12:48:42 UTC
Verified on Satellite 6.9 snap 10

Comment 10 Leos Stejskal 2021-02-12 09:03:23 UTC
*** Bug 1920231 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2021-04-21 13:18:56 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.9 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:1313


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