Latest foreman_discovery (1.3.0.rc2) duplicate the PUT request for provisioning

Hey, I'm facing different behavior in latest branch when sending same
request for provision:

the data duplicate itself with "discover =>" header

my request:
url: http://[myforeman-url]/discovers/52540007aa4d

header: Content-Type:application/json

data:
{
"host": {
"name": "52540007aa4d",
"hostgroup_id": "3",
"environment_id": "0",
"puppet_ca_proxy_id": "1",
"puppet_proxy_id": "1",
"puppetclass_ids": [
""
],
"managed": "true",
"progress_report_id": "",
"type": "Host::Managed",
"domain_id": "0",
"realm_id": "",
"mac": "52:54:00:07:b8:e0",
"subnet_id": "0",
"ip": "192.168.223.46",
"interfaces_attributes": {
"new_interfaces": {
"_destroy": "false",
"type": "Nic::Managed",
"mac": "",
"name": "",
"domain_id": "",
"ip": "",
"provider": "IPMI"
}
},
"architecture_id": "1",
"operatingsystem_id": "2",
"provision_method": "build",
"build": "1",
"medium_id": "3",
"ptable_id": "6",
"disk": "",
"root_pass": "123123123",
"enabled": "1",
"model_id": "",
"comment": "",
"overwrite": "false"
},
"id": "525400c61633"
}

in production log i get:

{"host"=>{"name"=>"52540007aa4d", "hostgroup_id"=>"3",
"environment_id"=>"0", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1",
"puppetclass_ids"=>[""], "managed"=>"true",
"progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed",
"domain_id"=>"0", "realm_id"=>"", "mac"=>"52:54:00:07:b8:e0",
"subnet_id"=>"0", "ip"=>"192.168.223.46",
"interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false",
"type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"",
"provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"2",
"provision_method"=>"build", "build"=>"1", "medium_id"=>"3",
"ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "enabled"=>"1",
"model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "id"=>"52540007aa4d","discover"=>{"host"=>{"name"=>"52540007aa4d",
"hostgroup_id"=>"3", "environment_id"=>"0", "puppet_ca_proxy_id"=>"1",
"puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true",
"progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed",
"domain_id"=>"0", "realm_id"=>"", "mac"=>"52:54:00:07:b8:e0",
"subnet_id"=>"0", "ip"=>"192.168.223.46",
"interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false",
"type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"",
"provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"2",
"provision_method"=>"build", "build"=>"1", "medium_id"=>"3",
"ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "enabled"=>"1",
"model_id"=>"", "comment"=>"", "overwrite"=>"false"}}}

after id=** the request repeats itself and the action fails.

my questions are:

  1. shouldn't the url change to api/v2/discovers/[id] ?
  2. why does it duplicate the data?
  3. was something changed in json requests? should I use x-www-form-urlencoded
    instead?

thanks.
Yaniv Bronhaim.

I am discussing this with Yaniv on IRC. Will get back with results
here.

LZ

··· On Wed, May 14, 2014 at 01:24:44AM -0700, Yaniv Bronhaim wrote: > Hey, I'm facing different behavior in latest branch when sending same > request for provision: > > the data duplicate itself with "discover =>" header > > my request: > url: http://[myforeman-url]/discovers/52540007aa4d > > header: Content-Type:application/json > > data: > { > "host": { > "name": "52540007aa4d", > "hostgroup_id": "3", > "environment_id": "0", > "puppet_ca_proxy_id": "1", > "puppet_proxy_id": "1", > "puppetclass_ids": [ > "" > ], > "managed": "true", > "progress_report_id": "", > "type": "Host::Managed", > "domain_id": "0", > "realm_id": "", > "mac": "52:54:00:07:b8:e0", > "subnet_id": "0", > "ip": "192.168.223.46", > "interfaces_attributes": { > "new_interfaces": { > "_destroy": "false", > "type": "Nic::Managed", > "mac": "", > "name": "", > "domain_id": "", > "ip": "", > "provider": "IPMI" > } > }, > "architecture_id": "1", > "operatingsystem_id": "2", > "provision_method": "build", > "build": "1", > "medium_id": "3", > "ptable_id": "6", > "disk": "", > "root_pass": "123123123", > "enabled": "1", > "model_id": "", > "comment": "", > "overwrite": "false" > }, > "id": "525400c61633" > } > > in production log i get: > > {"host"=>{"name"=>"52540007aa4d", "hostgroup_id"=>"3", > "environment_id"=>"0", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", > "puppetclass_ids"=>[""], "managed"=>"true", > "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", > "domain_id"=>"0", "realm_id"=>"", "mac"=>"52:54:00:07:b8:e0", > "subnet_id"=>"0", "ip"=>"192.168.223.46", > "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", > "type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"", > "provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"2", > "provision_method"=>"build", "build"=>"1", "medium_id"=>"3", > "ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "enabled"=>"1", > "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "id"=>"52540007aa4d","discover"=>{"host"=>{"name"=>"52540007aa4d", > "hostgroup_id"=>"3", "environment_id"=>"0", "puppet_ca_proxy_id"=>"1", > "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true", > "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", > "domain_id"=>"0", "realm_id"=>"", "mac"=>"52:54:00:07:b8:e0", > "subnet_id"=>"0", "ip"=>"192.168.223.46", > "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", > "type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"", > "provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"2", > "provision_method"=>"build", "build"=>"1", "medium_id"=>"3", > "ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "enabled"=>"1", > "model_id"=>"", "comment"=>"", "overwrite"=>"false"}}} > > after id=** the request repeats itself and the action fails. > > my questions are: > 1. shouldn't the url change to api/v2/discovers/[id] ? > 2. why does it duplicate the data? > 3. was something changed in json requests? should I use x-www-form-urlencoded > instead? > > > thanks. > Yaniv Bronhaim. > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Hey,

