Bug #26873
closedHost group selection in Create Host form fails: uninitialized constant Fog::Compute::Vsphere::Network
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
Updated by Bernhard Suttner over 5 years 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.
Updated by Bernhard Suttner over 5 years 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.
Updated by Bernhard Suttner over 5 years 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
Updated by Bernhard Suttner over 5 years 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.
Updated by Bernhard Suttner over 5 years 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
Updated by The Foreman Bot over 5 years ago
- Status changed from New to Ready For Testing
- Assignee set to Bernhard Suttner
- Pull request https://github.com/theforeman/foreman/pull/6803 added
Updated by Tomer Brisker over 5 years ago
- Category set to Compute resources - VMware
- Fixed in Releases 1.22.0 added
Updated by Anonymous over 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 6d78db20f781a7c9a1c234c35e6cff4719e6be71.