EnterpriseDB / edb-installers

PostgreSQL installers packaged by EDB
36 stars 11 forks source link

The pgAdmin 4 server could not be contacted #165

Closed freddylievano closed 1 month ago

freddylievano commented 2 months ago

I just installed postgresql-17.0-rc1-windows-x64 on windows 11, everything seems to be ok during the installation, but when I execute the application pgAdmin 4 is sends me next error:

The pgAdmin 4 server could not be contacted.

This is what I got in the log file after the error: pgAdmin Runtime Environment

Python Path: "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\python.exe" Runtime Config File: "C:\Users\fffff\AppData\Roaming\pgadmin4\config.json" Webapp Path: "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgAdmin4.py" pgAdmin Command: "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgAdmin4.py" Environment:

Total spawn time to start the pgAdmin4 server: 0.045 Sec 2024-09-23 13:30:31,853: ERROR pgadmin: Database migration failed

2024-09-23 13:30:31,855: ERROR pgadmin: Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 690, in drop_constraint const = self.named_constraints.pop(const.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'ck_port_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin__init.py", line 386, in upgrade_db db_upgrade(app) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade flask_migrate.upgrade(migration_folder) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 111, in wrapped f(*args, kwargs) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 200, in upgrade command.upgrade(config, revision, sql=sql, tag=tag) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\command.py", line 406, in upgrade script.run_env() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\script\base.py", line 582, in run_env util.load_python_file(self.dir, "env.py") File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 95, in load_python_file module = load_module_py(module_id, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 113, in load_module_py spec.loader.exec_module(module) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 95, in run_migrations_online() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 87, in run_migrations_online context.run_migrations() File "", line 8, in run_migrations File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\environment.py", line 946, in run_migrations self.get_context().run_migrations(kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\migration.py", line 628, in run_migrations step.migrationfn(**kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\migrations\versions\a77a0932a568.py", line 28, in upgrade with op.batch_alter_table("server") as batch_op: File "contextlib.py", line 144, in exit__ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\base.py", line 398, in batch_alter_table impl.flush() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 162, in flush fn(*arg, **kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 701, in drop_constraint raise ValueError("No such constraint: '%s'" % const.name) ValueError: No such constraint: 'ck_port_range'

2024-09-23 13:30:31,856: ERROR pgadmin: Exception in database migration.

2024-09-23 13:30:32,028: ERROR pgadmin: Database migration failed

NOTE: Configuring authentication for DESKTOP mode. NOTE: Configuring authentication for DESKTOP mode.

2024-09-23 13:30:32,030: ERROR pgadmin: Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 690, in drop_constraint const = self.named_constraints.pop(const.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'ck_port_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin__init.py", line 386, in upgrade_db db_upgrade(app) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade flask_migrate.upgrade(migration_folder) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 111, in wrapped f(*args, kwargs) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 200, in upgrade command.upgrade(config, revision, sql=sql, tag=tag) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\command.py", line 406, in upgrade script.run_env() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\script\base.py", line 582, in run_env util.load_python_file(self.dir, "env.py") File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 95, in load_python_file module = load_module_py(module_id, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 113, in load_module_py spec.loader.exec_module(module) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 95, in run_migrations_online() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 87, in run_migrations_online context.run_migrations() File "", line 8, in run_migrations File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\environment.py", line 946, in run_migrations self.get_context().run_migrations(kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\migration.py", line 628, in run_migrations step.migrationfn(**kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\migrations\versions\a77a0932a568.py", line 28, in upgrade with op.batch_alter_table("server") as batch_op: File "contextlib.py", line 144, in exit__ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\base.py", line 398, in batch_alter_table impl.flush() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 162, in flush fn(*arg, **kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 701, in drop_constraint raise ValueError("No such constraint: '%s'" % const.name) ValueError: No such constraint: 'ck_port_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 690, in drop_constraint const = self.named_constraints.pop(const.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'ck_port_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin__init.py", line 372, in backup_db_file db_upgrade(app) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade flask_migrate.upgrade(migration_folder) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 111, in wrapped f(*args, kwargs) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 200, in upgrade command.upgrade(config, revision, sql=sql, tag=tag) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\command.py", line 406, in upgrade script.run_env() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\script\base.py", line 582, in run_env util.load_python_file(self.dir, "env.py") File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 95, in load_python_file module = load_module_py(module_id, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 113, in load_module_py spec.loader.exec_module(module) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 95, in run_migrations_online() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 87, in run_migrations_online context.run_migrations() File "", line 8, in run_migrations File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\environment.py", line 946, in run_migrations self.get_context().run_migrations(kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\migration.py", line 628, in run_migrations step.migrationfn(**kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\migrations\versions\7c56ea250085.py", line 26, in upgrade with op.batch_alter_table("server") as batch_op: File "contextlib.py", line 144, in exit__ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\base.py", line 398, in batch_alter_table impl.flush() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 162, in flush fn(*arg, **kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 701, in drop_constraint raise ValueError("No such constraint: '%s'" % const.name) ValueError: No such constraint: 'ck_port_range'

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 690, in drop_constraint const = self.named_constraints.pop(const.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'ck_port_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin__init.py", line 386, in upgrade_db db_upgrade(app) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade flask_migrate.upgrade(migration_folder) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 111, in wrapped f(*args, kwargs) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 200, in upgrade command.upgrade(config, revision, sql=sql, tag=tag) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\command.py", line 406, in upgrade script.run_env() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\script\base.py", line 582, in run_env util.load_python_file(self.dir, "env.py") File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 95, in load_python_file module = load_module_py(module_id, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 113, in load_module_py spec.loader.exec_module(module) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 95, in run_migrations_online() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 87, in run_migrations_online context.run_migrations() File "", line 8, in run_migrations File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\environment.py", line 946, in run_migrations self.get_context().run_migrations(kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\migration.py", line 628, in run_migrations step.migrationfn(**kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\migrations\versions\a77a0932a568.py", line 28, in upgrade with op.batch_alter_table("server") as batch_op: File "contextlib.py", line 144, in exit__ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\base.py", line 398, in batch_alter_table impl.flush() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 162, in flush fn(*arg, **kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 701, in drop_constraint raise ValueError("No such constraint: '%s'" % const.name) ValueError: No such constraint: 'ck_port_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 690, in drop_constraint const = self.named_constraints.pop(const.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'ck_port_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin__init.py", line 372, in backup_db_file db_upgrade(app) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup\db_upgrade.py", line 25, in db_upgrade flask_migrate.upgrade(migration_folder) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 111, in wrapped f(*args, kwargs) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\flask_migrate__init__.py", line 200, in upgrade command.upgrade(config, revision, sql=sql, tag=tag) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\command.py", line 406, in upgrade script.run_env() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\script\base.py", line 582, in run_env util.load_python_file(self.dir, "env.py") File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 95, in load_python_file module = load_module_py(module_id, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\util\pyfiles.py", line 113, in load_module_py spec.loader.exec_module(module) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 95, in run_migrations_online() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\setup....\migrations\env.py", line 87, in run_migrations_online context.run_migrations() File "", line 8, in run_migrations File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\environment.py", line 946, in run_migrations self.get_context().run_migrations(kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\runtime\migration.py", line 628, in run_migrations step.migrationfn(**kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\migrations\versions\7c56ea250085.py", line 26, in upgrade with op.batch_alter_table("server") as batch_op: File "contextlib.py", line 144, in exit__ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\base.py", line 398, in batch_alter_table impl.flush() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 162, in flush fn(*arg, **kw) File "C:\Program Files\PostgreSQL\17\pgAdmin 4\python\Lib\site-packages\alembic\operations\batch.py", line 701, in drop_constraint raise ValueError("No such constraint: '%s'" % const.name) ValueError: No such constraint: 'ck_port_range'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgAdmin4.py", line 103, in app = create_app() ^^^^^^^^^^^^ File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin__init.py", line 473, in create_app run_migration_for_sqlite() File "C:\Program Files\PostgreSQL\1\pgAdmin 4\web\pgadmin__init.py", line 410, in run_migration_for_sqlite upgrade_db() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\init__.py", line 391, in upgrade_db backup_db_file() File "C:\Program Files\PostgreSQL\17\pgAdmin 4\web\pgadmin\init__.py", line 379, in backup_db_file raise RuntimeError('Migration failed') RuntimeError: Migration failed

I already tried restarting the pgAdmin 4 service and even restating the windows. But nothing have worked so far.

Thanks in advance for the support you can provide.

Regards

sandeep-edb commented 2 months ago

Hi @freddylievano sorry about this. The issue has been identified and fixed. The upcoming PostgreSQL 17.0 installer this week should include the fix.

sandeep-edb commented 1 month ago

Hi, The issue should be fixed in the PostgreSQL 17.0 that is released yesterday. Could you please try that?