docker-ttrss
docker-ttrss copied to clipboard
Trying to recreate db, but ttrss-configure-db.php fails when applying schema
I'd like to start again with a fresh install, so I moved my /data folder out of the way, and expected the docker container to create a new database for my installation, but it appears to fail during the database creation process:
ttrss | Setup: Database
ttrss | Configuring database for: /var/www/ttrss/config.php
ttrss_postgres | 2022-02-18 11:14:45.490 UTC [69] FATAL: password authentication failed for user "ttrss"
ttrss_postgres | 2022-02-18 11:14:45.490 UTC [69] DETAIL: Role "ttrss" does not exist.
ttrss_postgres | Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
ttrss | pgsql:host=db;port=5432;dbname=ttrss;user=user;password=password;Database login failed, trying to create ...
ttrss | pgsql:host=db;port=5432;user=user;password=password;pgsql:host=db;port=5432;dbname=ttrss;user=user;password=password;Database login created and confirmed
ttrss_postgres | 2022-02-18 11:14:46.305 UTC [72] ERROR: relation "ttrss_feeds" does not exist at character 15
ttrss_postgres | 2022-02-18 11:14:46.305 UTC [72] STATEMENT: SELECT 1 FROM ttrss_feeds
ttrss | pgsql:host=db;port=5432;dbname=ttrss;user=user;password=password;Database table not found, applying schema...
ttrss | PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: trying to execute an empty query in /srv/ttrss-configure-db.php:82
ttrss | Stack trace:
ttrss | #0 /srv/ttrss-configure-db.php(82): PDO->exec()
ttrss | #1 {main}
ttrss | thrown in /srv/ttrss-configure-db.php on line 82
is this a fault in the script?
I've managed to get past the error by doing the following (I'm not sure if all of them are necessary, but it's working now)
- add yet more environment params to the
ttrsscontainer
TTRSS_DB_HOST: "db"
TTRSS_DB_NAME: "ttrss"
TTRSS_DB_PASS: "password"
TTRSS_DB_USER: "user"
- log into the
ttrsscontainer and modify/etc/passwdto allowwww-datauser to logindocker exec -it ttrss shfollowed byvi /etc/passwdmodify thewww-datauser as follows:www-data:x:82:82:Linux User,,,:/home/www-data:/bin/ash - while still in the container run the update schema script to generate the correct schema
su www-data -c 'php /var/www/ttrss/update.php --update-schema' - restore the
www-datauser towww-data:x:82:82:Linux User,,,:/home/www-data:/sbin/nologin - restart the containers
Probably to the new database scheme intrdouced, see https://github.com/x86dev/docker-ttrss/issues/56#issuecomment-1066115587