Problem:
trying to register a host via ‘subscription-manager register’ command with --serverurl --org ad --activationkey parameters fails with the message:
Consumer with id 93d6f27f-bf02-44bc-9ed1-8da22bd9a08a could not be found. (HTTP error code 404: Not Found)
The id 93d6f27f-bf02-44bc-9ed1-8da22bd9a08a
is not the id of the machine as can be seen by
subscription-manager facts | grep uuid
dmi.system.uuid: 4C4C4544-0031-5810-8050-B4C04F383733
Expected outcome:
The system has been registered with ID: xxxxxx-xxx-xx-x-x
The registered system name is: myhost
# Running [myhost.myorg.com] host initial configuration
Refreshing subscription data
All local data refreshed
Host [myhost.myorg.com] successfully configured.
Successfully updated the system facts.
Foreman and Proxy versions:
foreman - 3.5.2
katello - 4.7.3
Foreman and Proxy plugin versions:
Distribution and version:
centos 8 stream
Other relevant data:
no problem registering the host to a test version foreman/katello
I tried to follow commands from the example below:
1
foreman-rake console
irb(main):001:0> host = Host.find_by(:name => '<hostname>')
irb(main):001:0> host.update_attribute(:managed, false)
irb(main):001:0> host.disassociate!
2
then
irb(main):001:0> host.destroy!
irb(main):001:0> exit
3
then
#su postgres
#psql foreman
delete from katello_subscription_facets where host_id=(select id from hosts where name='[myhost.myorg.com]');
delete from katello_content_facets where host_id=(select id from hosts where name='[myhost.myorg.com]');
4
Then
foreman-rake console
Host.find_by_name("myhost.myorg.com").destroy
the last command in step 4 produces the error message below:
irb(main):001:0> Host.find_by_name("myhost.myorg.com").destroy
Traceback (most recent call last):
2: from lib/tasks/console.rake:5:in `block in <top (required)>'
1: from (irb):1
ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR: update or delete on table "hosts" violates foreign key constraint "katello_subscription_facets_host_id" on table "katello_subscription_facets")
DETAIL: Key (id)=(153) is still referenced from table "katello_subscription_facets".
This is the only host with this issue. How can one remove any data/info related to the id 93d6f27f-bf02-44bc-9ed1-8da22bd9a08a
from katello server?
Thanks,