hi,
foreman version : 1.4.4
foreman_api version: 0.1.11
when i try to create an already existing smart_class_parameter override
value via the foreman_api i do get a 500 internal server error instead
of a useful failure message.
the example code and the stack trace from the foreman production log is
here:
foreman_500_stack_trace
Started POST "/api/smart_class_parameters/tcp_server_address/override_values" for 10.255.1.30 at 2014-06-05 11:03:24 +0200
Processing by Api::V2::OverrideValuesController#create as JSON
Parameters: {"override_value"=>"[FILTERED]", "apiv"=>"v2", "smart_class_parameter_id"=>"tcp_server_address"}
Authorized user admin(Admin User)
Validation failed: Match has already been taken (ActiveRecord::RecordInvalid)
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `block in save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
This file has been truncated. show original
foreman_override_value_500.rb
#!/usr/bin/env ruby
require 'foreman_api'
require 'logger'
api = ForemanApi::Resources::OverrideValue.new(
{
:base_url => 'http://foreman',
:username => 'admin',
:password => 'hahaha',
This file has been truncated. show original
maybe i'm using the foreman_api in the wrong way, i just started using
it. i was just expecting some kind of 4xx failure code, not an internal
server error.
should i open a bug report?
thanks for you help
toni