Project

General

Profile

Bug #15891

Re-Registering host with uppercase hostname errors 'Name has already been taken'

Added by Justin Sherrill almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Client/Agent
Target version:
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

If a host has a hostname with any uppercase letters, re-registration will try to find it, but not be able to because its stored with lowercase letters.

Steps to reproduce:

1) hostname 'FooBar.example.com'
2) subscription-manager register
3) subscription-manager register --force

2016-07-28 13:24:50 [foreman-tasks/action] [E] Validation failed: Name has already been taken (ActiveRecord::RecordInvalid)
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `block in save!'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:199:in `transaction'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:208:in `transaction'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `save!'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.18/app/models/foreman_tasks/concerns/action_triggering.rb:33:in `block in save!'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.18/app/models/foreman_tasks/concerns/action_triggering.rb:133:in `dynflow_task_wrap'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.18/app/models/foreman_tasks/concerns/action_triggering.rb:33:in `save!'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/lib/actions/katello/host/register.rb:26:in `block in plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/execution_plan.rb:281:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/execution_plan.rb:281:in `switch_flow'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:369:in `sequence'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/app/lib/actions/katello/host/register.rb:8:in `plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:461:in `block (3 levels) in execute_plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:26:in `call'

Associated revisions

Revision 54e881bf (diff)
Added by Justin Sherrill almost 3 years ago

Fixes #15891 - lookup existing hosts with lowercase (#6214)

name

History

#1 Updated by The Foreman Bot almost 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6214 added

#2 Updated by Justin Sherrill almost 3 years ago

  • Bugzilla link set to 1361309

#3 Updated by Justin Sherrill almost 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Eric Helms over 2 years ago

  • Legacy Backlogs Release (now unused) changed from 171 to 162

Also available in: Atom PDF