Project

General

Profile

Actions

Bug #26873

closed

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

Added by Bernhard Suttner over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
High
Category:
Compute resources - VMware
Target version:
-
Difficulty:
Triaged:
No
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

Actions #1

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.

Actions #2

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.

Actions #3

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
Actions #4

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.

Actions #5

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

Actions #6

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
Actions #7

Updated by Tomer Brisker over 5 years ago

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

Updated by Anonymous over 5 years ago

  • Status changed from Ready For Testing to Closed
Actions #9

Updated by Marek Hulán about 5 years ago

  • Bugzilla link set to 1756439
Actions

Also available in: Atom PDF