Bug 1327576 - Error on updating puppet facts of an unmanaged host raises: ActiveRecord::RecordInvalid: Validation failed: Fact name has already been taken
Summary: Error on updating puppet facts of an unmanaged host raises: ActiveRecord::Re...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: Sachin Ghai
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1268207 1276271
TreeView+ depends on / blocked
 
Reported: 2016-04-15 12:41 UTC by Sachin Ghai
Modified: 2019-09-26 17:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:25:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 13819 0 None None None 2016-04-22 15:55:08 UTC

Description Sachin Ghai 2016-04-15 12:41:04 UTC
Description of problem:
I registered a host with satellite6.2 via puppet and later I tried to update facts, but when I ran "puppet agent -t" on host, following exception raised on host:

2016-04-15 07:58:45 [app] [I] Started GET "/node/cloud-qe-19.idmqe.lab.eng.bos.redhat.com?format=yml" for 10.16.96.112 at 2016-04-15 07:58:45 -0400
2016-04-15 07:58:45 [app] [I] Processing by HostsController#externalNodes as YML
2016-04-15 07:58:45 [app] [I]   Parameters: {"name"=>"cloud-qe-19.idmqe.lab.eng.bos.redhat.com"}
2016-04-15 07:58:45 [app] [I]   Rendered text template (0.0ms)
2016-04-15 07:58:45 [app] [I] Completed 200 OK in 178ms (Views: 0.4ms | ActiveRecord: 7.0ms)
2016-04-15 07:58:46 [app] [I] Started POST "/api/hosts/facts" for 10.16.96.112 at 2016-04-15 07:58:46 -0400
2016-04-15 07:58:46 [app] [I] Processing by Api::V2::HostsController#facts as JSON
2016-04-15 07:58:46 [app] [I]   Parameters: {"facts"=>"[FILTERED]", "name"=>"cloud-qe-19.idmqe.lab.eng.bos.redhat.com", "certname"=>"cloud-qe-19.idmqe.lab.eng.bos.redhat.com", "apiv"=>"v2", :host=>{"name"=>"cloud-qe-19.idmqe.lab.eng.bos.redhat.com", "certname"=>"cloud-qe-19.idmqe.lab.eng.bos.redhat.com"}}
2016-04-15 07:58:46 [app] [W] Action failed
 | ActiveRecord::RecordInvalid: Validation failed: Fact name has already been taken
 | /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'
 

Version-Release number of selected component (if applicable):
sat6.2 beta snap8.1

How reproducible:


Steps to Reproduce:
1. register host via puppet
2. run puppet agent -t on host
3.

Actual results:
ActiveRecord::RecordInvalid: Validation failed: Fact name has already been taken

Expected results:
facts should be updated successfully

Additional info:
I register host via puppet and later I updated some interfaces manually on host and tan puppet agent -t to see the updated facts on webUI under host details -> NIC section but got exception mentioned in bz.

Comment 4 Marek Hulan 2016-04-21 06:50:59 UTC
This fails before we even parse the facts to create network interfaces. It seems as there are some conflicting facts of a different type, probably from a plugin (subscription manager facts?). It seems to be reported as http://projects.theforeman.org/issues/13819 already.

Comment 5 Bryan Kearney 2016-04-21 14:06:07 UTC
Upstream bug component is Provisioning

Comment 6 Sachin Ghai 2016-04-22 08:33:00 UTC
Raising the severity as its affecting verification of ON_QA bugs.

Comment 7 Bryan Kearney 2016-04-27 16:06:35 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/13819 has been closed

Comment 8 Sachin Ghai 2016-05-13 11:13:23 UTC
Verified with sat62 GA snap10.1

On updating facts of un-managed hosts, I don't see reported issue.

2016-05-13 05:34:57 [app] [I] Started POST "/api/hosts/facts" for 10.16.96.112 at 2016-05-13 05:34:57 -0400
2016-05-13 05:34:57 [app] [I] Processing by Api::V2::HostsController#facts as JSON
2016-05-13 05:34:57 [app] [I]   Parameters: {"facts"=>"[FILTERED]", "name"=>"cloud-qe-15.idmqe.lab.eng.bos.redhat.com", "certname"=>"cloud-qe-15.idmqe.lab.eng.bos.redhat.com", "apiv"=>"v2", :host=>{"name"=>"cloud-qe-15.idmqe.lab.eng.bos.redhat.com", "certname"=>"cloud-qe-15.idmqe.lab.eng.bos.redhat.com"}}
2016-05-13 05:34:58 [app] [I] Import facts for 'cloud-qe-15.idmqe.lab.eng.bos.redhat.com' completed. Added: 110, Updated: 0, Deleted 0 facts
2016-05-13 05:34:59 [app] [I] Completed 201 Created in 1525ms (Views: 5.8ms | ActiveRecord: 932.1ms)
2016-05-13 05:34:59 [app] [I] Started GET "/node/cloud-qe-15.idmqe.lab.eng.bos.redhat.com?format=yml" for 10.16.96.112 at 2016-05-13 05:34:59 -0400
2016-05-13 05:34:59 [app] [I] Processing by HostsController#externalNodes as YML
2016-05-13 05:34:59 [app] [I]   Parameters: {"name"=>"cloud-qe-15.idmqe.lab.eng.bos.redhat.com"}
2016-05-13 05:34:59 [app] [I]   Rendered text template (0.0ms)
2016-05-13 05:34:59 [app] [I] Completed 200 OK in 115ms (Views: 0.7ms | ActiveRecord: 16.4ms)
2016-05-13 05:34:59 [app] [I] Started POST "/api/reports" for 10.16.96.112 at 2016-05-13 05:34:59 -0400
2016-05-13 05:34:59 [app] [I] Processing by Api::V2::ReportsController#create as JSON
2016-05-13 05:34:59 [app] [I]   Parameters: {"report"=>"[FILTERED]", "apiv"=>"v2"}
2016-05-13 05:34:59 [app] [I] processing report for cloud-qe-15.idmqe.lab.eng.bos.redhat.com
2016-05-13 05:34:59 [app] [I] Imported report for cloud-qe-15.idmqe.lab.eng.bos.redhat.com in 0.17 seconds
2016-05-13 05:34:59 [app] [I]   Rendered api/v2/reports/create.json.rabl (21.0ms)
2016-05-13 05:34:59 [app] [I] Completed 201 Created in 283ms (Views: 28.4ms | ActiveRecord: 143.1ms)

Comment 9 Sachin Ghai 2016-05-13 11:54:32 UTC
Validated this with sat6.2 GA snap11. Issue has been fixed.

Comment 10 Bryan Kearney 2016-07-27 11:25:59 UTC
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-2016:1501


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