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
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.
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.
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.
Created redmine issue https://projects.theforeman.org/issues/31645 from this bug
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31645 has been resolved.
Verified on Satellite 6.9 snap 10
*** Bug 1920231 has been marked as a duplicate of this bug. ***
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