Error registing host to katello

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,

I’m not sure if it’ll help, but have you tried registering the host using the new(ish) global registration feature? That would be, using the script generated by the form under Hosts → Register Host?

I did but unfoutunately still the same error message. (an example can be seen below)
Every registration attempt produced the same error message but with different id. example:

Consumer with id be932993-a9fc-46a6-81d1-5fc996c7dae7 could not be found. (HTTP error code 404: Not Found)
or
Consumer with id 93d6f27f-bf02-44bc-9ed1-8da22bd9a08a could not be found. (HTTP error code 404: Not Found)

Output of a registration attempt using the generated script:

curl -sS  'https://mykatello.com/register?activation_keys=Rocky9actKey&location_id=2&operatingsystem_id=3&organization_id=3&update_packages=false' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo2LCJpYXQiOjE2NzkzOTkzOTAsImp0aSI6IjU4MjE3MjNmZTdhNDBiMGQ5ODI1ZGU3NWEyYTViOWRiZmM4ODM4ZTYwZTU4ZjhkZTcxYmJjM2U0N2Q0ZDFkM2MiLCJleHAiOjE2Nzk0MTM3OTAsInNjb3BlIjoicmVnaXN0cmF0aW9uI2dsb2JhbCByZWdpc3RyYXRpb24jaG9zdCJ9.jVqOJoS8S5cyw9LSW6Bqp_RdRWGJ1wcX99RQ4WvMhfw' | bash
#
# Running registration
#
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Rocky Linux 9 - BaseOS                                       1.0 MB/s | 1.8 MB     00:01
Rocky Linux 9 - AppStream                                    3.8 MB/s | 6.6 MB     00:01
Rocky Linux 9 - Extras                                       7.5 kB/s | 8.5 kB     00:01
Dependencies resolved.
Nothing to do.
Complete!
Consumer with id be932993-a9fc-46a6-81d1-5fc996c7dae7 could not be found. (HTTP error code 404: Not Found)

This is very strange behavior since this is a new server and this issue appeared at the very firsts registration attempt. Other hosts did not have this issue. There were no issues registering this host to a test version foreman/katello.

Any idea how to debug this issue?

I’ll try to see if we can get some more debugging steps here. In the meantime, do you see any errors logged under /var/log/candlepin/ ?

Also, do you see anything in the Foreman production log around consumers? Particularly the API endpoint /environments/:environment_id/consumers ?

First of all thanks!

Just attempted another registration to get updated data.
Nothing under /var/log/candlepin

grep /environments/:environment_id/consumers /var/log/foreman/production.log did not produce any data.

Below there is a part of the /var/log/foreman/production.log from the recent registration attempt. Also I have attached the log file with the full output of that attempt.


2023-03-23T12:23:26 [I|aud|5d0e609f] Katello::Host::SubscriptionFacet (166) create event on dmi_uuid 4C4C4544-0031-5810-8050-B4C04F383733
2023-03-23T12:23:26 [I|aud|5d0e609f] Katello::Host::SubscriptionFacet (166) create event on pool_ids []
2023-03-23T12:23:27 [I|app|5d0e609f] Import facts for 'myhost.myorg.com' completed. Added: 189, Updated: 0, Deleted 0 facts
2023-03-23T12:23:27 [I|aud|5d0e609f] Nic::Managed (664) update event on mac , bc:97:e1:a4:09:a8
2023-03-23T12:23:27 [I|aud|5d0e609f] Nic::Managed (664) update event on identifier , eno3
2023-03-23T12:23:27 [I|aud|5d0e609f] Host::Base (155) update event on architecture_id , 1
2023-03-23T12:23:27 [I|aud|5d0e609f] Host::Base (155) update event on operatingsystem_id , 3
2023-03-23T12:23:27 [I|aud|5d0e609f] Host::Base (155) update event on model_id , 2
2023-03-23T12:23:27 [E|app|5d0e609f] RestClient::NotFound: Katello::Resources::Candlepin::Consumer: 404 Not Found {"displayMessage":"Consumer with id 1829b1cb-4d7c-4b35-a506-a83b473b81e9 could not be found.","requestUuid":"40d04004-3063-4732-ad19-131d9aa77283"} (GET /candlepin/consumers/1829b1cb-4d7c-4b35-a506-a83b473b81e9)
 5d0e609f | Body: {"displayMessage":"Consumer with id 1829b1cb-4d7c-4b35-a506-a83b473b81e9 could not be found.","requestUuid":"40d04004-3063-4732-ad19-131d9aa77283"}
 5d0e609f |