first of all, there was no API in discovery at all. You were using UI
controller that has some redirects in there. Don't use it.

What you want to use is API V2 now. This has been added here:

https://github.com/theforeman/foreman_discovery/commit/f1b03f6c7d4e612489afc074b5e945bee2dc7394

> 1. shouldn't the url change to api/v2/discovers/[id] ?

Yes, that's what you want to use. See the above commit for documentation
about what it expects.

> 2. why does it duplicate the data?
> 3. was something changed in json requests? should I use x-www-form-urlencoded
> instead?

The whole data structure is likely different now. Check the
documentation strings there.

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

>
> Hey,
>
> first of all, there was no API in discovery at all. You were using UI
> controller that has some redirects in there. Don't use it.
>
> What you want to use is API V2 now. This has been added here:
>
>
> https://github.com/theforeman/foreman_discovery/commit/f1b03f6c7d4e612489afc074b5e945bee2dc7394
>
> > 1. shouldn't the url change to api/v2/discovers/[id] ?
>
> Yes, that's what you want to use. See the above commit for documentation
> about what it expects.
>
> yes, its a bit different form in v2,
but still the request in server side fails due to "Name must not include
periods" , no matter what i put in name, and the message shows that it
sends the same data twice:

{"id"=>"5254002fe2f6", "discovered_host"=>{"name"=>"52540007aa4d",
"environment_id"=>"0", "ip"=>"192.168.223.46", "mac"=>"52:54:00:07:b8:e0",
"architecture_id"=>"1", "domain_id"=>"0", "puppet_proxy_id"=>"1",
"puppetclass_ids"=>[""], "operatingsystem_id"=>"2", "medium_id"=>"3",
"ptable_id"=>"6", "subnet_id"=>"0", "compute_resource_id"=>"0",
"model_id"=>"", "hostgroup_id"=>"3", "owner_id"=>"",
"puppet_ca_proxy_id"=>"0", "image_id"=>"", "root_pass"=>"[FILTERED]"},
"apiv"=>"v2", "discover"=>{"id"=>"5254002fe2f6",
"discovered_host"=>{"name"=>"52540007aa4d", "environment_id"=>"0",
"ip"=>"192.168.223.46", "mac"=>"52:54:00:07:b8:e0", "architecture_id"=>"1",
"domain_id"=>"0", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""],
"operatingsystem_id"=>"2", "medium_id"=>"3", "ptable_id"=>"6",
"subnet_id"=>"0", "compute_resource_id"=>"0", "model_id"=>"",
"hostgroup_id"=>"3", "owner_id"=>"", "puppet_ca_proxy_id"=>"0",
"image_id"=>"", "root_pass"=>"[FILTERED]"}}}

> 2. why does it duplicate the data?
>
^^

··· On Wednesday, May 14, 2014 1:52:16 PM UTC+3, Lukas Zapletal wrote:
  1. was something changed in json requests? should I use
    x-www-form-urlencoded
    instead?

The whole data structure is likely different now. Check the
documentation strings there.


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

I've reproduced the duplicated parameters, which I'm looking into now.
However, it should have no effect on your provisioning - hosts provision
fine for me. Please share the actual error in the foreman logs when you
send a PUT to the /api/v2/discovers/:id

Hey,

indeed, provisioning by UI works fine, but each PUT request for
provision/:id fails regard to this duplication.
not sure if only provision requests effect with this duplication or its
something related to some type of requests, but anyhow, the PUT request
fails for the old api with "Failed to save: Name must not include periods,
Name is invalid",
for the new api output see below

using old api:

