Bug 1428371

Summary: error when resource does not have id ActiveRecord::RecordInvalid: Validation failed: Resource can't be blank
Product: Red Hat Satellite Reporter: Tom McKay <tomckay>
Component: Tasks PluginAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.7CC: aruzicka, bbuckingham, ben.argyle, egolov, ehelms, inecas, jcallaha, johan.bergstrom, ninooke, pmoravec, tomckay
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman-tasks-0.9.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:31:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Zip of /var/log/production.log
none
prodlog after fix none

Description Tom McKay 2017-03-02 12:27:54 UTC
When a resource is going to be locked, the lock requires that the resource has an id (see validation in lock.rb). Without this there are errors.

To reproduce, register a content host with subscription-manager and update facts:
subscription-manager register --username admin --password changeme --org Default_Organization --env Library
subscription-manager facts --update

The CpConsumerUser does not have an id since it is a temporary user used just for the length of the call.

Comment 1 Tom McKay 2017-03-02 12:27:58 UTC
Created from redmine issue http://projects.theforeman.org/issues/18771

Comment 4 Adam Ruzicka 2017-03-06 12:34:43 UTC
I can't reproduce this issue using the provided reproducer on a fresh 6.2 machine. Any hints would be greatly appreciated

Comment 5 Tom McKay 2017-03-10 17:47:17 UTC
*** Bug 1431185 has been marked as a duplicate of this bug. ***

Comment 6 Ben 2017-03-13 09:49:26 UTC
I'm seeing the same issue on a 6.2.8 box (installed at 6.2.6 and upgraded through 6.2.7).  I see these messages every few minutes, or even more often, leading to a rather large /var/log/foreman/production.log size and turnover.  I'm attaching my production.log as a zip file in case it's of use.

Comment 7 Ben 2017-03-13 09:50:09 UTC
Created attachment 1262374 [details]
Zip of /var/log/production.log

Comment 8 Satellite Program 2017-06-07 12:03:25 UTC
Upstream bug assigned to inecas

Comment 9 Satellite Program 2017-06-07 12:03:30 UTC
Upstream bug assigned to inecas

Comment 10 Satellite Program 2017-06-09 08:03:28 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18771 has been resolved.

Comment 11 Peter Ondrejka 2017-08-24 15:19:45 UTC
Verified on Satellite 6.3 snap 12, successfully updated facts from content host, see attachment for prodlog output.

Comment 12 Peter Ondrejka 2017-08-24 15:21:54 UTC
Created attachment 1317768 [details]
prodlog after fix

Comment 13 Bryan Kearney 2018-02-21 17:31:25 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/RHSA-2018:0336