2023-03-23T12:23:27 [E|app|5d0e609f] /usr/share/gems/gems/katello-4.7.3/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb:242:in `consumer_activate'
2023-03-23T12:23:27 [I|app|5d0e609f]   Rendered text template (Duration: 0.0ms | Allocations: 1)
2023-03-23T12:23:27 [I|app|5d0e609f] Completed 404 Not Found in 1374ms (Views: 0.5ms | ActiveRecord: 332.2ms | Allocations: 313199)

grep 5d0e609f varlogforemanproducti.log (10.2 KB)

Seems like you have an orphaned subscription facet. Can you try running foreman-rake katello:clean_orphaned_facets and see if that helps?

Thanks

foreman-rake katello:clean_orphaned_facets
rake aborted!
Don't know how to build task 'katello:clean_orphaned_facets' (See the list of available tasks with `rake --tasks`)
Did you mean?  katello:clean_backend_objects
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
foreman-rake --tasks | grep facets
rake katello:fix_hostgroup_facets                                                    # This task collates hostgroup content facts that were missed during the upgrade from audit

ah, that was added in Katello 4.8! Apologies.

You can run this in foreman-rake console:

Katello::Host::SubscriptionFacet.select { |s| s.host.nil? }&.each do |subscription_facet|
      Rails.logger.info "Deleting subscription facet with id: #{subscription_facet.id}\n"
      subscription_facet.destroy
    end

Hopefully it will find and destroy at least 1. At that point you should be able to delete the host.

I’m not sure that the command is entered correctly…
What kind of output should I expected?

# foreman-rake console
Loading production environment (Rails 6.1.7.2)
irb(main):001:1* Katello::Host::SubscriptionFacet.select { |s| s.host.nil? }&.each do |subscription_facet|
irb(main):002:1*   Rails.logger.info "Deleting subscription facet with id: f9cd6092-50dc-44f5-93e1-200871b7f65d\n"
irb(main):003:1*   subscription_facet.destroy
irb(main):004:0> end
=> []
irb(main):005:0>

The [] means it didn’t find any. Which is confusing because this means

Host.find_by_name("myhost.myorg.com").destroy

should work fine.

should I enter the Katello::Host::SubscriptionFacet.select command in a different way?

this is the recent output of the destroy command

irb(main):001:0> Host.find_by_name("arkm02.local.biu.ac.il").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)=(155) is still referenced from table "katello_subscription_facets".
irb(main):002:0>

The host is not registered

[justme@myhost ~]# subscription-manager refresh
This system is not yet registered. Try 'subscription-manager register --help' for more information.

But the host does appear in katello:

hammer host info --id 155
Id:                       155
Name:                     myhost.myorg.com
Organization:             MYORG
Location:                 Default Location
Cert name:                myhost.myorg.com
Managed:                  no
Installed at:
Last report:
Uptime (seconds):         726807
Status:
    Global Status: Warning
    Build Status:  Installed
Network:
    IPv4 address: 192.168.1.2
    MAC:          a8:a8:a8:a8:a8:a8
Network interfaces:
 1) Id:          665
    Identifier:  eno1np0
    Type:        interface
    MAC address: bc:97:e1:a4:09:aa
    FQDN:
 2) Id:          667
    Identifier:  eno2np1
    Type:        interface
    MAC address: bc:97:e1:a4:09:ab
    FQDN:
 3) Id:           664
    Identifier:   eno3
    Type:         interface (primary, provision, execution)
    MAC address:  a8:a8:a8:a8:a8:a8
    IPv4 address: 192.168.1.2
    FQDN:         myhost.myorg.com
 4) Id:          666
    Identifier:  eno4
    Type:        interface
    MAC address: bc:97:e1:a4:09:a9
    FQDN:
Operating system:
    Architecture:           x86_64
    Operating System:       Rocky 9.1
    Build:                  no
    Custom partition table:
Parameters:

All parameters:
    host_registration_remote_execution => true
    host_registration_insights => false
    host_packages =>
Additional info:
    Owner:      Anonymous Admin
    Owner Id:   1
    Owner Type: User
    Enabled:    yes
    Model:      SuperDuperServer
    Comment:
Content Information:
    Content View:
        Id:   3
        Name: Rocky 9
    Lifecycle Environment:
        Id:   2
        Name: Library
    Content Source:
        Id:
        Name:
    Kickstart Repository:
        Id:
        Name:
    Applicable Packages:   0
    Upgradable Packages:   0
    Applicable Errata:
        Enhancement: 0
        Bug Fix:     0
        Security:    0
Subscription Information:
    Uuid:                          f9cd6092-50dc-44f5-93e1-200871b7f65d
    Last Checkin:                  2023-03-23 14:28:05 UTC
    Release Version:
    Autoheal:                      false
    Registered To:
    Registered At:                 2023-03-19 08:20:21 UTC
    Registered by Activation Keys:
     1) Rocky9actKey
    System Purpose:
        Service Level:
        Purpose Usage:
        Purpose Role:
        Purpose Addons:
Host Collections:

Let’s try this:

orphaned_facet = Katello::Host::SubscriptionFacet.find_by(host_id: 155)
orphaned_facet.delete

Then try the host destroy again.

Thanks. Please see output:

~]# foreman-rake console
Loading production environment (Rails 6.1.7.2)

irb(main):001:0> orphaned_facet = Katello::Host::SubscriptionFacet.find_by(host_id: 155)
=> #<Katello::Host::SubscriptionFacet id: 167, host_id: 155, uuid: "f9cd6092-50dc-44f5-93e1-200871b7f65d", last_checkin: "2023-03-23 14:28:05.225207000 +0000", service_level: "", releas...

irb(main):002:0> orphaned_facet.delete
Traceback (most recent call last):
        2: from lib/tasks/console.rake:5:in `block in <top (required)>'
        1: from (irb):2
ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR:  update or delete on table "katello_subscription_facets" violates foreign key constraint "katello_subscription_facet_activation_keys_sa_id" on table "katello_subscription_facet_activation_keys")
DETAIL:  Key (id)=(167) is still referenced from table "katello_subscription_facet_activation_keys".