··· --- Started PUT "/discovers/5254002fe2f6" for 192.168.223.1 at 2014-05-15 08:38:42 +0000 Processing by DiscoversController#update as HTML Parameters: {"host"=>{"name"=>"5254002fe2f6", "hostgroup_id"=>"2", "environment_id"=>"0", "puppet_ca_proxy_i d"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED] ", "type"=>"Host::Managed", "mac"=>"52:54:00:2f:e2:f6", "domain_id"=>"0", "subnet_id"=>"0", "ip"=>"192.168.223.56", "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", "type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"", "provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"0", "provision_method"=>"build", "build"=>"1", "medium_id"=>"0", "ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "host_parameters_attributes"=>{""=>{"name"=>"host_id", "value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}}, "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "id"=>"5254002fe2f6", "discover"=>{"host"=>{"name"=>"5254002fe2f6", "hostgroup_id"=>"2", "environment_id"=>"0", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "mac"=>"52:54:00:2f:e2:f6", "domain_id"=>"0", "subnet_id"=>"0", "ip"=>"192.168.223.56", "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", "type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"", "provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"0", "provision_method"=>"build", "build"=>"1", "medium_id"=>"0", "ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "host_parameters_attributes"=>{""=>{"name"=>"host_id", "value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}}, "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "id"=>"5254002fe2f6"}} WARNING: Can't verify CSRF token authenticity Failed to save: Name must not include periods, Name is invalid Rendered hosts/_progress.html.erb (0.5ms) Rendered common/_domain.html.erb (1.8ms) --- new api: Started PUT "/api/v2/discovers/5254002fe2f6" for 192.168.223.1 at 2014-05-18 05:42:54 +0000 Processing by Api::DiscoversController#update as JSON Parameters: {"host"=>{"name"=>"5254002fe2f6", "hostgroup_id"=>"3", "environment_id"=>"0", "puppet_ca_proxy_i d"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED] ", "type"=>"Host::Managed", "domain_id"=>"0", "realm_id"=>"", "mac"=>"52:54:00:07:b8:e0", "subnet_id"=>"0", "i p"=>"192.168.223.46", "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", "type"=>"Nic::Managed" , "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"", "provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsy stem_id"=>"2", "provision_method"=>"build", "build"=>"1", "medium_id"=>"3", "ptable_id"=>"6", "disk"=>"", "roo t_pass"=>"[FILTERED]", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "id"=>"5254002fe2 f6", "apiv"=>"v2", "discover"=>{"host"=>{"name"=>"5254002fe2f6", "hostgroup_id"=>"3", "environment_id"=>"0", " puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report _id"=>"[FILTERED]", "type"=>"Host::Managed", "domain_id"=>"0", "realm_id"=>"", "mac"=>"52:54:00:07:b8:e0", "su bnet_id"=>"0", "ip"=>"192.168.223.46", "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", "type "=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"", "provider"=>"IPMI"}}, "architecture_id"=> "1", "operatingsystem_id"=>"2", "provision_method"=>"build", "build"=>"1", "medium_id"=>"3", "ptable_id"=>"6", "disk"=>"", "root_pass"=>"[FILTERED]", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "id"=>"5254002fe2f6"}} WARNING: Can't verify CSRF token authenticity undefined method `boot_filename' for nil:NilClass (NoMethodError) /home/ybronhei/foreman/app/models/concerns/orchestration/dhcp.rb:60:in `dhcp_attrs' /home/ybronhei/foreman/app/models/concerns/orchestration/dhcp.rb:16:in `dhcp_record' /home/ybronhei/foreman/app/models/concerns/orchestration/dhcp.rb:140:in `dhcp_conflict_detected?' /home/ybronhei/foreman/vendor/ruby/gems/activesupport-3.2.18/lib/active_support/callbacks.rb:504:in `_run__436 4184019066893064__validation__2257906483471258693__callbacks' /home/ybronhei/foreman/vendor/ruby/gems/activesupport-3.2.18/lib/active_support/callbacks.rb:405:in `__run_cal lback' /home/ybronhei/foreman/vendor/ruby/gems/activesupport-3.2.18/lib/active_support/callbacks.rb:385:in `_run_vali dation_callbacks' /home/ybronhei/foreman/vendor/ruby/gems/activesupport-3.2.18/lib/active_support/callbacks.rb:81:in `run_callba cks' /home/ybronhei/foreman/vendor/ruby/gems/activemodel-3.2.18/lib/active_model/validations/callbacks.rb:53:in `ru n_validations!' /home/ybronhei/foreman/vendor/ruby/gems/activemodel-3.2.18/lib/active_model/validations.rb:195:in `valid?' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/validations.rb:69:in `valid?' /home/ybronhei/foreman/app/models/concerns/orchestration.rb:47:in `valid?' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/validations.rb:77:in `perform_va lidations' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/validations.rb:50:in `save' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/attribute_methods/dirty.rb:22:in `save' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:259:in `block (2 levels) in save' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:208:in `transaction' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:311:in `with_transaction_returning_status' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:259:in `block in save' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:270:in `rollback_active_record_state!' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:258:in `save' /home/ybronhei/foreman/app/models/concerns/foreman/sti.rb:29:in `save_with_type' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/persistence.rb:217:in `block in update_attributes' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:208:in `transaction' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/transactions.rb:311:in `with_transaction_returning_status' /home/ybronhei/foreman/vendor/ruby/gems/activerecord-3.2.18/lib/active_record/persistence.rb:215:in `update_attributes' /home/ybronhei/foreman_discovery/app/controllers/api/discovers_controller.rb:79:in `update' /home/ybronhei/foreman/vendor/ruby/gems/actionpack-3.2.18/lib/action_controller/metal/implicit_render.rb:4:in `send_action' /home/ybronhei/foreman/vendor/ruby/gems/actionpack-3.2.18/lib/abstract_controller/base.rb:167:in `process_action' /home/ybronhei/foreman/vendor/ruby/gems/actionpack-3.2.18/lib/action_controller/metal/rendering.rb:10:in `process_action' ... /home/ybronhei/foreman/vendor/ruby/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call' /home/ybronhei/foreman/vendor/ruby/gems/actionpack-3.2.18/lib/action_dispatch/middleware/static.rb:63:in `call ' /home/ybronhei/foreman/vendor/ruby/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward' /home/ybronhei/foreman/vendor/ruby/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass' /home/ybronhei/foreman/vendor/ruby/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate' /home/ybronhei/foreman/vendor/ruby/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!' /home/ybronhei/foreman/vendor/ruby/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call' /home/ybronhei/foreman/vendor/ruby/gems/railties-3.2.18/lib/rails/engine.rb:484:in `call' /home/ybronhei/foreman/vendor/ruby/gems/railties-3.2.18/lib/rails/application.rb:231:in `call' /home/ybronhei/foreman/vendor/ruby/gems/railties-3.2.18/lib/rails/railtie/configurable.rb:30:in `method_missin g' /home/ybronhei/foreman/vendor/ruby/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call' /home/ybronhei/foreman/vendor/ruby/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `block in call' /home/ybronhei/foreman/vendor/ruby/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `each' /home/ybronhei/foreman/vendor/ruby/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call' /home/ybronhei/foreman/vendor/ruby/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call' /home/ybronhei/foreman/vendor/ruby/gems/railties-3.2.18/lib/rails/rack/log_tailer.rb:17:in `call' /home/ybronhei/foreman/vendor/ruby/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service' /usr/share/ruby/webrick/httpserver.rb:138:in `service' /usr/share/ruby/webrick/httpserver.rb:94:in `run' /usr/share/ruby/webrick/server.rb:295:in `block in start_thread' Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (0.6ms) Completed 500 Internal Server Error in 266.7ms (Views: 2.0ms | ActiveRecord: 107.1ms)

