12

Im trying to deploy a react app on render. It works on my localhost but when deployed on render the auth function doesn't work. It shows this error

ValueError: password cannot be longer than 72 bytes, truncate manually if necessary (e.g. my_password[:72]) however my print logs show that the password is only 13 bytes.

Ive tried using crypt context and made sure the bcrypt backend is the same in local and deployment. Im stuck. Please. Help.

2
  • Please provide enough code so others can better understand or reproduce the problem. Commented Sep 27 at 6:50
  • Started seeing the same issue on my app (which is fastapi, not react) yesterday. Possibly related to a bug in the latest version of bcrypt, released 2025-09-25. Try pinning your version to 4.3.0 to avoid the new 5.0.0 version, see if that helps. Commented Sep 27 at 7:53

1 Answer 1

57

I ran into the same issue recently on a previously stable app, and it turned out to be related to the latest bcrypt release. A change in behavior between passlib and bcrypt seems to have caused problems even when the input was well under the 72-byte limit.

What solved it for me was pinning bcrypt to version 4.3.0, instead of allowing the upgrade to 5.0.0 (released on 2025-09-25). After making that change, the errors stopped.

For example, in Python you can update requirements.txt from:

bcrypt

to:

bcrypt==4.3.0

This ensures your environment uses the last known stable version. If you’re working with another stack (React, FastAPI, etc.), the same principle applies — make sure you’re not pulling in bcrypt 5.0.0 until compatibility issues are resolved.

Sign up to request clarification or add additional context in comments.

2 Comments

This really worked. I have been looking for the fix all over but non really was straightforward as this. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.