qyra opened a new issue #9942:
URL: https://github.com/apache/incubator-superset/issues/9942


   I tried to create an admin user for superset to do local development and ran 
into some issues due to misleading messages from `superset fab`
   
   ```
   superset fab create-admin
   Username [admin]:
   User first name [admin]:
   User last name [user]:
   Email [[email protected]]:
   Password:
   Repeat for confirmation:
   Recognized Database Authentications.
   Error! User already exists admin
   ```
   
   Creating the user didn't work because there was apparently already a user 
`admin`. (This message is wrong)
   
   Fair enough, I had this installed a couple weeks using the same database, 
ago and it's possible I created another user with the same name before.
   
   So I tried to reset the password - and now it says the `admin` user does not 
exist.
   
   ```
   superset fab reset-password
   The username [admin]:
   Password:
   Repeat for confirmation:
   User admin not found.
   ```
   
   The only other thing I could think of was that maybe it was using something 
else as the primary key, not user. I might already have a user with the email 
`[email protected]` which means that I cannot create a new user with the same 
email, but also means that I cannot reset the password for `admin` because an 
`admin` user does not really exist. So I tried creating the `admin` user again, 
but this time with another email.
   
   ```
   superset fab create-admin
   Username [admin]:
   User first name [admin]:
   User last name [user]:
   Email [[email protected]]: [email protected]
   Password:
   Repeat for confirmation:
   Recognized Database Authentications.
   Admin User admin created.
   ```
   
   And this time it works.
   
   I also checked the output of `superset fab list-users` to verify my 
assumption:
   ```
   List of users
   -------------
   username:redacted | email:[email protected] | role:[Admin]
   username:admin | email:[email protected] | role:[Admin]
   ```
   
   and sure enough that email was already in use by another user I had created.
   
   ### Expected results
   
   It should say "Error! A user with this email already exists <email>"
   
   ### Actual results
   
   It says "Error! User already exists <username>"
   
   ### Environment
   
   Superset 0.36.0
   Python 3.6.9
   
   ### Checklist
   
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [X] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [X] I have reproduced the issue with at least the latest released version 
of superset.
   - [X] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   # Suggested Fixes
   
   If the reason a user cannot be created is because the email is taken by 
another user but the username is free, it should say the email is in use.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to