Bug #4759
closedorg update via api errors
Description
undefined method `[]' for nil:NilClass (NoMethodError)
/home/tomckay/code/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:75
Log snippet below...
Completed 200 OK in 696.5ms (Views: 71.2ms | ActiveRecord: 8.9ms)
Processing by Katello::Api::V2::OrganizationsController#update as application/json;version=2
Parameters: {"description"=>"The number one mega company in the world!", "api_version"=>"v2", "id"=>"megacorp"}
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."login" = 'admin' LIMIT 1
AuthSource Load (0.6ms) SELECT "auth_sources".* FROM "auth_sources" WHERE "auth_sources"."id" = 1 LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."login" = 'admin' LIMIT 1
Authenticated user Admin User against INTERNAL authentication source
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."login" = 'admin' ORDER BY firstname LIMIT 1
Setting current user thread-local variable to Admin User
(0.1ms) BEGIN
(0.5ms) UPDATE "users" SET "last_login_on" = '2014-03-20 20:12:29.528461', "updated_at" = '2014-03-20 20:12:29.530440', "preferences" = '--- {}
' WHERE "users"."id" = 1
(0.1ms) COMMIT
Role Load (0.5ms) SELECT "roles".* FROM "roles" WHERE "roles"."name" = 'Anonymous' LIMIT 1
SQL (0.5ms) SELECT "roles".id FROM "roles" INNER JOIN "user_roles" ON "roles"."id" = "user_roles"."role_id" WHERE "user_roles"."owner_id" = 1 AND "user_roles"."owner_type" = 'User'
CACHE (0.0ms) SELECT "roles".* FROM "roles" WHERE "roles"."name" = 'Anonymous' LIMIT 1
Role Exists (0.6ms) SELECT 1 AS one FROM "roles" INNER JOIN "user_roles" ON "roles"."id" = "user_roles"."role_id" WHERE "user_roles"."owner_id" = 1 AND "user_roles"."owner_type" = 'User' AND "roles"."id" = 8 LIMIT 1
Setting current user thread-local variable to Admin User
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."login" = 'admin' LIMIT 1
Authorized user admin(Admin User)
Setting current user thread-local variable to Admin User
Organization Load (0.6ms) SELECT "taxonomies".* FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') AND "taxonomies"."id" = 0 ORDER BY title LIMIT 1
Organization Load (1.0ms) SELECT "taxonomies".* FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') AND "taxonomies"."label" = 'megacorp' ORDER BY title LIMIT 1
undefined method `[]' for nil:NilClass (NoMethodError)
/home/tomckay/code/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:75:in `params_match_database'
/home/tomckay/.rvm/gems/ruby-1.9.3-p327@foreman/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:476:in `block (3 levels) in run_3166193718144539491__process_action__3429904334468108880__callbacks'
Updated by Dominic Cleal over 10 years ago
- Project changed from Foreman to Katello
- Category changed from API to API
Foreman's organization API controller seems to work correctly. It appears the parameters in this extension controller aren't getting wrapped hence the error trying to access params[:organization]
, similar to https://groups.google.com/d/msg/foreman-dev/52usYXUj4ls/qFJsdgksI6QJ.
Updated by Thomas McKay over 10 years ago
Has definitely worked after the foreman-dev post. Not sure how this is a katello bug and not a core bug.
Updated by Thomas McKay over 10 years ago
- Status changed from New to Resolved
- Triaged set to No
apipie-bindings 0.0.6 fixes this
Updated by Eric Helms over 10 years ago
- Translation missing: en.field_release set to 13