Bug #23232

Updated by Chris Duryee over 5 years ago

If you register a brand-new client to a new capsule on a new katello using without, katello, you will get this error: 

 Validation failed: Name must not include periods 

 repro steps: 

 * vagrant up centos7-katello-3.6                                               
 * vagrant up centos7-foreman-proxy-3.6                                           
 * vagrant up centos7 for use as test client                            

 on katello server:                                                     

 hammer ping                                                            
 hammer -u admin -p changeme activation-key create --name MYAK --organization-id 1                                                             
 hammer -u admin -p changeme hostgroup create --name MYHG               

 on client:                                                        

 yum install subscription-manager (bootstrap will need it) 
 # ensure you are using a without 
 curl > ./                                           
 python -s -g MYHG -a MYAK                        

 (this will error that the HG needs an OS and location, we'll fix that) 

 back on katello server:                                                

 hammer -u admin -p changeme os list                                    
 hammer -u admin -p changeme location list                              
 hammer -u admin -p changeme hostgroup list                             
 hammer -u admin -p changeme hostgroup update --operatingsystem-id 1 --location-ids 2 --id 1                                                   

 back on client again:                                                  

 python -s -g MYHG -a MYAK --location "Default Location" --force                


 Validation failed: Name must not include periods                       


 [app] [I] Started POST "/rhsm/consumers?owner=Default_Organization&activation_keys=MYAK" for at 2018-04-11 16:10:34 +0000  
 [app] [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#consumer_activate as JSON 
 [app] [I]     Parameters: {"facts"=>"[FILTERED]", "contentTags"=>[], "type"=>"system", "name"=>"", "owner"=>"Default_Organization", "activation_keys"=>"MYAK"} 
 [app] [I] Current user: foreman_admin (administrator) 
 [app] [I] Current user: foreman_admin (administrator) 
 [katello/cp_proxy] [E] <Class> ActiveRecord::RecordInvalid 
 [katello/cp_proxy] [E] name: ["must not include periods"]  
 [app] [I] Completed 422 Unprocessable Entity in 808ms (Views: 0.1ms | ActiveRecord: 19.4ms) 

 It looks like the domain can't be found, which causes the shortname of the host to be its fqdn. Workaround:                              

 hammer -u admin -p changeme domain update --id 1 --location-ids 2 --organization-ids 1 

 Note that this bug has a workaround in Ideally a more descriptive error message would be raised if the domain is not accessible in the org/location.