On Thursday, May 15, 2014 8:25:31 PM UTC+3, Greg Sutcliffe wrote:

I’ve reproduced the duplicated parameters, which I’m looking into now.
However, it should have no effect on your provisioning - hosts provision
fine for me. Please share the actual error in the foreman logs when you
send a PUT to the /api/v2/discovers/:id

this implies there is no operating system set, and i can see that in your
request, there is no os_id in the hash.

Yaniv - please open a bug that does not validate the OS_id on api call.

Greg - why do we have both param[:host] and param[:discovers], which one
is the right one for the update?

Ohad

··· On Sun, May 18, 2014 at 9:14 AM, Yaniv Bronhaim wrote:

undefined method boot_filename' for nil:NilClass (NoMethodError) /home/ybronhei/foreman/app/models/concerns/orchestration/dhcp.rb:60:indhcp_attrs’
/home/ybronhei/foreman/app/models/concerns/orchestration/dhcp.rb:16:in
dhcp_record' /home/ybronhei/foreman/app/models/concerns/orchestration/dhcp.rb:140:indhcp_conflict_detected?’
/home/ybronhei/foreman/vendor/ruby/gems/activesupport-3.2.18/lib/active_support/callbacks.rb:504:in
`run

> Greg - why do we have both param[:host] and param[:discovers], which one is
> the right one for the update?

It's a mistake in how I wrote the API originally - our API code
expects that the root node matches the controller name, so one has to
send 'discover' (singular of the Discovers controller) to get it
right. My open PR[1] makes some small updates to remove the duplicate
and update the readme to give some examples.

Greg

[1]https://github.com/theforeman/foreman_discovery/pull/70