Creating a new product by limited permissions user fails with error "NoMethodError: undefined method `[]' for nil:NilClass"

Solution Verified - Updated -

Environment

  • Red Hat Satellite 6.4
  • Red Hat Satellite 6.5

Issue

  • Creating a new product by limited permissions user fails with error
"NoMethodError: undefined method `[]' for nil:NilClass"
  • The product is created even with the error on step "Actions::Katello::Product::ReindexSubscriptions" and the task becomes on paused state and the product can not be deleted until cleaning up the task.

Resolution

1) Cleanup the product's create paused task :

# foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = "Actions::Katello::Product::Create"' STATES=paused

2) Add the following filter to the role assigned to the user:

Resource            Permissions 
Subscription    view_subscriptions

3) Now the product can be used/deleted without errors and new products can be created.

Root Cause

  • When creating a user with "product" all permissions , a new product will be created but with the following errors on step "Actions::Katello::Product::ReindexSubscriptions":
"NoMethodError: undefined method `[]' for nil:NilClass"
  • The is a work around until the bugzilla opened for this issue will be fixed.

Diagnostic Steps

1) Check the permissions assigned to the user :

Resource                    Permissions             Search  

Product and Repositories    export_products,        N/A
                            sync_products, 
                            destroy_products, 
                            edit_products, 
                            create_products,
                            view_products

2) Check the product's create task status , it fails on step "Actions::Katello::Product::ReindexSubscriptions " with error :

NoMethodError

undefined method `[]' for nil:NilClass

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments