Host registration fails with the error: "Validation failed: Host has already been taken"

Solution In Progress - Updated -

Environment

  • Red Hat Satellite 6.3.1
  • Red Hat Satellite 6.2.15

Issue

Host registration to Satellite fails with:
"Validation Failed: Host has already been taken"

Alternatively, reregistrations may fail as well (with XXXX being a registration UUID):
"Consumer with id XXXX-XXXX-XXXX-XXXXXX could not be found"

Resolution

This issue is currently under investigation.

Should you run into this issue, please open a ticket with Red Hat Support.

Root Cause

This issue is being tracked via an internal Bugzilla.

Diagnostic Steps

Ensure that you are running into this bug by doing the following:

1) Enter the foreman-rake console

# foreman-rake console

2) Destroy the content & subscription facets, then the host itself using rails:

 irb(main):001:0> Host.find_by_name("rhel7.example.com").content_facet.destroy!
 irb(main):002:0> Host.find_by_name("rhel7.example.com").subscription_facet.destroy!
 irb(main):003:0> Host.find_by_name("rhel7.example.com").destroy!

3) Try once again to register the host, and you should see the message:

Validation Failed: Host has already been taken

4) Subsequent attempts to register (with force) will yield the message:

Consumer with id  XXXX-XXXX-XXXX-XXXXXX could not be found

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

4 Comments

We have the problem! Is it any workaround for this? (we are running 6.3.1)

There is not a publicly-available workaround currently. If you open a support case and reference this KCS, one of our support engineers will reach out to you to assist with this.

Thanks!

It seems to be fixed in theforeman: https://projects.theforeman.org/issues/23516 We ran into this issue after creating custom foreman-hooks.

I got into this problem by un-registering a server and then removing the content host. To make things worse it was a capsule server.

The server I deleted was called capsule6, and though it was no longer listed as a Content Host or Capsule server I kept getting the above when trying to register anew. The following did work for me (satellite6 is my Satellite Server):

[root@satellite6 ~]#  hammer capsule list
---|-----------------------|------------------------------------|--------------------------
ID | NAME                  | URL                                | FEATURES
---|-----------------------|------------------------------------|--------------------------
1  | satellite6.my.org     | https://satellite6.my.org:9090     | Pulp, Puppet, Puppet C...
---|-----------------------|------------------------------------|--------------------------

[root@satellite6 ~]# hammer host list
---|-----------------------|------------------|------------|---------------|-------------------|------------------------------------------------|----------------------
ID | NAME                  | OPERATING SYSTEM | HOST GROUP | IP            | MAC               | CONTENT VIEW                                   | LIFECYCLE ENVIRONMENT
---|-----------------------|------------------|------------|---------------|-------------------|------------------------------------------------|----------------------
1  | satellite6.my.org     | RedHat 7.6       |            | 10.20.100.105 | 00:50:56:87:30:4a |                                                |
20 | capsule6.my.org       | RedHat 7.6       |            | 10.20.100.106 | 00:50:56:87:7a:33 | Satellite 6 Capsule Server for RHEL 7 (x86_64) | ENV_SAT6
---|-----------------------|------------------|------------|---------------|-------------------|------------------------------------------------|----------------------
[root@satellite6 ~]# hammer host delete --id 20
Host deleted.
[root@satellite6 ~]# hammer host list
---|-----------------------|------------------|------------|---------------|-------------------|------------------------------------------------|----------------------
ID | NAME                  | OPERATING SYSTEM | HOST GROUP | IP            | MAC               | CONTENT VIEW                                   | LIFECYCLE ENVIRONMENT
---|-----------------------|------------------|------------|---------------|-------------------|------------------------------------------------|----------------------
1  | satellite6.my.org     | RedHat 7.6       |            | 10.20.100.105 | 00:50:56:87:30:4a |                                                |
---|-----------------------|------------------|------------|---------------|-------------------|------------------------------------------------|----------------------

I was then able to re-register without any issues.