Bug 1551691

Summary: Failure to refresh on OpenStack provider when Fog::Storage::OpenStack::File object has nil body attribute
Product: Red Hat CloudForms Management Engine Reporter: Robb Manes <rmanes>
Component: ProvidersAssignee: Marek Aufart <maufart>
Status: CLOSED CURRENTRELEASE QA Contact: Jad Haj Yahya <jhajyahy>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, gblomqui, jfrey, jhajyahy, jhardy, obarenbo, rmanes
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1561216 (view as bug list) Environment:
Last Closed: 2019-02-11 14:06:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Openstack Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1561216    

Comment 1 Marek Aufart 2018-03-07 12:22:30 UTC
Thanks for detailed error report! There is a rescue block returning nil in https://github.com/fog/fog-openstack/blob/master/lib/fog/storage/openstack/models/files.rb#L58, so this situation can happen if the File was not found (e.g. deleted meanwhile).

Updating fog-openstack to handle this situation [1], then we'll need update fog-openstack gem once it get released.

If needed, can CU test update fog-openstack gem on the appliance with [2]?

[1] https://github.com/fog/fog-openstack/pull/379
[2] diff --git a/lib/fog/storage/openstack/models/file.rb b/lib/fog/storage/openstack/models/file.rb
index b1815de..23cb7d4 100644
--- a/lib/fog/storage/openstack/models/file.rb
+++ b/lib/fog/storage/openstack/models/file.rb
@@ -40,7 +40,7 @@ module Fog
 
         def body
           attributes[:body] ||= if last_modified
-                                  collection.get(identity).body
+                                  collection.get(identity).try(:body) || ''
                                 else
                                   ''
                                 end

Comment 2 Robb Manes 2018-03-08 14:07:10 UTC
(In reply to Marek Aufart from comment #1)
> If needed, can CU test update fog-openstack gem on the appliance with [2]?

Thanks Marek, I'll have the customer run with the above pull and report back if it resolves it.

Comment 3 Marek Aufart 2018-03-09 08:28:05 UTC
The fog-openstack lib fix https://github.com/fog/fog-openstack/pull/379 was merged upstream.

We need wait/push for fog-openstack new version release and then update it in product. It would be safe wait for verification on customer side, but not sure about getting the fog-openstack update out and in product within in 2 or 3 days.

Comment 4 Marek Aufart 2018-03-09 08:28:36 UTC
The fog-openstack lib fix https://github.com/fog/fog-openstack/pull/379 was merged upstream.

We need wait/push for fog-openstack new version release and then update it in product. It would be safe wait for verification on customer side, but not sure about getting the fog-openstack update out and in product within in 2 or 3 days.

Comment 5 Robb Manes 2018-03-12 12:50:16 UTC
Confirming that fog-openstack PR works perfectly and resolves the issue.  Thanks!

Comment 7 Marek Aufart 2018-03-27 14:48:55 UTC
Previous PR was closed in favour of: https://github.com/ManageIQ/manageiq-providers-openstack/pull/257

Comment 10 Jad Haj Yahya 2018-11-14 09:57:33 UTC
Verified on 5.10.0.23