-
Notifications
You must be signed in to change notification settings - Fork 613
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
setup.py setup-db triggers file not found on first run of pgadmin4 #7266
Comments
@J0x90, |
As per the thread at https://www.postgresql.org/message-id/CAHAc2je_TBjuZ86nBkAjjAmjgFmAhb03kLNaROSM7nxRoor1Zw%40mail.gmail.com, this problem occurs newly in flask-migrate 4.0.6. It looks as though the changes in miguelgrinberg/Flask-Migrate@6f3f889 introduce some new behaviour which I guess pgadmin4 does not yet support. |
The |
@J0x90 @ShaheedHaque Flask-Migrate has fixed the issue and released a new version - 4.0.7. Please upgrade your venv with latest Flask-Migrate |
Flask-migrate 4.0.7 does indeed fix the issue for me. |
Please note that security bugs or issues should be reported to security@pgadmin.org.
Describe the bug
When attempting to run pgadmin4 with python (https://www.pgadmin.org/download/pgadmin-4-python/), I have observed that when entering the last command in the instructions, I get an error.
Command:
pgadmin4
Error:
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/pgadmin/pgadmin4.db' -> '/var/lib/pgadmin/pgadmin4.db.20240309203301'
Looking through the source code, it appears that when the sqlite db does not exist, the program flow eventually ends up executing
flask_migrate.upgrade(migration_folder)
within db_upgrade.pyFor example, below we see upgrade_db() is entered because this is not cli_mode, and the SQLITE_PATH doesn't exist.
Next we see db_upgrade(app) is entered.
Finally, we see flask_migrate
Are yall sure that flask_migrate.upgrade is the right command to be ran for a first run of pgadmin4. Aka, will this create and initialize the db, because it appears that it is throwing an error when the db doesn't exist initially.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Successful installation.
Error message
If possible, include the full, unedited text of any error messages displayed.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: