foreman_fog_proxmox icon indicating copy to clipboard operation
foreman_fog_proxmox copied to clipboard

fix 500 when browsing VMs in compute resource (Integer to String)

Open elelayan opened this issue 3 years ago • 4 comments

on Foreman 3.0.1, proxmox VE 7.0-11

Here is the error:

Backtrace for 'no implicit conversion of Integer into String' error (ActionView::Template::Error): no implicit conversion of Integer into String
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/models/concerns/fog_extensions/proxmox/server.rb:27:in `+'
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/models/concerns/fog_extensions/proxmox/server.rb:27:in `unique_cluster_identity'
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/views/compute_resources_vms/index/_proxmox.html.erb:34:in `block in _94910306308b1e629dd9be22f5198ab2'
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/views/compute_resources_vms/index/_proxmox.html.erb:32:in `each'
/usr/share/foreman/vendor/ruby/2.5.0/gems/foreman_fog_proxmox-0.14.0/app/views/compute_resources_vms/index/_proxmox.html.erb:32:in `_94910306308b1e629dd9be22f5198ab2'
/usr/share/foreman/vendor/ruby/2.5.0/gems/actionview-6.0.3.7/lib/action_view/base.rb:274:in `_run'

elelayan avatar Dec 21 '21 16:12 elelayan

Tested this in our fresh Foreman install, works fine for us.

Retrospector avatar Dec 22 '21 08:12 Retrospector

This change fixed the problem on my cluster.

bk-lg avatar Jan 27 '22 15:01 bk-lg

There's actually an almost identical error on line 27 of app/models/concerns/host_ext/proxmox/for_vm.rb where identity also needs the .to_s added, maybe you can include that in your PR?

seidler2547 avatar Feb 25 '22 20:02 seidler2547

I can also confirm both problems. The second one is needed to fix the 500 when clicking the "Associate" button.

I've included the change in #223

Hedius avatar Mar 09 '22 01:03 Hedius

fixed with https://github.com/theforeman/foreman_fog_proxmox/pull/223

tristanrobert avatar Dec 16 '22 16:12 tristanrobert