Skip to content
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

Trying to recreate db, but ttrss-configure-db.php fails when applying schema #55

Open
mozster opened this issue Feb 18, 2022 · 2 comments

Comments

@mozster
Copy link

mozster commented Feb 18, 2022

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?

@mozster
Copy link
Author

mozster commented Feb 18, 2022

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)

  1. add yet more environment params to the ttrss container
      TTRSS_DB_HOST: "db"
      TTRSS_DB_NAME: "ttrss"
      TTRSS_DB_PASS: "password"
      TTRSS_DB_USER: "user"
  1. log into the ttrss container and modify /etc/passwd to allow www-data user to login
    docker exec -it ttrss sh
    followed by
    vi /etc/passwd
    modify the www-data user as follows:
    www-data:x:82:82:Linux User,,,:/home/www-data:/bin/ash
  2. 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'
  3. restore the www-data user to
    www-data:x:82:82:Linux User,,,:/home/www-data:/sbin/nologin
  4. restart the containers

@x86dev
Copy link
Owner

x86dev commented Sep 25, 2022

Probably to the new database scheme intrdouced, see #56 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants