Docker compose setup broken: repo missing

  • [x] I’m using stock docker compose setup, unmodified.
  • [ ] I’m using docker compose setup, with modifications (modified .yml files, third party plugins/themes, etc.) - if so, describe your modifications in your post. Before reporting, see if your issue can be reproduced on the unmodified setup.
  • [ ] I’m not using docker on my primary instance, but my issue can be reproduced on the aforementioned docker setup and/or official demo.

The old docker compose repo is gone: “No repositories found” → https://git.tt-rss.org/fox/ttrss-docker-compose
My automation that pulled from that repo to keep the docker-compose.yml up2date is now broken, as are a bunch of links on the website.

  • Tiny Tiny RSS version (including git commit id): 6418c518db9ba5c5988441cbfe6f87639050e751
  • Platform (i.e. Linux distro, Docker, PHP, PostgreSQL, etc) versions: debian 12, Docker version 24.0.6

The Installation page suddenly links to another repo: https://git.tt-rss.org/fox/tt-rss.git, don’t know what else changed, since i setup ttrss years ago.

It is now unclear to me how to migrate my setup to this new repo since im very bad with docker. I tried this already:
I cloned the new repo and copied my .env file. I then did a docker compose up but the instance is completly fresh now. So instead of figuring out docker more i imported a backup from the old instance. So far so good: it worked. BUT when i do a docker compose down and then up again the instance is fresh again! I don’t understand this, i followed the backup and restore instructions from the wiki.
I purged every volume, image and container and tried to do the restore procedure again, but whenever i compose down & up, it’s reset again.

1 Like

I have exactly the same issue. My nightly update automation is now failing.

I have tried to update to tt-rss.git but struggling to find any update instructions. Have lost an hour to this so far.

I haven’t touched this setup in years, it just works :slight_smile:

separate repo is no more, just use this compose file - https://tt-rss.org/wiki/InstallationNotes

ok but why is my database being reset after every compose down & up? I did this:

sudo docker ps
CONTAINER ID   IMAGE                                    COMMAND                  CREATED          STATUS                             PORTS                    NAMES
0bb92899c97f   cthulhoo/ttrss-fpm-pgsql-static:latest   "/opt/tt-rss/updater…"   28 seconds ago   Up 27 seconds                      9000/tcp                 tt-rss-updater-1
10be1d551cf0   cthulhoo/ttrss-web-nginx:latest          "/docker-entrypoint.…"   28 seconds ago   Up 27 seconds (health: starting)   127.0.0.1:8280->80/tcp   tt-rss-web-nginx-1
0c8d45c0d6c7   cthulhoo/ttrss-fpm-pgsql-static:latest   "/bin/sh -c ${SCRIPT…"   28 seconds ago   Up 27 seconds                      9000/tcp                 tt-rss-app-1
5356bf3a8310   postgres:15-alpine                       "docker-entrypoint.s…"   28 seconds ago   Up 28 seconds                      5432/tcp                 tt-rss-db-1

sudo docker cp backup.psql.gz tt-rss-db-1:/.
sudo docker exec -it tt-rss-db-1 /bin/sh
psql -h db -U $TTRSS_DB_USER $TTRSS_DB_NAME -e -c "drop schema public cascade; create schema public"
zcat backup.psql.gz | psql -h db -U $TTRSS_DB_USER $TTRSS_DB_NAME

Then i can login with my old profile and it just works. But if i do compose down and then up again its all gone.

not sure what to tell you, database container uses persistent volume, same as it always did. hm.

ah yes the compose file from https://tt-rss.org/wiki/InstallationNotes is different that the one from https://git.tt-rss.org/fox/tt-rss.git. The one from the git does not have a persistent volume. Where am i supposed to watch for changes of the compose file then?

i’ve literally linked you the compose file you should use. instead you opted to use another one which says “for local development” :thinking:

wiki is a git repository.

Because it said on the front page " Tiny Tiny RSS uses continuous development model based on git master branch which is considered stable."
i associated stable=production sorry.

The wiki git does not have a docker-compose.yml, i would have to grab it from the InstallationNotes.md. Before it was easier. But i guess this is good enough thanks for your help.

that doesn’t mean you can just assume function of files in the repo without reading through them.

I am having the same problem, if i update the docker-compose.yml, ttrss-docker-db-1 fails to start giving a message:

2023-10-23 20:05:14 2023-10-24 01:05:14.951 UTC [1] FATAL:  database files are incompatible with server
2023-10-23 20:05:14 2023-10-24 01:05:14.951 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 15.4.```

the error message is right there you just have to read it. unless you want to go through DB dump-restore, change 15 to 12 and keep using PG12.

1 Like

Just to verify it. To upgrade from PG12 to PG15 with the new compose file, we need to dump the old DB, clean the volume, redeploy the stack with the new db (PG15) empty and restore from the backup? Is that correct?

I’ll probably get laughed out the room for not getting my hands dirty but I used this to upgrade from v12 to v15
https://github.com/pgautoupgrade/docker-pgautoupgrade
It was as simple as replacing the database image in docker compose with the following
pgautoupgrade/pgautoupgrade:15-alpine3.8

1 Like

why would you get laughed at, that’s pretty cool. it’s a shame that official postgres containers have zero support for major version updates. pg_dump/restore is stone age-tier.

e: i’ll add a FAQ entry with major version error and link this repo there

1 Like

Sadly I saw this after having dumped and restored. For anyone going this path, you will need to update the postgres password with a SCRAM-SHA-256 hash.

To do that you need to use this:

curl -sL https://github.com/supercaracal/scram-sha-256/releases/download/v1.0.0/scram-sha-256_1.0.0_linux_amd64.tar.gz | tar zx -C /tmp
/tmp/scram-sha-256
rm /tmp/scram-sha-256

Copy the generated output and after restoring the dump you need to do this on the db container:

docker compose exec db bash
psql -U postgres
ALTER ROLE postgres PASSWORD '{generated scram-sha-256 hash}';

Don’t forget to put it also in your .env file.
After that everything worked like before and the db is now PG15.

https://gitlab.tt-rss.org/tt-rss/tt-rss/-/wikis/InstallationNotes#i-got-the-updated-compose-file-above-and-now-my-database-keeps-restarting faq entry

1 Like

I didn’t need to do this when updated from 13 to 15 with the mentioned container.

Just noticed that https://tt-rss.org/wiki/InstallationNotes#container-options references “static” and “dynamic” branches in the now obsolete “docker-compose” repo and should be removed.

Or did I get something wrong?

yeah those are no longer a thing. https://gitlab.tt-rss.org/tt-rss/tt-rss/-/wikis/InstallationNotes#container-options better?

@Oliver_Roe Thank you for the hint regarding pgautoupgrade.

Just two hints from the log of the upgrade-process within the container:

  1. Extensions need to be updated separately (i. e. pg_trgm)
  2. optimizer statistics are not transferred
[db]  | Your installation contains extensions that should be updated
[db]  | with the ALTER EXTENSION command.  The file
[db]  |     update_extensions.sql
[db]  | when executed by psql by the database superuser will update
[db]  | these extensions.
[db]  | 
[db]  | 
[db]  | Upgrade Complete
[db]  | ----------------
[db]  | Optimizer statistics are not transferred by pg_upgrade.
[db]  | Once you start the new server, consider running:
[db]  |     /usr/local/bin/vacuumdb -U tt-rss --all --analyze-in-stages
[db]  | 
[db]  | Running this script will delete the old cluster's data files:
[db]  |     ./delete_old_cluster.sh
[db]  | --------------------------------------
[db]  | Running pg_upgrade command is complete

[...]

# docker exec -ti ttrss_db_1 /bin/sh
# cd /var/lib/postgresql/data
/var/lib/postgresql/data # cat update_extensions.sql 
\connect -reuse-previous=on "dbname='tt-rss'"
ALTER EXTENSION "pg_trgm" UPDATE;

/var/lib/postgresql/data # psql -U tt-rss -f update_extensions.sql 
You are now connected to database "tt-rss" as user "tt-rss".
ALTER EXTENSION
/var/lib/postgresql/data # /usr/local/bin/vacuumdb -U tt-rss --all --analyze-in-stages
vacuumdb: processing database "postgres": Generating minimal optimizer statistics (1 target)
[...]
vacuumdb: processing database "tt-rss": Generating default (full) optimizer statistics
/var/lib/postgresql/data # 

PS: The delete script contained rm -rf ‘/var/lib/postgresql/data/old’ a directory which did not exist.