Corrupted User after adding new Org

Setting up a new Grafana server version v6.4.1 Centos 7, with multiple Organizations

Already had 2 Orgs Created
Using LDAPS
(no definitions for org 3 were in the LDAP toml yet but my user was part of a group definition that does not have an org ID so should not apply)

  • Created Org ID 3, and saved it. My current org changed to id 3 but noticed when I went to switch I only had the option of Org 1 or 3, not all 3 were listed.

  • Logged out. Was unable to log back in with my LDAP account (Error while trying to authenticate user), had to use the local admin.

  • Logged out. Updated the toml file to include org 3 but this should not have affected my account since my group is not org specific.

  • restarted Grafana, still was unable to log in with my user. Found in the log each time I try to log in with failed user:
    t=2019-10-18T17:36:41+0000 lvl=eror msg=“Error while trying to authenticate user” logger=context userId=0 orgId=0 uname= error=“Cannot remove last organization admin”
    t=2019-10-18T17:36:41+0000 lvl=eror msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=POST path=/login status=500 remote_addr=<> time_ms=97 size=81 referer=https://myserver/login

  • Failed user no long appears in the User interface and if I try to manually add that user it fails.

I had the same problem. I was able to fix it by deleting the user and then logging in again as that user so the account was recreated.