Bug 1551691 - Failure to refresh on OpenStack provider when Fog::Storage::OpenStack::File object has nil body attribute
Summary: Failure to refresh on OpenStack provider when Fog::Storage::OpenStack::File o...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.10.0
Assignee: Marek Aufart
QA Contact: Jad Haj Yahya
URL:
Whiteboard:
Depends On:
Blocks: 1561216
TreeView+ depends on / blocked
 
Reported: 2018-03-05 18:21 UTC by Robb Manes
Modified: 2021-06-10 15:03 UTC (History)
7 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1561216 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:06:22 UTC
Category: ---
Cloudforms Team: Openstack
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


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