theforeman / foreman_fog_proxmox

Foreman plugin to add Proxmox compute resource based on fog-proxmox gem
GNU General Public License v3.0
105 stars 30 forks source link

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

Closed elelayan closed 1 year ago

elelayan commented 2 years ago

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'
Retrospector commented 2 years ago

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

bk-lg commented 2 years ago

This change fixed the problem on my cluster.

seidler2547 commented 2 years ago

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?

Hedius commented 2 years ago

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

tristanrobert commented 1 year ago

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