perara / wg-manager

A easy to use WireGuard dashboard and management tool
MIT License
592 stars 74 forks source link

Sql error on initial login #114

Open cbabs opened 2 years ago

cbabs commented 2 years ago

Describe the bug On initial login using docker, login is not possible due to sqlalchemy error

To Reproduce Steps to reproduce the behavior:

  1. Spin up new container
  2. Login with creds from env vars
  3. Check logs

Platform:

Stacktrace/error output wg-manager | [2021-08-13 17:25:55 +0000] [12] [INFO] Application startup complete. wg-manager | No row was found for one() wg-manager | Traceback (most recent call last): wg-manager | File "/app/schemas.py", line 74, in from_db wg-manager | db_item = self.filter_query(sess).one() wg-manager | File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3500, in one wg-manager | raise orm_exc.NoResultFound("No row was found for one()") wg-manager | sqlalchemy.orm.exc.NoResultFound: No row was found for one() wg-manager | No row was found for one() wg-manager | Traceback (most recent call last): wg-manager | File "/app/schemas.py", line 74, in from_db wg-manager | db_item = self.filter_query(sess).one() wg-manager | File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3500, in one wg-manager | raise orm_exc.NoResultFound("No row was found for one()") wg-manager | sqlalchemy.orm.exc.NoResultFound: No row was found for one() wg-manager | We did not find any records in the database that corresponds to the model. This means you are trying to fetch a unsaved schema! wg-manager | We did not find any records in the database that corresponds to the model. This means you are trying to fetch a unsaved schema! wg-manager | 68.53.141.76:32770 - "POST /api/v1/login HTTP/1.1" 401 wg-manager | 68.53.141.76:32770 - "POST /api/v1/login HTTP/1.1" 401