Project

General

Profile

Bug #26873

Host group selection in Create Host form fails: uninitialized constant Fog::Compute::Vsphere::Network

Added by Bernhard Suttner 26 days ago. Updated 23 days ago.

Status:
Closed
Priority:
High
Category:
Compute resources - VMware
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

- Create a Host
- Select the Host Group in which a VMware compute resource is used
- The request is not successful
- In the log, the following issue appears:

2019-05-24T23:01:17 [W|app|4701f1a7] Action failed
ActionView::Template::Error: uninitialized constant Fog::Compute::Vsphere::Network
Did you mean? Fog::Network
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/inflector/methods.rb:285:in `const_get'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/inflector/methods.rb:285:in `block in constantize'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/inflector/methods.rb:281:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/inflector/methods.rb:281:in `inject'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/inflector/methods.rb:281:in `constantize'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/core_ext/string/inflections.rb:68:in `constantize'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/core_ext/marshal.rb:10:in `rescue in load'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/core_ext/marshal.rb:5:in `load'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/cache.rb:804:in `uncompress'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/cache.rb:726:in `value'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/cache.rb:358:in `block in read'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/cache.rb:663:in `block in instrument'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/cache.rb:663:in `instrument'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/cache.rb:345:in `read'
/usr/share/foreman/app/services/compute_resource_cache.rb:34:in `read'
/usr/share/foreman/app/services/compute_resource_cache.rb:19:in `cache'
/usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:145:in `networks'
/usr/share/foreman/app/helpers/compute_resources_vms_helper.rb:77:in `vsphere_networks'
/usr/share/foreman/app/views/compute_resources_vms/form/vmware/_network.html.erb:6:in `_eb09ae03d5240a7122ea3891a470d1cc'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/template.rb:159:in `block in render'

tfm-rubygem-fog-vsphere-2.5.0
foreman-1.21.3
tfm-rubygem-fog-1.42.1
tfm-rubygem-fog-core-1.45.0-3

There are similar reports:
https://community.theforeman.org/t/hammer-compute-resource-networks-id-with-vsphere-intermittent-rand/13849
https://community.theforeman.org/t/foreman-1-20-2-vmware-sporadic-http-500-when-querying-api-compute-resources-api/13907

Associated revisions

Revision 6d78db20 (diff)
Added by Bernhard Suttner 23 days ago

Fixes #26873 - fix vsphere networks (auto)-loading

Due to a race condition, sometimes the the failure 'uninitialized constant Fog::Compute::Vsphere::Network' happens when using the compute-resource networks API.

Similar happend to Fog::Compute::Vsphere::Cluster

History

#1 Updated by Bernhard Suttner 26 days ago

Looks like, running a "Refresh Cache" on the "Infrastructure -> Compute Resources -> Your VMware Provider" can "fix" it. But I don't know if it happens again afer some other request.

#2 Updated by Bernhard Suttner 25 days ago

... it happens again. So, refresh cache doesn't fix it completely and it happend somehow again. its a random issue and it looks like, maybe a timing issue.

#3 Updated by Bernhard Suttner 25 days ago

  • Subject changed from Host group in Create Host form can not be selected: uninitialized constant Fog::Compute::Vsphere::Network to Host group selection in Create Host form fails: uninitialized constant Fog::Compute::Vsphere::Network

#4 Updated by Bernhard Suttner 25 days ago

Easiest steps to reproduce:
- open the create host tab about 10 times
- in each tab, select the host group in which a VMware compute resource is used

Pretty sure that it fails in one tab. If it fails, the above 500 server error in the log appears and the VMware data, like the VMware datastores etc are not shown.

#5 Updated by Bernhard Suttner 24 days ago

I'm not 100% sure yet as tests still pending however I think it has to do with the following change:

commit b4d7f9ce76d2887b3052cbc79976906023058758
fixes #23369 - load vmware datastores async

This commit changes the loading of the VMware datastores and uses the compute resource API. Unfortunately the API often returns 500 server errors. See https://community.theforeman.org/t/foreman-1-20-2-vmware-sporadic-http-500-when-querying-api-compute-resources-api/13907/8 and https://community.theforeman.org/t/hammer-compute-resource-networks-id-with-vsphere-intermittent-rand/13849

#6 Updated by The Foreman Bot 23 days ago

  • Assignee set to Bernhard Suttner
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6803 added

#7 Updated by Tomer Brisker 23 days ago

  • Category set to Compute resources - VMware
  • Fixed in Releases 1.22.0 added

#8 Updated by Anonymous 23 days ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF