Project

General

Profile

Actions

Bug #14735

closed

Cannot delete non admin user

Added by Brad Buckingham about 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1314894
Description of problem:
When try to delete non admin user getting next error in UI

"Oops, we're sorry but something went wrong UserRole#expire_topbar_cache delegated to owner.expire_topbar_cache, but owner is nil: #<UserRole id: 478, owner_id: 376, role_id: 21, owner_type: "User">"

Version-Release number of selected component (if applicable):
6.2 SNAP 2.1

How reproducible:
Always

Steps to Reproduce:
1. Create new default user (non-admin)
2. Try to delete it

Actual results:
User is not deleted and exception is raised

Expected results:
User is deleted successfully

Additional info:


Files

production.log production.log 27.4 KB production.log Mike McCune, 04/20/2016 02:59 PM

Related issues 1 (1 open0 closed)

Related to Foreman - Tracker #10022: Taxonomies related issuesNew04/05/2015

Actions
Actions #1

Updated by Dominic Cleal about 8 years ago

  • Category set to Web Interface
  • Status changed from New to Need more information

I can't reproduce this, can you provide any more information? Is it only on 1.11.1 or on nightly? Does it happen with/without plugins? Does the user need to log in?

Logs would help, i.e.

2016-04-20 14:38:42 [app] [I] Started POST "/users" for 192.168.122.1 at 2016-04-20 14:38:42 +0000
2016-04-20 14:38:42 [app] [I] Processing by UsersController#create as */*
2016-04-20 14:38:42 [app] [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"eW3velkHNShIiKP7wkgMXF2Ggie/3FP8OGVzLtrQuWk=", "user"=>{"login"=>"testuser", "firstname"=>"test", "lastname"=>"user", "mail"=>"test@localhost", "locale"=>"", "timezone"=>"", "auth_source_id"=>"1", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "mail_enabled"=>"1", "admin"=>"0", "role_ids"=>[""]}}
2016-04-20 14:38:42 [app] [I] Expire fragment views/tabs_and_title_records-4 (0.1ms)
2016-04-20 14:38:42 [app] [I] Expire fragment views/tabs_and_title_records-4 (0.1ms)
2016-04-20 14:38:42 [app] [I] Redirected to https://foreman.example.com/users
2016-04-20 14:38:42 [app] [I] Completed 302 Found in 140ms (ActiveRecord: 54.6ms)
2016-04-20 14:38:42 [app] [I] Started GET "/users" for 192.168.122.1 at 2016-04-20 14:38:42 +0000
2016-04-20 14:38:42 [app] [I] Processing by UsersController#index as */*
2016-04-20 14:38:42 [app] [I]   Rendered users/index.html.erb within layouts/application (10.2ms)
2016-04-20 14:38:42 [app] [I]   Rendered common/_searchbar.html.erb (3.0ms)
2016-04-20 14:38:42 [app] [I]   Rendered layouts/_application_content.html.erb (6.8ms)
2016-04-20 14:38:42 [app] [I]   Rendered home/_user_dropdown.html.erb (1.6ms)
2016-04-20 14:38:42 [app] [I] Read fragment views/tabs_and_title_records-3 (0.2ms)
2016-04-20 14:38:42 [app] [I]   Rendered home/_topbar.html.erb (6.2ms)
2016-04-20 14:38:42 [app] [I]   Rendered layouts/base.html.erb (11.8ms)
2016-04-20 14:38:42 [app] [I] Completed 200 OK in 45ms (Views: 36.7ms | ActiveRecord: 2.4ms)
2016-04-20 14:38:50 [app] [I] Started DELETE "/users/4-testuser" for 192.168.122.1 at 2016-04-20 14:38:50 +0000
2016-04-20 14:38:50 [app] [I] Processing by UsersController#destroy as HTML
2016-04-20 14:38:50 [app] [I]   Parameters: {"authenticity_token"=>"eW3velkHNShIiKP7wkgMXF2Ggie/3FP8OGVzLtrQuWk=", "id"=>"4-testuser"}
2016-04-20 14:38:50 [app] [I] Expire fragment views/tabs_and_title_records-4 (0.1ms)
2016-04-20 14:38:50 [app] [I] Expire fragment views/tabs_and_title_records-4 (0.1ms)
2016-04-20 14:38:50 [app] [I] Redirected to https://foreman.example.com/users
2016-04-20 14:38:50 [app] [I] Completed 302 Found in 61ms (ActiveRecord: 19.7ms)
Actions #2

Updated by Mike McCune about 8 years ago

attached logs from error condition.

This is on foreman-1.11.0.16-1.el7sat.noarch with plugins loaded and the user needs to be logged in.

A workaround is add the "Admin" flag to the user and then perform the delete.

Actions #3

Updated by Dominic Cleal about 8 years ago

I can't reproduce this, you'll need to debug it and provide the cause. UserRole should always be destroyed before the user, and assuming it is, then the association should not be nil. Perhaps the association isn't working.

Actions #4

Updated by Marek Hulán almost 8 years ago

  • Category changed from Web Interface to Organizations and Locations
  • Status changed from Need more information to Assigned
  • Assignee set to Marek Hulán

I reproduced on current develop branch. Just create user and try to delete him/her afterwards. The issue is caused by deleting mapping between taxonomies so when sweeper tried to find user_role owner it can't even though it still exists. So to reproduce, taxonomies must be enabled.

Actions #5

Updated by The Foreman Bot almost 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3468 added
Actions #6

Updated by Marek Hulán almost 8 years ago

Actions #7

Updated by Marek Hulán almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #8

Updated by Dominic Cleal almost 8 years ago

  • translation missing: en.field_release set to 155
Actions

Also available in: Atom PDF