irb(main):004:0> Host.find_by_name("myhost.myorg.com").destroy
Traceback (most recent call last):
        3: from lib/tasks/console.rake:5:in `block in <top (required)>'
        2: from (irb):2
        1: from (irb):3:in `rescue in irb_binding'
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)=(155) is still referenced from table "katello_subscription_facets".

Let’s try orphaned_facet.destroy instead of delete so hopefully it can cleanly delete the dependencies… :confused:

Thanks again.
the orphaned_facet.destroy did not produce any error message but the host.destory command Host.find_by_name("myhost.myorg.com").destroy still produced the same error message

~]# foreman-rake console
Loading production environment (Rails 6.1.7.2)

irb(main):001:0> orphaned_facet = Katello::Host::SubscriptionFacet.find_by(host_id: 155)
=> #<Katello::Host::SubscriptionFacet id: 167, host_id: 155, uuid: "f9cd6092-50dc-44f5-93e1-200871b7f65d", last_checkin: "2023-03-23 14:28:05.225207000 +0000", service_level: "", releas...
irb(main):002:0> orphaned_facet.destroy
=> #<Katello::Host::SubscriptionFacet id: 167, host_id: 155, uuid: "f9cd6092-50dc-44f5-93e1-200871b7f65d", last_checkin: "2023-03-23 14:28:05.225207000 +0000", service_level: "", release_version: nil, autoheal: false, registered_at: "2023-03-19 08:20:21.734494000 +0000", registered_through: nil, user_id: nil, hypervisor: false, hypervisor_host_id: nil, purpose_usage: "", purpose_role: "", dmi_uuid: "4C4C4544-0031-5810-8050-B4C04F383733">
irb(main):003:0>

irb(main):004: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):3
ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR:  update or delete on table "hosts" violates foreign key constraint "katello_content_facets_host_id" on table "katello_content_facets")
DETAIL:  Key (id)=(155) is still referenced from table "katello_content_facets".
irb(main):005:0>

