Bug #1335
closedinvalid value for Integer: "0xstraylen"
Description
Hi,
With, Version 0.4 on RHEL6.
When I edit an individual host and add or remove a class I am presented with the following:
ArgumentError invalid value for Integer: "0xstraylen" /usr/share/foreman/app/models/host.rb:609:in `%' /usr/share/foreman/app/models/host.rb:609:in `normalize_addresses' /usr/share/foreman/app/models/host.rb:609:in `map' /usr/share/foreman/app/models/host.rb:609:in `normalize_addresses' /usr/share/foreman/app/models/host.rb:603:in `each' /usr/share/foreman/app/models/host.rb:603:in `normalize_addresses' /usr/share/foreman/app/models/orchestration.rb:55:in `valid?' /usr/share/foreman/app/controllers/hosts_controller.rb:107:in `update'
"straylen" is ldap authenticated userid.
I did not notice this with earlier versions however recently
we started to using a script to add hosts to foreman that posts some json along
the lines of:
{host:{"architecture_id":"1","comment":"Machine Provisioned by Kickstart","domain_id":"1","environment_id":"6","hostgroup_id":"3","ip":"137.138.102.97", "mac":"XX:XX:XX:XX:XX:XX","name":"jantest03","operatingsystem_id":"1", "owner_id":"6","ptable_id":"1"}}
this problem only seems to occur for the users that have called our script to add a host. Just
to be clear we are only using the foreman API and no database calls or anything horrible.
Steve.
Files
Updated by Tomas Karasek almost 13 years ago
Hi, I am getting the same error when adding parameter to a host:
Oops, we're sorry but something went wrong x invalid value for Integer: "0xtkarasek"
The stack trace and the other environment parameters are identical to Steve's.
Following preceds the stack trace of the error in the log:
Processing HostsController#update (for 444.444.44.444 at 2011-11-17 14:35:33) [PUT] Parameters: { "commit"=>"Submit", "action"=>"update", "_method"=>"put", "authenticity_t oken"=>"YQfgdfgF456DTfkcrSYk5vap88XuQHDrinq/acJT66U=", "id"=>"XXX.domain.com", "controller"=>"hosts", "host"=>{"comment"=>"", "architecture_id"=>"1", "managed"=>"1", "puppetproxy_id"=>"", "name"=>"XXX", "host_parameters_attributes"=>{ "1321536925496"=>{"name"=>"nova_cc", "nested"=>"", "value"=>"stringvalue__fdsfsd", "_destroy"=>"" } }, "sp_mac"=>"tkarasek", "puppetmaster_name"=>"pm.domain.com", "sp_name"=>"", "mac"=>"00:e0:ed:0e:60:ae", "domain_id"=>"1", "enabled"=>"1", "root_pass"=>"[FILTERED]", "hostgroup_id"=>"14", "is_owned_by"=>"1-Users", "ptable_id"=>"1", "ip"=>"192.168.100.100", "environment_id"=>"6", "model_id"=>"1", "disk"=>"", "sp_ip"=>"", "puppetclass_ids"=>[""], "operatingsystem_id"=>"1"} }
Cheers,
Tomas
Updated by Ohad Levy almost 13 years ago
the "sp_mac"=>"tkarasek" looks strange, did you enter it somehow? maybe its your browser auto completer?
Updated by Tomas Karasek almost 13 years ago
Hi, I just tried from different workstation and it works - the host parameter gets stored. When I check the log, the parameters are all filled similarly as above, except for the sp_mac which is kept empty.
However, previously, I did not modify any input field in other tabs aside from the new parameter in "Parameters" tabs (i.e. I didn't put string "tkarasek" to "BMC MAC" manually). Tomorrow, I will check what the browser has/does.
Updated by Tomas Karasek almost 13 years ago
The string is indeed present my browser's form history for key "host[sp_mac]". Comparing the timestamp from the browser form history and the timestamp of processing the update by formeman, it looks it was added to the input field when I opened <foreman>/hosts/XXX.domain.com/edit.
Updated by Steve Traylen almost 13 years ago
- File Screenshot.png Screenshot.png added
Tomas found this today which is a much easier way to reproduce
just via the webinterface.
Start with a host that is unmanaged, in this case a host
name that has never been managed.
Edit the host
Click the "manage host button" -> "Foreman now mananges this host"
Select the new tab "network" that has now appeared.
In the BMC Mac field my username appears. Screenshot attached.
Whoever is logged in this their own username appears.
Updated by Amos Benari almost 13 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset 2ee5d488922254b6f6c5af8268f21f0ff71e7272.
Updated by Ohad Levy almost 13 years ago
- Assignee set to Greg Sutcliffe
- Target version changed from 0.4.1 to 1.0
Updated by Ohad Levy almost 13 years ago
- Assignee changed from Greg Sutcliffe to Amos Benari