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

Backend Startup Failure Due to bcrypt Version Error #393

Closed
Sevichecc opened this issue Dec 18, 2023 · 3 comments
Closed

Backend Startup Failure Due to bcrypt Version Error #393

Sevichecc opened this issue Dec 18, 2023 · 3 comments

Comments

@Sevichecc
Copy link
Contributor

Sevichecc commented Dec 18, 2023

After completing the basic backend setup, I attempted to run ./run.sh. However, the operation failed, potentially due to an issue related to bcrypt. How could I solve this?

Related issues:

[2023-12-18 13:53:39 +0800] [92564] [INFO] Starting gunicorn 21.2.0
[2023-12-18 13:53:39 +0800] [92564] [INFO] Listening at: http://127.0.0.1:8400 (92564)
[2023-12-18 13:53:39 +0800] [92564] [INFO] Using worker: bracket.uvicorn.RestartableUvicornWorker
[2023-12-18 13:53:39 +0800] [92569] [INFO] Booting worker with pid: 92569
 ⚠ Port 3000 is in use, trying 3001 instead.
 ⚠ Port 3001 is in use, trying 3002 instead.
   ▲ Next.js 14.0.3
   - Local:        http://localhost:3002

[2023-12-18 13:53:39,826] [bracket] [INFO] Current env: DEVELOPMENT
(trapped) error reading bcrypt version
Traceback (most recent call last):
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/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__'
[2023-12-18 13:53:40 +0800] [92569] [INFO] Started server process [92569]
[2023-12-18 13:53:40 +0800] [92569] [INFO] Waiting for application startup.
[2023-12-18 13:53:40 +0800] [92569] [ERROR] Traceback (most recent call last):
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/starlette/routing.py", line 677, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/opt/homebrew/Cellar/python@3.10/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File "/Users/seviche/Desktop/Project/bracket/backend/bracket/app.py", line 36, in lifespan
    await database.connect()
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/databases/core.py", line 112, in connect
    await self._backend.connect()
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/databases/backends/postgres.py", line 74, in connect
    self._pool = await asyncpg.create_pool(**kwargs)
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/pool.py", line 403, in _async__init__
    await self._initialize()
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/pool.py", line 430, in _initialize
    await first_ch.connect()
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/pool.py", line 128, in connect
    self._con = await self._pool._get_new_connection()
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/pool.py", line 502, in _get_new_connection
    con = await connection.connect(
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connection.py", line 2329, in connect
    return await connect_utils._connect(
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 1017, in _connect
    raise last_error or exceptions.TargetServerAttributeNotMatched(
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 991, in _connect
    conn = await _connect_addr(
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 828, in _connect_addr
    return await __connect_addr(params, True, *args)
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 873, in __connect_addr
    tr, pr = await connector
  File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 744, in _create_ssl_connection
    tr, pr = await loop.create_connection(
  File "/opt/homebrew/Cellar/python@3.10/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1084, in create_connection
    raise OSError('Multiple exceptions: {}'.format(
OSError: Multiple exceptions: [Errno 61] Connect call failed ('::1', 5432, 0, 0), [Errno 61] Connect call failed ('127.0.0.1', 5432)

[2023-12-18 13:53:40 +0800] [92569] [ERROR] Application startup failed. Exiting.
@Sevichecc
Copy link
Contributor Author

Setting the bcrypt version to "4.0.1" will solve this.

evroon added a commit that referenced this issue Dec 19, 2023
@evroon
Copy link
Owner

evroon commented Dec 19, 2023

@Sevichecc can you confirm it's no longer an issue now? I merged a fix

@Sevichecc
Copy link
Contributor Author

Sevichecc commented Dec 20, 2023

@evroon Yes, I can confirm that the issue has been resolved. Thank you for the fix!

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

2 participants