Open nerdalertdk opened 7 months ago
managed to figure out how to get all the logs :D
ots | [2024-04-20 10:55:09] - OpenTAKServer[1] - app - INFO - Creating administrator account. The password is 'password'
ots | (trapped) error reading bcrypt version
ots | Traceback (most recent call last):
ots | File "/app/.opentakserver_venv/lib/python3.12/site-packages/passlib/handlers/bcrypt.py", line 620, in _load_backend_mixin
ots | version = _bcrypt.__about__.__version__
ots | ^^^^^^^^^^^^^^^^^
ots | AttributeError: module 'bcrypt' has no attribute '__about__'
Looks like bcrypt 4.1.1 might have a bug
fixed it by adding
RUN pip3 uninstall -y bcrypt && pip3 install bcrypt==4.0.1
in my Dockerfile
Thanks for reporting this, I noticed that message too. It seemed to be just a warning and everything still worked so I didn't do anything about it. I'll do some test after downgrading bcrypt to see if there are any side effects or if everything still works.
Still see this on login also
opentakserver | (trapped) error reading bcrypt version
opentakserver | Traceback (most recent call last):
opentakserver | File "/app/.opentakserver_venv/lib/python3.12/site-packages/passlib/handlers/bcrypt.py", line 620, in _load_backend_mixin
opentakserver | version = _bcrypt.__about__.__version__
opentakserver | ^^^^^^^^^^^^^^^^^
opentakserver | AttributeError: module 'bcrypt' has no attribute '__about__'
ots@opentakserver:~/ots$ pip list | grep bcrypt
bcrypt 4.1.2
ots@opentakserver:~/ots$ python --version
Python 3.12.3
Still seeing this error in 1.2.0
opentakserver | (trapped) error reading bcrypt version
opentakserver | Traceback (most recent call last):
opentakserver | File "/app/.opentakserver_venv/lib/python3.12/site-packages/passlib/handlers/bcrypt.py", line 620, in _load_backend_mixin
opentakserver | version = _bcrypt.__about__.__version__
opentakserver | ^^^^^^^^^^^^^^^^^
opentakserver | AttributeError: module 'bcrypt' has no attribute '__about__'
ots@opentakserver:~/ots$ pip list | grep bcrypt
bcrypt 4.1.3
ots@opentakserver:~/ots$ python --version
Python 3.12.4
Still seeing this error
(venv) ➜ auth python --version
Python 3.10.14
(venv) ➜ auth pip list | grep bcrypt
bcrypt 4.2.0
(venv) ➜ auth python main.py
(trapped) error reading bcrypt version
Traceback (most recent call last):
File "./venv/lib/python3.10/site-packages/passlib/handlers/bcrypt.py", line 620, in _load_backend_mixin
version = _bcrypt.__about__.__version__
AttributeError: module 'bcrypt' has no attribute '__about__'
$2b$12$1Tw0syEdNooWZgiv1585duwnL9SEK3EgZFpDVF4rLFY6YyOiUH1LS
True
My code from https://fastapitutorial.com/blog/password-hashing-fastapi/:
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
class Hasher():
@staticmethod
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)
@staticmethod
def get_password_hash(password):
return pwd_context.hash(password)
h = Hasher.get_password_hash("supersecret1234")
check = Hasher.verify_password("supersecret1234", h)
print(h)
print(check)
When booting/starting ots in docker for the first time I get this error. When booting again it works fine.
I don't have an config.yml first time I boot. ots is creating the default for me