Bug 1749060

Summary: refresh: Error when saving InventoryCollection:<ContainerImage> ... undefined method `[]=' for nil:NilClass
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ProvidersAssignee: Ladislav Smola <lsmola>
Status: CLOSED ERRATA QA Contact: juwatts
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.4CC: ckoep, dmetzger, jfrey, jhardy, jprause, lsmola, mshriver, obarenbo, smallamp
Target Milestone: GAKeywords: ZStream
Target Release: 5.10.10Flags: simaishi: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.10.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1732442 Environment:
Last Closed: 2019-09-23 19:43:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Container Management Target Upstream Version:
Embargoed:
Bug Depends On: 1732442    
Bug Blocks:    

Comment 2 CFME Bot 2019-09-05 00:40:36 UTC
New commit detected on ManageIQ/manageiq/hammer:

https://github.com/ManageIQ/manageiq/commit/38e50df15dadd43e1354944f0f0336e6999e33d2
commit 38e50df15dadd43e1354944f0f0336e6999e33d2
Author:     Adam Grare <agrare>
AuthorDate: Wed Sep  4 10:44:12 2019 -0400
Commit:     Adam Grare <agrare>
CommitDate: Wed Sep  4 10:44:12 2019 -0400

    Merge pull request #19251 from Ladas/cover_containers_reconnect_with_duplicates_in_db

    Skip already reconnected object

    (cherry picked from commit 91092dcacfd6663cbed3711ecae913a663e033bd)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1749060

 app/models/manageiq/providers/inventory/persister/builder/container_manager.rb | 3 +
 1 file changed, 3 insertions(+)

Comment 3 juwatts 2019-09-11 17:44:23 UTC
Verified in 5.10.10.0.20190905201238_76e3ac6


Added a duplicate record into the database:

vmdb_production=# select * from container_groups where id=1;
-[ RECORD 1 ]------------+------------------------------------------------------------------
id                       | 1
ems_ref                  | 6574ecad-cdd3-11e9-8f26-001a4a520000
name                     | ansible-1-tkqzg
ems_created_on           | 2019-09-02 22:45:43
resource_version         | 72938575
restart_policy           | Always
dns_policy               | ClusterFirst
ems_id                   | 1
container_node_id        | 2
last_perf_capture_on     | 
container_replicator_id  | 
ipaddress                | 10.130.0.174
type                     | ManageIQ::Providers::Kubernetes::ContainerManager::ContainerGroup
container_project_id     | 3
phase                    | Running
message                  | 
reason                   | 
container_build_pod_id   | 
created_on               | 2019-09-11 14:49:48.783468
deleted_on               | 
old_ems_id               | 
old_container_project_id | 

vmdb_production=# select * from container_groups where id=50;
-[ RECORD 1 ]------------+------------------------------------------------------------------
id                       | 50
ems_ref                  | 6574ecad-cdd3-11e9-8f26-001a4a520000
name                     | ansible-1-tkqzg
ems_created_on           | 2019-09-02 22:45:43
resource_version         | 72938575
restart_policy           | Always
dns_policy               | ClusterFirst
ems_id                   | 1
container_node_id        | 2
last_perf_capture_on     | 
container_replicator_id  | 
ipaddress                | 10.130.0.174
type                     | ManageIQ::Providers::Kubernetes::ContainerManager::ContainerGroup
container_project_id     | 3
phase                    | Running
message                  | 
reason                   | 
container_build_pod_id   | 
created_on               | 2019-09-11 14:49:48.783468
deleted_on               | 
old_ems_id               | 
old_container_project_id | 

vmdb_production=#

Only difference was the ID

Ran a provider refresh, verified no Error messages were observed

[root@dhcp-8-196-144 log]# cat evm.log | grep -i NilClass
[root@dhcp-8-196-144 log]#

Comment 5 errata-xmlrpc 2019-09-23 19:43:07 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-2019:2813