Project

General

Profile

Actions

Bug #1335

closed

invalid value for Integer: "0xstraylen"

Added by Steve Traylen about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

Screenshot.png View Screenshot.png 17.8 KB Showing the BNC being set to my user name. Steve Traylen, 11/18/2011 03:29 PM

Related issues 1 (0 open1 closed)

Has duplicate Foreman - Bug #1319: BMC MAC field prepopulated with user's email adddressDuplicate11/14/2011Actions
Actions #1

Updated by Tomas Karasek about 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

Actions #2

Updated by Ohad Levy about 13 years ago

  • Target version set to 0.4.1
Actions #3

Updated by Ohad Levy about 13 years ago

the "sp_mac"=>"tkarasek" looks strange, did you enter it somehow? maybe its your browser auto completer?

Actions #4

Updated by Tomas Karasek about 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.

Actions #5

Updated by Tomas Karasek about 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.

Actions #6

Updated by Steve Traylen about 13 years ago

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.

Actions #7

Updated by Amos Benari about 13 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions #8

Updated by Ohad Levy about 13 years ago

  • Assignee set to Greg Sutcliffe
  • Target version changed from 0.4.1 to 1.0
Actions #9

Updated by Ohad Levy about 13 years ago

  • Target version changed from 1.0 to 0.4.1

oops

Actions #10

Updated by Ohad Levy about 13 years ago

  • Assignee changed from Greg Sutcliffe to Amos Benari
Actions

Also available in: Atom PDF