@jeremylenz

An update (as i could not edit the last reply).

I tried to do the destory on the key as per the error message and was able destroy the host! :slight_smile:

irb(main):008:0> content_facet = Katello::Host::ContentFacet.find_by(host_id: 155)
=> #<Katello::Host::ContentFacet id: 156, host_id: 155, uuid: "f9cd6092-50dc-44f5-93e1-200871b7f65d", content_view_id: 3, lifecycle_environment_id: 2, kickstart_repository_id: nil, cont...
irb(main):009:0> content_facet.destroy
=> #<Katello::Host::ContentFacet id: 156, host_id: 155, uuid: "f9cd6092-50dc-44f5-93e1-200871b7f65d", content_view_id: 3, lifecycle_environment_id: 2, kickstart_repository_id: nil, content_source_id: nil, installable_security_errata_count: 0, installable_enhancement_errata_count: 0, installable_bugfix_errata_count: 0, applicable_rpm_count: 0, upgradable_rpm_count: 0, applicable_module_stream_count: 0, upgradable_module_stream_count: 0, applicable_deb_count: 0, upgradable_deb_count: 0>
irb(main):010:0>
irb(main):011:0>
irb(main):012:0> Host.find_by_name("myhost.myorg.com").destroy
=> #<Host::Managed id: 155, name: "myhost.myorg.com", last_compile: "2023-03-23 14:28:05.000000000 +0000", last_report: nil, updated_at: "2023-03-23 14:28:05.986806000 +0000", created_at: "2023-03-23 10:23:26.382002000 +0000", root_pass: nil, architecture_id: 1, operatingsystem_id: 3, ptable_id: nil, medium_id: nil, build: false, comment: nil, disk: nil, installed_at: nil, model_id: 2, hostgroup_id: nil, owner_id: 1, owner_type: "User", enabled: true, puppet_ca_proxy_id: nil, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: 3, location_id: 2, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: nil, grub_pass: nil, global_status: 1, lookup_value_matcher: [FILTERED], pxe_loader: nil, initiated_at: nil, build_errors: nil>
irb(main):013:0>

After the host was removed from katello i tried to register it again as per my first message but to no avail…

subscription-manager register --serverurl=myorg.com --org="myorg" --activationkey="myOrgKey"
Consumer with id 2051b07c-748b-4350-9b59-765fd43f9fcb could not be found. (HTTP error code 404: Not Found)

Could it be a setting on the host and not on the katello server?

This is Candlepin that’s complaining that it doesn’t have a consumer with that ID. I’m not entirely sure where it’s failing. Do you have the error stack from production.log at the point of that failure?

Maybe running subscription-manager clean on the host will help, and then try to register again?

Apart from the very first, we performed subscription-manager clean with every register attempt.

Please see the log output of the last registration attempt

