Closed cmellwig closed 1 month ago
This looks like a configuration error with the router config.
On fresh installation you should get redirected to adm_program/installation/installation.php
.
e. g. http://localhost:3100
redirects to http://localhost:3100/adm_program/installation/installation.php
On the installation wizard you can setup your database. After this step, the config.php
is created and the database will be initialized.
Maybe the router configuration is not redirecting correctly? Is there a log output from traefik?
I looked into it some more. Multiple things going on. First, the healthcheck fails OOTB which prevents traefik from generating a route to the container. Disabling healthcheck for the container results in a route, but SSL fails since ADMIDIO_ROOT_PATH isn't evaluated yet (just my guess)? I can load the site but communication isn't encrpyted, images wont load. Traefik shows:
time="2024-01-01T14:39:16+01:00" level=debug msg="'499 Client Closed Request' caused by: context canceled"
I removed all environment variables in the config at this point. If I continue without the SSL cert working I get to the last installation step, config.php is written but database is empty, nothing happens when pressing the installation button:
172.20.0.4 - - [01/Jan/2024:15:09:53 +0100] "GET / HTTP/1.1" 302 222 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"
172.20.0.4 - - [01/Jan/2024:15:09:53 +0100] "GET /adm_program/installation/index.php HTTP/1.1" 302 204 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"
172.20.0.4 - - [01/Jan/2024:15:09:53 +0100] "GET /adm_program/installation/installation.php HTTP/1.1" 200 2309 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"
172.20.0.4 - - [01/Jan/2024:15:09:56 +0100] "POST /adm_program/installation/installation.php?step=connect_database HTTP/1.1" 200 2734 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"
172.20.0.4 - - [01/Jan/2024:15:10:26 +0100] "POST /adm_program/installation/installation.php?step=create_organization HTTP/1.1" 200 6210 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"
172.20.0.4 - - [01/Jan/2024:15:10:40 +0100] "POST /adm_program/installation/installation.php?step=create_administrator HTTP/1.1" 200 2707 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"
172.20.0.4 - - [01/Jan/2024:15:10:52 +0100] "POST /adm_program/installation/installation.php?step=create_config HTTP/1.1" 200 1635 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"
If I fill in the environment like in the original issue, config.php gets created automatically whithout the installation on the second container start. Naturally, the DB is empty. Now the index page will fail (blank page shown), the log has:
[Mon Jan 01 14:50:53.985017 2024] [php:error] [pid 155] [client 172.20.0.4:33578] PHP Fatal error: Uncaught Error: Call to a member function fetchAll() on bool in /opt/app-root/src/adm_program/system/classes/Database.php:460\nStack trace:\n#0 /opt/app-root/src/adm_program/system/classes/Database.php(389): Database->loadTableColumnsProperties('adm_sessions')\n#1 /opt/app-root/src/adm_program/system/classes/TableAccess.php(626): Database->getTableColumnsProperties('adm_sessions')\n#2 /opt/app-root/src/adm_program/system/classes/TableAccess.php(140): TableAccess->setColumnsInfos()\n#3 /opt/app-root/src/adm_program/system/classes/TableAccess.php(104): TableAccess->clear()\n#4 /opt/app-root/src/adm_program/system/classes/Session.php(60): TableAccess->__construct(Object(Database), 'adm_sessions', 'ses')\n#5 /opt/app-root/src/adm_program/system/common.php(91): Session->__construct(Object(Database), 'ADMIDIO_admidio...')\n#6 /opt/app-root/src/index.php(23): require_once('/opt/app-root/s...')\n#7 {main}\n thrown in /opt/app-root/src/adm_program/system/classes/Database.php on line 460
So a config exists, ADMIDIO_ROOT_PATH is correct, the SSL encryption works but the database is empty since no installation ran. Now I can manually call adm_program/installation/installation.php which skips database settings and redirects to adm_program/installation/installation.php?step=create_organization
If I continue with the installation it seems to work but config.php isn't updated with the values entered before, probably because of permission issues with the already created config file. The result is a page that shows Error: The organization of the config.php could not be found in the database!
So this would be a workaround I've found:
My thoughts on fixing the issue, maybe it helps, I'm not an expert with php and apache:
Hope that somewhat helps
@cmellwig: can you please test again with image admidio/admidio:branch_v4.3
?
There are some changes that will hopefully solve your problems.
I will close this issue because it's fixed now.
Fresh installation fails when traefik reverse proxy is in place before installation. The container starts and goes into unhealthy state:
The database at this point is empty. After restoring an old backup to the database, everything works as expected, which leads me to believe it's a bug rather than a configuration issue with treafik. Also config.php isn't created on first container start but on the second attempt, which might be another issues but seems to be unrelated since I tested it with a working config.php in place before docker-compose ran and with one created from docker environment on a subsequent container start.
docker-compose.yml: