Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1605188 - Regression of Bug 1575113 - Host registration fails with the error: "Validation failed: Host has already been taken"
Regression of Bug 1575113 - Host registration fails with the error: "Validati...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Registration (Show other bugs)
6.3.2
All All
high Severity high (vote)
: 6.3.3
: Unused
Assigned To: Justin Sherrill
jcallaha
: Regression, Triaged
: 1599700 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-07-20 08:13 EDT by jjansky
Modified: 2018-08-23 14:42 EDT (History)
13 users (show)

See Also:
Fixed In Version: tfm-rubygem-katello-3.4.5.78-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-08-22 16:07:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3436541 None None None 2018-07-20 08:56 EDT
Foreman Issue Tracker 23516 None None None 2018-07-20 12:34 EDT
Red Hat Product Errata RHBA-2018:2550 None None None 2018-08-22 16:07 EDT

  None (edit)
Description jjansky 2018-07-20 08:13:56 EDT
Description of problem:
Try to register again not correctly removed host ends with 

"Validation failed: Host has already been taken"


Version-Release number of selected component (if applicable):
Satellite 6.3.2

How reproducible:
Not sure


Steps to Reproduce:
1. Host was already removed from candlepin and pulp DB
2. Manually removed from foreman DB
3. Re-registration

Actual results:
"Validation failed: Host has already been taken

Expected results:
Successful registration.

Additional info:
Solved by applying https://access.redhat.com/solutions/3436541, with small changes according to difference between 6.3.1 and 6.3.2
Comment 1 Justin Sherrill 2018-07-20 11:04:52 EDT
Can you provide the exact steps you took for:

1. Host was already removed from candlepin and pulp DB
2. Manually removed from foreman DB
Comment 2 jjansky 2018-07-20 11:22:16 EDT
1. I cannot because when customer created the case it was already missing from candlepin and pulp DB
2. su - postgres -c "psql foreman"

delete from host_status where host_id = x;
delete from katello_subscription_facet_activation_keys where subscription_facet_id = y;
delete from katello_subscription_facets where host_id = x;
delete from nics where host_id = x;
delete from hosts where id = x;
Comment 3 Justin Sherrill 2018-07-20 11:28:55 EDT
Jan, 

Your comment in the case:


After some investigation we found out that changes which should be present in your version are not, i applied those changes into your code and we tested functionality, registration seems to work, please feel free to test it more. I will discuss with developers why is this part of code not applied. 

makes me think they weren't actually fully on 6.3.2.  Can you have them upload a foreman-debug?
Comment 5 jjansky 2018-07-20 11:42:05 EDT
Justin,
i checked on the server file /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.74/app/services/katello/registration_manager.rb which as far as i know is the only file relevant to this issue, it came from 

tfm-rubygem-katello-3.4.5.74-1.el7sat.noarch.rpm

which correspond to 

https://access.redhat.com/errata/RHBA-2018:1950
Comment 6 Justin Sherrill 2018-07-20 12:01:46 EDT
You guys are correct, this change is completely missing from 6.3.2 (and 6.3.3) it appears that there was some issue with the release that caused this fix to be missed.  Coupled with the fact that we could never reproduce internally, our qe wasn't able to catch it.  

I will work with our release team to correct the problem.
Comment 9 pm-sat@redhat.com 2018-07-20 14:12:02 EDT
Upstream bug assigned to jsherril@redhat.com
Comment 10 pm-sat@redhat.com 2018-07-20 14:12:05 EDT
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23516 has been resolved.
Comment 11 Justin Sherrill 2018-07-20 16:32:20 EDT
*** Bug 1599700 has been marked as a duplicate of this bug. ***
Comment 14 jcallaha 2018-08-03 14:48:38 EDT
Verified in Satellite 6.3.3 Snap 2.

I performed over 4000 host registrations, and did not encounter this issue.

Additionally, I checked the file and the expected changes are in place.

-bash-4.2# find / -name registration_manager.rb
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.78/app/services/katello/registration_manager.rb
-bash-4.2# 
-bash-4.2# catline 99 /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.78/app/services/katello/registration_manager.rb
        host.subscription_facet.update_subscription_status(::Katello::SubscriptionStatus::UNKNOWN)
Comment 15 Logan Kuhn 2018-08-06 10:55:28 EDT
I'm in the process of testing Satellite 6.3 in our environment, is there a way I could test that update in our environment?  It'd make my life a lot easier getting it approved.

Logan
Comment 16 Mike McCune 2018-08-08 10:51:40 EDT
Logan, can you open a Red Hat support case and email me with the case# to mmccune @ redhat.com 

I'll get you the RPMs.
Comment 17 Logan Kuhn 2018-08-08 10:53:04 EDT
Case# 02153260
Comment 18 Logan Kuhn 2018-08-13 09:47:11 EDT
I no longer experience the issue after installing the RPMs.  Thank you
Comment 24 errata-xmlrpc 2018-08-22 16:07:12 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2550

Note You need to log in before you can comment on or make changes to this bug.