~]# grep 0b6fcc08 /var/log/foreman/production.log-20230329
2023-03-28T09:28:41 [I|app|0b6fcc08] Started POST "/rhsm/consumers?owner=MYORG&activation_keys=Rocky9actKey" for 1.1.1.1 at 2023-03-28 09:28:41 +0300
2023-03-28T09:28:41 [I|app|0b6fcc08] Processing by Katello::Api::Rhsm::CandlepinProxiesController#consumer_activate as JSON
2023-03-28T09:28:41 [I|app|0b6fcc08]   Parameters: {"type"=>"system", "name"=>"myhost", "facts"=>"[FILTERED]", "contentTags"=>[], "role"=>"", "addOns"=>[], "usage"=>"", "serviceLevel"=>"", "owner"=>"MYORG", "activation_keys"=>"Rocky9actKey"}
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on mac
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on ip
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on type Nic::Managed
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on name myhost.myorg.com
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on host_id 157
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on subnet_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on domain_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on attrs {}
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on provider
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on username
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on password [redacted]
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on virtual false
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on link true
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on identifier
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on tag
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on attached_to
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on managed true
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on mode balance-rr
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on attached_devices
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on bond_options
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on primary true
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on provision true
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on compute_attributes {}
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on execution true
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on ip6
2023-03-28T09:28:42 [I|aud|0b6fcc08] Nic::Managed (672) create event on subnet6_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on name myhost.myorg.com
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on root_pass
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on architecture_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on operatingsystem_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on ptable_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on medium_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on build false
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on comment
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on disk
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on installed_at
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on model_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on hostgroup_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on owner_id 1
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on owner_type User
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on enabled true
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on puppet_ca_proxy_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on managed false
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on use_image
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on image_file
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on uuid
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on compute_resource_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on puppet_proxy_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on certname
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on image_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on organization_id 3
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on location_id 2
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on otp
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on realm_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on compute_profile_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on provision_method
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on grub_pass
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on pxe_loader
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on initiated_at
2023-03-28T09:28:42 [I|aud|0b6fcc08] Host::Base (157) create event on build_errors
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on host_id 157
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on uuid 2051b07c-748b-4350-9b59-765fd43f9fcb
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on content_view_id 3
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on lifecycle_environment_id 2
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on kickstart_repository_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on content_source_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on installable_security_errata_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on installable_enhancement_errata_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on installable_bugfix_errata_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on applicable_rpm_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on upgradable_rpm_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on applicable_module_stream_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on upgradable_module_stream_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on applicable_deb_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::ContentFacet (158) create event on upgradable_deb_count 0
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on host_id 157
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on uuid 2051b07c-748b-4350-9b59-765fd43f9fcb
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on service_level
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on release_version
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on autoheal false
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on registered_at 2023-03-19 08:20:21 UTC
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on registered_through
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on user_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on hypervisor false
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on hypervisor_host_id
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on purpose_usage
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on purpose_role
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on dmi_uuid 4C4C4544-0031-5810-8050-B4C04F383733
2023-03-28T09:28:42 [I|aud|0b6fcc08] Katello::Host::SubscriptionFacet (169) create event on pool_ids []
2023-03-28T09:28:42 [I|app|0b6fcc08] Import facts for 'myhost.myorg.com' completed. Added: 189, Updated: 0, Deleted 0 facts
2023-03-28T09:28:43 [I|aud|0b6fcc08] Nic::Managed (672) update event on mac , bc:97:e1:a4:09:a8
2023-03-28T09:28:43 [I|aud|0b6fcc08] Nic::Managed (672) update event on identifier , eno3
2023-03-28T09:28:43 [I|aud|0b6fcc08] Host::Base (157) update event on architecture_id , 1
2023-03-28T09:28:43 [I|aud|0b6fcc08] Host::Base (157) update event on operatingsystem_id , 3
2023-03-28T09:28:43 [I|aud|0b6fcc08] Host::Base (157) update event on model_id , 2
2023-03-28T09:28:43 [E|app|0b6fcc08] RestClient::NotFound: Katello::Resources::Candlepin::Consumer: 404 Not Found {"displayMessage":"Consumer with id 2051b07c-748b-4350-9b59-765fd43f9fcb could not be found.","requestUuid":"2ec6c8d9-88d1-485e-85cf-399723e50758"} (GET /candlepin/consumers/2051b07c-748b-4350-9b59-765fd43f9fcb)
 0b6fcc08 | Body: {"displayMessage":"Consumer with id 2051b07c-748b-4350-9b59-765fd43f9fcb could not be found.","requestUuid":"2ec6c8d9-88d1-485e-85cf-399723e50758"}
 0b6fcc08 |
2023-03-28T09:28:43 [E|app|0b6fcc08] /usr/share/gems/gems/katello-4.7.3/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb:242:in `consumer_activate'
2023-03-28T09:28:43 [I|app|0b6fcc08]   Rendered text template (Duration: 0.0ms | Allocations: 1)
2023-03-28T09:28:43 [I|app|0b6fcc08] Completed 404 Not Found in 1296ms (Views: 0.5ms | ActiveRecord: 305.1ms | Allocations: 313214)

Thanks, that was helpful. It seems like Katello is requesting details on the newly-created consumer, but for some reason that consumer doesn’t exist yet. Do you also have output from /var/log/candlepin/candlepin.log and /var/log/candlepin/error.log? Just before the GET /candlepin/consumers/2051b07c-748b-4350-9b59-765fd43f9fcb I’m expecting some sort of error to have occurred.