Path has already been taken
Created by: anlek
Issue: A user of my Gitlab was unable to login.
Cause: Issue was caused by my user's username. Let's say their username was "Microsoft" and I also had a group called "Microsoft". I figured this out when I went into the rails console
and loaded the user and ran u.save!
it returned this: https://gist.github.com/anlek/11271126
Fix was to change the user's username (or probably to change the group's name).
tl;dr:
A user of my Gitlab was unable to login. I tried resetting the password (via admin and via reset password link) and it didn't work. I tried changing user's email to ensure it's the correct email and it didn't work.
I decided I'd go into the rails console
and modify the user myself. I made the change and did a u.save
and I would get false. I then checked what the errors were and get an empty array. I tried u.save
again and it returned true but it didn't really work. My changes didn't always take. After some playing around I was able to reset the user's password but when I logged in, I got a 500 error. Log said:
RuntimeError (Devise trackable could not save #<User id: 4, ...>
I figured Devise was having the same save
issue.
I correctly guessed the "Path" was the user's username path it was trying to create but failing because there was a group with the same name (creating the same path).
I think you need to catch this condition and maybe just return an error.