Docker-compose + tt-rss

great, thanks.
also postgres keeps giving an error,

2019-12-09 05:29:39.492 UTC [27] FATAL: role “root” does not exist

it’s probably pg_isready trying to connect as root, not really a big deal.

e: https://git.tt-rss.org/fox/ttrss-docker-compose/commit/9adf705f704b6300b1be5dc912269a3b2cbcdb9f

Took some messing around but I eventually got the docker using your docker compose up and running.

Coming from an install from pulling git on an ubuntu server I’m running. Initially had some rights issues but I fixed that. For some reason even though passing a UID/GID in the .env file it still had issues. After I finally could reach it I exported my old DB (was running PG10 and I see this is PG12 so hopefully no issues) and imported into the new one. Copied my plugins etc and fired the container back up and for the most part, it’s working. I had to schedule the cron job via the host by running “docker exec ttrss-docker_app_1 /usr/bin/php /var/www/html/tt-rss/update.php --feeds” every 15 minutes. I tried using update_daemon2.php but it gave me an error “This script requires PHP compiled with PCNTL module.”. Occasionally I’ll get some php errors in the logs but nothing that seems to break operation.

Go figure when I check the version I get Unknown (Unsupported).

Also, for the db and the app I setup I did binds instead of docker volumes, mainly for ease of dealing with importing the original DB and editing of the config.php.

issues you’re not going to tell us about?

cron, inside app container, does that automatically. it should be right there in the README/wiki.

i’m not sure what you did but this isn’t right. maybe your app container points to a wrong tt-rss directory or something else.

so far your vaguely nonspecific problems sound self-inflicted to me tbh. the whole thing should just work without any “messing around” necessary except for setting the exposed port.

I’ll be completely honest, I’m not a developer and I’m certainly not a pro at neither docker nor Linux, but I can get by. I was avoiding posting here dreading this exact type of reply.

Anyways, I’ll try and explain in further detail the process.

Originally when I tried rolling this out I made very minimal changes just to test it out. Instead of an external FQDN I used the host FQDN since I was only going to test it within my network, kept the defaults for the DB, but I did change the UID and GID to UID and GID I used for most other containers which is a dockeruser (I forget the UID off the top of my head but it’s like 2357 or something), and a GID of users (100) yeah I know not best practice but whatever. I also changed the port to not use 127.0.0.1:8280 since I don’t have a reverse proxy running on THAT system, but another system on my network.

On the first docker-compose up, half way through building the containers it errored on the GID saying the GID already existed. So I edited the .env file and used some random UID and GID I knew I didn’t have that existed which was 2000:2000. I made sure to clean up whatever was left behind just in case and re-ran the docker-compose up. This time it completed and looked like everything was working. Went to a browser, plugged in http://FQDNofthehost:8280/tt-rss and the only thing it returned was “access denied”. Went back and checked where the docker-compose up was still running (since I didn’t tell it to exit once done building) and it showed a bunch of permission errors trying to reach the files in /var/www/html/tt-rss. I thought this was odd since it was in docker volume.

Anyways this is when I started doing bigger changes and using binds instead of docker volumes. I shutdown the containers, deleted everything again, and changed the docker compose file to point to where I normally store my docker volumes via bind, ran the docker-compose up and it created the folders as expected in the bind locations, but it still showed access denied when I tried to connect with the browser and I still got the permissions errors. I checked the files at the bind and they were had 2000:2000 owner and group as expected. I did a chown -R a+r to the entire folder for the ttrss app (not the db) and did a refresh on my browser and got the login. After that everything appeared to work I shutdown the app and web containers, but left the PG container running and added my old ttrss user account to PG and restored my DB from my other PG DB server that I’ve been using. Made the proper changes to the config.php, copied over my plugins, started the containers back up and I was able to login with my normal account and had everything like my old system. I waited for a while, but it wasn’t updating feeds. Which is when I attached to the container to test out feed updating. I first tried to run php /var/www/html/tt-rss/update_daemon2 but got the error I mentioned. I then ran php /var/www/html/tt-rss/update and saw all of the possible options you could pass, so I ran it with --feeds and it worked. So I created the cron job on my host to run it.

That’s pretty much the entire process I took.

Edit:
I just attached to the container and did a crontab -l and I do see it configured to run jobs in /etc/periodic/15min every 15 mins. I just checked that location and the update script is in there and looks correct, so I’m not really sure why it’s not running it.

i can’t imagine why would anyone go through all that trouble instead of docker-compose up but thanks for sharing this amazing story, i guess. it was full of twists and turns and i was holding my breath till the very end.

to other people reading this thread i’d like to say one thing - don’t do what this guy did. don’t do random shit instead of what’s in the README, don’t overcomplicate things that are exceedingly simple, and especially don’t fuck around with things randomly without any sort of understanding of what is going on underneath, because it’s a recipe for disaster. see that post above? that exact kind of disaster.

I DID what was in the read me at first…I went word for word exactly what was in the read me. It didn’t work. I’m sorry but it’s true.

i’ll make a note to check if things break out of the box if you use custom UIDs. as to your other adventures, i think i’ve already said enough.

So would you have any recommendation or process for people looking to migrate their current install on a server to the docker solution and keep their current feeds, starred articles, archived articles, etc? If someone were looking to put up a brand new install then yes the readme is sufficient.

  • run the container once so it checks out sources from git
  • dump your existing database
  • import it into dockerized postgres (docker exec -i --user postgres DB_CONTAINER psql postgres < dump.sql)
  • copy any plugins/themes to relevant places in the new volume

that’s it? i think.

don’t: customize uids (no point in with volumes anyway), don’t try to fuck around with postgres, really just don’t do anything weird.

I’ll give it another shot when I’ve got some time maybe later today or tomorrow. Like I said, I’m certainly not a pro at this stuff and for the most part I’ve been using images from docker hub (for other things, not tt-rss), and doing docker run statements.

Thank you for the info, it is greatly appreciated. I think the beginning of my downfall was customizing the uids and it just snowballed from there.

I’m trying it on a different system. Not sure if it could be system related. Kept defaults (although changed the self_url_path) and during the first docker-compose up I’m seeing this error

app_1  | + psql -q -h db -U postgres postgres -c 'select * from ttrss_version'
db_1   | 2019-12-13 18:09:17.011 UTC [51] ERROR:  relation "ttrss_version" does not exist at character 15
db_1   | 2019-12-13 18:09:17.011 UTC [51] STATEMENT:  select * from ttrss_version
app_1  | ERROR:  relation "ttrss_version" does not exist
app_1  | LINE 1: select * from ttrss_version
app_1  |                       ^
app_1  | + psql -q -h db -U postgres postgres

Edit: Well even with that error it appears to be working. I tried it on a different system because when I tried it with all defaults on the same system I’ve been using, I had permission errors again when trying to browse via web. Looks system related as I’m at least not getting permission errors on the other system.

you’re going to see this on the first run because it’s how script checks whether it needs to install the schema.

don’t hesitate to post any more shocking findings though.

no shit, sherlock.

yes, absolutely. this idea is to provide a solution for a very specific task (i.e. making a very low-maintenance auto updating container which follows trunk code and generally just works™).

pointless customization and complexity was something that i was specifically trying to avoid here.

people can run anything they want in any way they like it. if this particular container doesn’t fit their usecase, they can and should use something else or make their own. it’s not like any of this is hard.

you really should have taken this automated advice to heart because your post goes against almost entirely: it didn’t improve the discussion here in any way, it’s not docker or development related, it provokes further offtopic discussion, it criticizes people (i.e. me) instead of ideas, etc, etc.

we even have a site feedback section where you could’ve posted this without being disruptive but you didn’t care enough to do that because your feelings being hurt are obviously more important.

it’s fascinating that you try to provide advice on running internet communities while being so utterly unable to participate in one on such basic level.

also, my plan for this morning was investigating firefox issue discussed in the other thread. instead i had to waste all this time replying to your shitpost. i’m sure many people here would appreciate this contribution of yours to our community in particular.

Sure. Thanks for asking.

  1. You’re comments are not improving this conversation. As fox said, there’s a dedicated Site Feedback category that you can post a new topic in.
  2. You’re criticizing fox instead of the manner in which he runs his site. Notwithstanding that this is his site and he can run it as he sees fit.
  3. You’re continuing to de-rail this thread. If you want to post your comments, do it as you have been instructed.

If you really care about improving the community you’d take some time to read the threads here and realize that fox actually did fix the Firefox issue this morning and therefore doesn’t need “luck” (not that one needs luck to code).

e: Also, this post from the old forum answers many questions.

I am afraid that your comments do not read in good faith. They read like entitled rants. You continue to derail the thread (feel free to post to feedback anytime…) and keep on insulting everyone here for not catering to your whims. This is not the way to behave in any communities whatsoever.

In the future, please consider criticising ideas not people, you will make more friends that way.

Yes, it does. This is a good thing™.

Fox makes a lot of assumptions about how TTRSS should be run. Fox develops it. Now, you might think that his way of doing things is wrong and criticise that while offering a better alternative. You might think you can do better, then please show us.

alright guys i think maybe let’s just let this one go, it’s not like he can reply anyway.

FYI, the update icon on top left corner next to the feed title has stopped showing up last few days, even when there is an update available in git.

yeah, my bad. next changeset should fix this. a bit of a duh moment there.

e: https://git.tt-rss.org/fox/tt-rss/commit/fdb1fc760846e523c64ef10bd89f046580b6d9cb

I face the following problem with docker compose version, could you please help me to solve it and install

kostas@alexandra : /opt/ttrss-docker $ sudo docker-compose up
[sudo] password for kostas:
ERROR: Version in “./docker-compose.yml” is unsupported. You might be seeing this error because you’re using the wrong Compose file version. Either specify a version of “2” (or “2.0”) and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.

kostas@alexandra : /opt/ttrss-docker $ sudo docker-compose --version
docker-compose version 1.9.0, build 2585387
kostas@alexandra : /opt/ttrss-docker $ sudo apt-get install docker-compose
Reading package lists… Done
Building dependency tree
Reading state information… Done
docker-compose is already the newest version (1.17.1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.