Thanks a lot for your feedback, Yogesh, 
I kind of guessed that was the issue, however, the pgadmin4.db and the 
corresponding pgadmin web instance have been running for a while with the 
initial account setup appropriately.
I wondered if the pgadmin4.db was corrupted somehow, so I first restored the 
pgadmin4.db from a backup a day ago, but I ran into the same issue.
Then I ran the command you mentioned below, sudo 
/usr/pgadmin4/bin/setup-web.shIt ended up triggering some kind of repository 
database migration, a new pgadmin4.db was created, and the pgadmin4 indeed 
started up.However, the users lost everything, e.g. their login credentials, 
saved database connections 
Regardless, the issue was fixed, though not in an ideal way.


Many thanks for your help,


Daxu Yin
410-340-5842
 

    On Monday, January 8, 2024 at 06:19:46 AM EST, Yogesh Mahajan 
<yogesh.maha...@enterprisedb.com> wrote:  
 
 Hi,
Error indicates the initial account is not set up on the pgadmin database. You 
need to run command below to setup these details - sudo 
/usr/pgadmin4/bin/setup-web.shHowever this means, pgadmin will have a new 
database which does not have old data. Also when you have brought the backup 
copy pgadmin4 db, you have renamed it to pgadmin4.db
Thanks,Yogesh MahajanEnterpriseDB


On Fri, Jan 5, 2024 at 3:09 AM Daxu Yin <daxu...@yahoo.com> wrote:

Dear pgAdmin4 experts,

We're running pgadmin4-web 6.21 on RHEL 7.9Everything worked for a couple of 
years, suddenly we couldn't start the server.
It seems the httpd server started, but the pgadmin4 module wouldn't load.The 
first few lines of the error messages are shown below, also attached a zipped 
/var/log/httpd/error_log in this email.It seems it try to upgrade the sqllite 
database somehow, but failed.I suspected the pgadmin4.db is corrupted somehow, 
so I stopped the service, and brought back a backup copy of pgadmin4.db, But it 
didn't fix the problem.
Could anyone help me what would be the problem? and how to fix it?
Many thanks in advance,
Daxu 
Yin410-340-5842-------------------------------------------------------------------------------------------------------------------------------------------------[Thu
 Jan 04 15:18:37.998634 2024] [mpm_prefork:notice] [pid 30242] AH00170: caught 
SIGWINCH, shutting down gracefully[Thu Jan 04 15:20:06.897388 2024] 
[core:notice] [pid 31066] SELinux policy enabled; httpd running as context 
system_u:system_r:httpd_t:s0[Thu Jan 04 15:20:06.898563 2024] [suexec:notice] 
[pid 31066] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)[Thu 
Jan 04 15:20:06.914969 2024] [so:warn] [pid 31066] AH01574: module wsgi_module 
is already loaded, skippingAH00558: httpd: Could not reliably determine the 
server's fully qualified domain name, using fe80::1060:abff:fe12:6013. Set the 
'ServerName' directive globally to suppress this message[Thu Jan 04 
15:20:06.917938 2024] [lbmethod_heartbeat:notice] [pid 31066] AH02282: No 
slotmem from mod_heartmonitor[Thu Jan 04 15:20:06.922454 2024] 
[mpm_prefork:notice] [pid 31066] AH00163: Apache/2.4.6 (Red Hat Enterprise 
Linux) mod_wsgi/4.9.0 Python/3.6 configured -- resuming normal operations[Thu 
Jan 04 15:20:06.922498 2024] [core:notice] [pid 31066] AH00094: Command line: 
'/usr/sbin/httpd -D FOREGROUND'[Thu Jan 04 15:20:21.376721 2024] [wsgi:error] 
[pid 31067] NOTE: Configuring authentication for SERVER mode.[Thu Jan 04 
15:20:21.376766 2024] [wsgi:error] [pid 31067] [Thu Jan 04 15:20:21.376793 
2024] [wsgi:error] [pid 31067] Enter the email address and password to use for 
the initial pgAdmin user account:[Thu Jan 04 15:20:21.376803 2024] [wsgi:error] 
[pid 31067] [Thu Jan 04 15:20:21.376876 2024] [wsgi:error] [pid 31067] Email 
address: [Thu Jan 04 15:20:21.377894 2024] [wsgi:error] [pid 31067] 2024-01-04 
15:20:21,377: ERROR\tpgadmin:\tDatabase migration failed[Thu Jan 04 
15:20:21.380424 2024] [wsgi:error] [pid 31067] 2024-01-04 15:20:21,380: 
ERROR\tpgadmin:\tTraceback (most recent call last):[Thu Jan 04 15:20:21.380447 
2024] [wsgi:error] [pid 31067]   File "/usr/pgadmin4/web/pgadmin/__init__.py", 
line 390, in upgrade_db[Thu Jan 04 15:20:21.380459 2024] [wsgi:error] [pid 
31067]     db_upgrade(app)[Thu Jan 04 15:20:21.380467 2024] [wsgi:error] [pid 
31067]   File "/usr/pgadmin4/web/pgadmin/setup/db_upgrade.py", line 25, in 
db_upgrade[Thu Jan 04 15:20:21.380477 2024] [wsgi:error] [pid 31067]     
flask_migrate.upgrade(migration_folder)[Thu Jan 04 15:20:21.380487 2024] 
[wsgi:error] [pid 31067]   File 
"/usr/pgadmin4/venv/lib64/python3.6/site-packages/flask_migrate/__init__.py", 
line 111, in wrapped[Thu Jan 04 15:20:21.380497 2024] [wsgi:error] [pid 31067]  
   f(*args, **kwargs)[Thu Jan 04 15:20:21.380517 2024] [wsgi:error] [pid 31067] 
  File 
