Project

General

Profile

Actions

Bug #31141

open

Users can't edit their profile

Added by Adam Winberg over 3 years ago. Updated over 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Users, Roles and Permissions
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When a user tries to edit their profile they get an error message:

Validation failed: Taxonomy has already been taken

This does not happen to every user and it seems to be related to permissions. I, as an admin, can edit any profile without problems.

Looking at the log the the user edit request contains:

"location_ids"=>["3", "3", ""], "default_location_id"=>"", "organization_ids"=>["1", "1", ""],

as compared to when an admin performs the same operation (on the same user):

"location_ids"=>["3", ""], "default_location_id"=>"", "organization_ids"=>["1", ""],

I suspect that the duplicate 'location_ids' and 'organization_ids' are the cause of this error, but why are there duplicate values?


Files

foreman-debug-ETzn0.tar.xz foreman-debug-ETzn0.tar.xz 1.37 MB Adam Winberg, 01/29/2021 01:34 PM
Actions #1

Updated by Adam Winberg over 3 years ago

  • Found in Releases 2.3.1 added
  • Found in Releases deleted (2.1.1)

Still having this problem on 2.3.1.

Any explanations?

Users that for some reason does not have an email address in Foreman cant login properly without editing their profile first to add the email. Which fails because of this issue.
Another question is why Foreman is not automatically adding the email address forwarded to it from my external authentication? When a new user logs in it is created and firstname, surname and email is populated based on what apache has forwarded, why doesnt Foreman do this for existing users as well?

Actions #2

Updated by Dominik Matoulek over 3 years ago

Adam Winberg wrote:

Still having this problem on 2.3.1.

Any explanations?

Users that for some reason does not have an email address in Foreman cant login properly without editing their profile first to add the email. Which fails because of this issue.
Another question is why Foreman is not automatically adding the email address forwarded to it from my external authentication? When a new user logs in it is created and firstname, surname and email is populated based on what apache has forwarded, why doesnt Foreman do this for existing users as well?

I'm trying to figure out when this happens. However, I need to know your current setup for authentication like what kind of external authentication (AD, IPA or something else?) you're using or if there is some unusual setup.

Actions #3

Updated by Adam Winberg over 3 years ago

I'm using mod_auth_cas for authentication in my apache vhost which sets REMOTE_USER, and then I use mod_lookup_identity to further set REMOTE_USER_EMAIL and REMOTE_USER_GROUPS. This works, I can see that these attributes are being sent to Foreman (Puma) and new users get their accounts created with correct email.

Actions #4

Updated by Dominik Matoulek over 3 years ago

Adam Winberg wrote:

I'm using mod_auth_cas for authentication in my apache vhost which sets REMOTE_USER, and then I use mod_lookup_identity to further set REMOTE_USER_EMAIL and REMOTE_USER_GROUPS. This works, I can see that these attributes are being sent to Foreman (Puma) and new users get their accounts created with correct email.

Could you please try it again with foreman-debug with sql logger activated? I need to understand what happen there and logs will be great asset for investigation.

Actions #5

Updated by Adam Winberg over 3 years ago

debug added.

I reproduced this issue by impersonating a user with missing email address and then tried to add the email address.

Actions

Also available in: Atom PDF