CRUD Groups in MIQ UI

Hello,

I am facing a problem when trying to add a new group in UI Access Control.
If I click on Groups (and tree is expanding) -> Configuration -> Add a new Group, but nothing happens.
I see POST request log:

“POST /ops/x_button?pressed=rbac_group_add HTTP/1.1” 1631

and in production.log we get a “NoMethodError” error:
[----] I, [2020-05-07T16:57:29.684548 #23399:3e1c1a4] INFO – : Started POST “/ops/x_button?pressed=rbac_group_add” for 192.168.103.26 at 2020-05-07 16:57:29 +0200

[----] I, [2020-05-07T16:57:29.686931 #23399:3e1c1a4] INFO – : Processing by OpsController#x_button as JS
[----] I, [2020-05-07T16:57:29.687007 #23399:3e1c1a4] INFO – : Parameters: {“pressed”=>“rbac_group_add”}
[----] F, [2020-05-07T16:57:29.719776 #23399:3e1c1a4] FATAL – : Error caught: [NoMethodError] undefined method  `empty' for #<Classification::ActiveRecord_Associations_CollectionProxy:0x0000000014ea7d60>__ /usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.7/lib/active_record/relation/delegation.rb:125:in ` method_missing’
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.7/lib/active_record/relation/delegation.rb:95:in  `method_missing' /usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/controllers/ops_controller/ops_rbac.rb:904:in ` block in rbac_group_right_tree’
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/controllers/ops_controller/ops_rbac.rb:903:in  `select' /usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/controllers/ops_controller/ops_rbac.rb:903:in ` rbac_group_right_tree’
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/controllers/ops_controller/ops_rbac.rb:1197:in  `rbac_group_set_form_vars' /usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/controllers/ops_controller/ops_rbac.rb:647:in ` rbac_edit_reset’
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/controllers/ops_controller/ops_rbac.rb:85:in  `rbac_group_add' /usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/controllers/application_controller/explorer.rb:211:in ` generic_x_button’
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/controllers/ops_controller.rb:92:in  `x_button' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_controller/metal/basic_implicit_render.rb:4:in ` send_action’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/abstract_controller/base.rb:186:in  `process_action' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_controller/metal/rendering.rb:30:in ` process_action’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/abstract_controller/callbacks.rb:20:in  `block in process_action' /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:131:in ` run_callbacks’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/abstract_controller/callbacks.rb:19:in  `process_action' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_controller/metal/rescue.rb:20:in ` process_action’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_controller/metal/instrumentation.rb:32:in  `block in process_action' /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/notifications.rb:166:in ` block in instrument’
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/notifications/instrumenter.rb:21:in  `instrument' /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/notifications.rb:166:in ` instrument’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_controller/metal/instrumentation.rb:30:in  `process_action' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_controller/metal/params_wrapper.rb:252:in ` process_action’
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.7/lib/active_record/railties/controller_runtime.rb:22:in  `process_action' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/abstract_controller/base.rb:124:in ` process’
/usr/local/lib/ruby/gems/2.5.0/gems/actionview-5.1.7/lib/action_view/rendering.rb:30:in  `process' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_controller/metal.rb:189:in ` dispatch’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_controller/metal.rb:253:in  `dispatch' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/routing/route_set.rb:49:in ` dispatch’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/routing/route_set.rb:31:in  `serve' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/journey/router.rb:50:in ` block in serve’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/journey/router.rb:33:in  `each' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/journey/router.rb:33:in ` serve’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/routing/route_set.rb:844:in  `call' /usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-graphql-ef6880aaae05/lib/manageiq/graphql/rest_api_proxy.rb:18:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/secure_headers-3.0.3/lib/secure_headers/middleware.rb:10:in  `call' /var/www/miq/vmdb/lib/request_started_on_middleware.rb:12:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/etag.rb:25:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/conditional_get.rb:38:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/head.rb:12:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:232:in ` context’
/usr/local/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:226:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/cookies.rb:613:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/callbacks.rb:26:in  `block in call' /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:97:in ` run_callbacks’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/callbacks.rb:24:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/debug_exceptions.rb:59:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/show_exceptions.rb:31:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/rack/logger.rb:36:in ` call_app’
/usr/local/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/rack/logger.rb:26:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/remote_ip.rb:79:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/request_id.rb:25:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/method_override.rb:22:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/runtime.rb:22:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/executor.rb:12:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/sendfile.rb:111:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/engine.rb:522:in  `call' /usr/local/lib/ruby/gems/2.5.0/gems/puma-3.7.1/lib/puma/configuration.rb:232:in ` call’
/usr/local/lib/ruby/gems/2.5.0/gems/puma-3.7.1/lib/puma/server.rb:578:in  `handle_request' /usr/local/lib/ruby/gems/2.5.0/gems/puma-3.7.1/lib/puma/server.rb:415:in ` process_client’
/usr/local/lib/ruby/gems/2.5.0/gems/puma-3.7.1/lib/puma/server.rb:275:in  `block in run' /usr/local/lib/ruby/gems/2.5.0/gems/puma-3.7.1/lib/puma/thread_pool.rb:120:in ` block in spawn_thread’
[----] I, [2020-05-07T16:57:29.720554 #23399:3e1c1a4] INFO – : Rendered /usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-ui-classic-2b8978443475/app/views/layouts/_exception_contents.html.haml (0.1ms)
[----] I, [2020-05-07T16:57:29.720841 #23399:3e1c1a4] INFO – : Completed 200 OK in 34ms (Views: 0.6ms | ActiveRecord: 3.6ms)

Nevertheless we are able to get role and tenant id and then create group via api:

POST https://miq.example.com/api/groups
{
“description” : “EvmGroupCustom”,
“role” : { “id” : “2101000000000011” },
“tenant” : { “id” : “2101000000000001” }
}

Is this kind of bug?
Please help.
Thank you.

@octavian.dodita This feels like a bug. Can you open a bug issue on github.com/ManageIQ/manageiq/issues ?

Thx a lot. Created

Which issue please?

This was fixed in https://github.com/ManageIQ/manageiq-ui-classic/pull/6774

EDIT: https://github.com/ManageIQ/manageiq/issues/20200, closed

Super, great! Thx a lot! I will check it tomorrow.

Hi Martin, all worked like a charm! Thx a lot.