"/usr/pgadmin4/venv/lib64/python3.6/site-packages/flask_migrate/__init__.py", 
line 200, in upgrade[Thu Jan 04 15:20:21.380537 2024] [wsgi:error] [pid 31067]  
   command.upgrade(config, revision, sql=sql, tag=tag)[Thu Jan 04 
15:20:21.380547 2024] [wsgi:error] [pid 31067]   File 
"/usr/pgadmin4/venv/lib64/python3.6/site-packages/alembic/command.py", line 
320, in upgrade[Thu Jan 04 15:20:21.380557 2024] [wsgi:error] [pid 31067]     
script.run_env()[Thu Jan 04 15:20:21.380566 2024] [wsgi:error] [pid 31067]   
File "/usr/pgadmin4/venv/lib64/python3.6/site-packages/alembic/script/base.py", 
line 563, in run_env[Thu Jan 04 15:20:21.380576 2024] [wsgi:error] [pid 31067]  
   util.load_python_file(self.dir, "env.py")[Thu Jan 04 15:20:21.380586 2024] 
[wsgi:error] [pid 31067]   File 
"/usr/pgadmin4/venv/lib64/python3.6/site-packages/alembic/util/pyfiles.py", 
line 92, in load_python_file[Thu Jan 04 15:20:21.380596 2024] [wsgi:error] [pid 
31067]     module = load_module_py(module_id, path)[Thu Jan 04 15:20:21.380605 
2024] [wsgi:error] [pid 31067]   File 
"/usr/pgadmin4/venv/lib64/python3.6/site-packages/alembic/util/pyfiles.py", 
line 108, in load_module_py[Thu Jan 04 15:20:21.380615 2024] [wsgi:error] [pid 
31067]     spec.loader.exec_module(module)  # type: ignore[Thu Jan 04 
15:20:21.380625 2024] [wsgi:error] [pid 31067]   File "<frozen 
importlib._bootstrap_external>", line 678, in exec_module[Thu Jan 04 
15:20:21.380634 2024] [wsgi:error] [pid 31067]   File "<frozen 
importlib._bootstrap>", line 219, in _call_with_frames_removed[Thu Jan 04 
15:20:21.380644 2024] [wsgi:error] [pid 31067]   File 
"/usr/pgadmin4/web/pgadmin/setup/../../migrations/env.py", line 95, in 
<module>[Thu Jan 04 15:20:21.380654 2024] [wsgi:error] [pid 31067]     
run_migrations_online()[Thu Jan 04 15:20:21.380663 2024] [wsgi:error] [pid 
31067]   File "/usr/pgadmin4/web/pgadmin/setup/../../migrations/env.py", line 
87, in run_migrations_online[Thu Jan 04 15:20:21.380672 2024] [wsgi:error] [pid 
31067]     context.run_migrations()[Thu Jan 04 15:20:21.380681 2024] 
[wsgi:error] [pid 31067]   File "<string>", line 8, in run_migrations[Thu Jan 
04 15:20:21.380688 2024] [wsgi:error] [pid 31067]   File 
"/usr/pgadmin4/venv/lib64/python3.6/site-packages/alembic/runtime/environment.py",
 line 851, in run_migrations[Thu Jan 04 15:20:21.380694 2024] [wsgi:error] [pid 
31067]     self.get_context().run_migrations(**kw)[Thu Jan 04 15:20:21.380700 
2024] [wsgi:error] [pid 31067]   File 
"/usr/pgadmin4/venv/lib64/python3.6/site-packages/alembic/runtime/migration.py",
 line 620, in run_migrations[Thu Jan 04 15:20:21.380705 2024] [wsgi:error] [pid 
31067]     step.migration_fn(**kw)[Thu Jan 04 15:20:21.380711 2024] 
[wsgi:error] [pid 31067]   File 
"/usr/pgadmin4/web/migrations/versions/fdc58d9bd449_.py", line 38, in 
upgrade[Thu Jan 04 15:20:21.380717 2024] [wsgi:error] [pid 31067]     email, 
password = user_info()[Thu Jan 04 15:20:21.380723 2024] [wsgi:error] [pid 
31067]   File "/usr/pgadmin4/web/pgadmin/setup/user_info.py", line 75, in 
user_info[Thu Jan 04 15:20:21.380728 2024] [wsgi:error] [pid 31067]     email, 
p1 = user_info_server() 

Daxu Yin
410-340-5842

    
  

Reply via email to