Skip to content
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

Login fails with internal server error. Not a valid BCrypt hash. undefined #1075

Closed
fnberta opened this issue Mar 17, 2016 · 4 comments
Closed

Comments

@fnberta
Copy link

fnberta commented Mar 17, 2016

Today I noticed a very strange behaviour. On a fresh clean install with an empty DB, I create a new user via the Android SDK (1.13.0). Everything is fine, I can login with no problems. But after performing a save operation on the user, logging out and waiting a couple of minutes, login fails with the following error:
GET /api/data/login 500 9.579 ms - 45
Uncaught internal server error. Not a valid BCrypt hash. undefined

It is a mystery to me what is causing this and I had a hard time to find the steps that trigger the error. It still seems kinda random but the above steps consistently trigger it!

I am running the latest version 2.1.6 behind a nginx reverse proxy on a Ubuntu 14.04 system with Node.js version v5.8.0. EDIT: I also tried running the app locally on my OSX system (direct access without nginx), resulting in the same error.

I know this is a rather vague bug report, but maybe you can point me in the right direction to find the cause for this?

@hramos
Copy link
Contributor

hramos commented Apr 1, 2016

We are closing this issue due to a lack of sufficient information. Feel free to reopen once you have more information that can help us reproduce the issue.

Please refer to this issue for an example of a great bug report.

Make sure these boxes are checked before submitting another issue -- thanks for reporting issues back to Parse Server!

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

@hramos hramos closed this as completed Apr 1, 2016
@dnunes
Copy link

dnunes commented May 15, 2016

I am having exactly the same problem.

  • I did a fresh install in a local MongoDB setup;
  • I installed Parse Server in my Node.JS project;
  • I installed parse-dashboard ("-g") in my machine;
  • I ran the project (default node index.js);
  • I ran the parse-dashboard as well (default parse-dashboard --config=yadda.xml);
  • I used the Parse Dashboard interface to create a user;
  • I tried to log in using "Parse.login" in my app.
  • My Node.JS console shows:

error: Uncaught internal server error. Not a valid BCrypt hash. undefineded

Thinking about it, my Parse Dashboard is not showing the "password" field (I saw a bug report about it: parse-community/parse-dashboard#231) and I may have created a user without password, so that the BCrypt input may be "undefined" and invalid for the call. If that is the case (sorry I don't have time to investigate further in the Parse Server code to confirm it), I think a simple "undefined" check would suffice.

@fnberta, can you check if your user have a password in the database, if the error still persist in your case?

@dnunes
Copy link

dnunes commented May 16, 2016

Just checked my database and the password field is a simple string, not a hash.
{ "_id" : "SJX548GlLi", (...) "password" : "123" }

It's actually not a valid BCrypt hash. I think Parse Login code doesn't deal with it very well and doesn't call the fail callback (I'm not sure who spits the console error message, maybe the lower-level BCrypt checking lib?).

@jsyadav1996
Copy link

i had same error while login so i just changed data type of password column in users table from varchar to text and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants