New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't log into my own account #1102

Closed
alexgleason opened this Issue Apr 6, 2017 · 11 comments

Comments

Projects
None yet
2 participants
@alexgleason
Copy link
Contributor

alexgleason commented Apr 6, 2017

Please help, I'm really stumped.

I had some trouble updating my instance today. I thought the database was gone, but I was able to find it and get it back in place. Now when I try to log into my own account it says "Invalid username or password". If I try to reset my password, it says "User not found." I don't know what to do. I've tried restarting the server to no avail. I was able to make another account and set it to an admin. It can log in fine. Only my account seems to be affected... user ID 1. Any ideas? Thank you.

I should mention: I'm logged into the account on my other computer and it kept me logged in. The account works fine there, but I cannot log in from a different computer.

@wxcafe

This comment has been minimized.

Copy link
Contributor

wxcafe commented Apr 6, 2017

What kind of trouble did you have updating the instance? Can you log into the Postgres database and make sure select * from users where id=1; shows your user?

@alexgleason

This comment has been minimized.

Copy link
Contributor

alexgleason commented Apr 6, 2017

@wxcafe Thank you for the reply. I can indeed select the user in postgres. I can also view the user account in the admin when logged in as a different user.

Earlier today I upgraded my site and the docker db volume became disassociated with my container. I had to copy the contents from the old volume back into the new one.

@wxcafe

This comment has been minimized.

Copy link
Contributor

wxcafe commented Apr 6, 2017

I've never used the dockers stuff :/ Can you try (after doing a backup) changing the 'encrypted_password' for your user? It's hashed using bcrypt, so you could try hashing a simple password with bcrypt, changing the data in that column, and logging in. If that works then you can simply change the password again from there.

@alexgleason

This comment has been minimized.

Copy link
Contributor

alexgleason commented Apr 6, 2017

@wxcafe Thank you, I will try this shortly. For what it's worth, I still have a session where this user is logged in on another computer. I've gone into the settings and changed my password there, but it didn't work. I think this would do the same thing as changing the password manually in the db.

I'm concerned something else is broken or out of sync. FWIW I noticed the authentication code has been edited in the codebase since this last worked. I don't know what Redis does; could it be managing user accounts and be out of sync? Or is there some cache somewhere I can clear or rebuild?

@wxcafe

This comment has been minimized.

Copy link
Contributor

wxcafe commented Apr 6, 2017

@alexgleason

This comment has been minimized.

Copy link
Contributor

alexgleason commented Apr 6, 2017

I have migrated the db and recompiled static assets. I'll report back shortly if the row gets changed when updating my password. I do get a confirmation email to my email address.

The thing that puzzles me is how "I forgot my password" claims it can't even find my user. Also, sometimes when trying to log in it will give me an error that says something like "422, do you have cookies disabled? Could not pass security verification." It may be just from backing out of the form and hitting submit again. I've cleared my cookies and they are enabled; have also attempted on multiple devices.

@alexgleason

This comment has been minimized.

Copy link
Contributor

alexgleason commented Apr 6, 2017

Strangely, I just attempted to log in again and it worked. Something must have been out of sync. I don't understand it.

@alexgleason alexgleason closed this Apr 6, 2017

@alexgleason

This comment has been minimized.

Copy link
Contributor

alexgleason commented Apr 7, 2017

May have spoken too soon. I could log in on my laptop, but I can't now on my desktop. I didn't delete any cookies on my laptop. Maybe it already had a session cookie saved which worked? I'm so confused why this is happening.

EDIT: Just attempted on a computer I've never signed into before. It wouldn't let me log in.

@alexgleason alexgleason reopened this Apr 7, 2017

@alexgleason

This comment has been minimized.

Copy link
Contributor

alexgleason commented Apr 7, 2017

I updated the password for the user, and I can see that the password did change in the database. I have a feeling this has something to do with sessions.

@alexgleason

This comment has been minimized.

Copy link
Contributor

alexgleason commented Apr 7, 2017

Omg, what the hell is happening?

postgres=# SELECT * FROM users WHERE email LIKE 'alex@alexgleason.me';

zero results!

postgres=# SELECT * FROM users WHERE email LIKE 'my.friends@email.com';

she shows up...

postgres=# UPDATE users SET email='alex@alexgleason.me' WHERE id=1;

updating the row with my email... just to sanity check.

postgres=# SELECT * FROM users WHERE email LIKE 'alex@alexgleason.me';

still zero results!

postgres=# SELECT * FROM users WHERE id=1;

I show up fine when selected by id...

postgres=# SELECT * FROM users WHERE email LIKE 'alex@alexgleason.me%';

I show up with a wildcard on the right. Could there be something there?

postgres=# SELECT * FROM users WHERE email LIKE '%alex@alexgleason.me';

I show up with a wildcard on the left, too...

postgres=# SELECT * FROM users WHERE email LIKE 'alex@alexgleason.me';

I don't show up without a wildcard, but my friend does...

Any ideas?

@alexgleason

This comment has been minimized.

Copy link
Contributor

alexgleason commented Apr 7, 2017

Just attempted to log in again after several hours. It logged me in. I shelled back into postgres and ran this command again:

postgres=# SELECT * FROM users WHERE email='alex@alexgleason.me';

IT WORKED. It worked this time, what the hell? So clearly this was an issue with Postgres. But, how can you even prevent or fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment