HenryQW / Awesome-TTRSS

🐋 Awesome TTRSS, a powerful Dockerised all-in-one RSS solution.
http://ttrss.henry.wang
MIT License
2.44k stars 494 forks source link

[BUG] Upstream ENV changes which might break databse connection and other things #267

Closed yche2990 closed 3 years ago

yche2990 commented 3 years ago

It shows

Exception while creating PDO object:SQLSTATE[08006] [7] could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

FaintGhost commented 3 years ago

same here

hartzan commented 3 years ago

Could it be this one:ENV DB_HOST=database.postgres in Dockerfile? If you are using different name for pg service it doesn't connect? I'm unable to use database.postgres as myservice name in docker swarm??

ptsa commented 3 years ago

是上游的config 有更改造成的

dimon222 commented 3 years ago

Yep, breaking changes keep coming on daily basis to upstream tt-rss, I suggest to park your compose back on Feb 14 tag for next 1 month at least.

PS, this bug is due to this. Yeah, breaking change was announced in forums just 16 hours ago 🥇 https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337

HenryQW commented 3 years ago

Yeah I would disable watchtower for now and use a stable build, wangqiru/ttrss:latest-2021-02-23 for php8 or wangqiru/ttrss:latest-2021-02-14 for php7.

Too many changes to cope and the ENV system is being 
restruactred to be more docker friendly, but it will affect many things including the support for non-standard(80,443) port feeds which is being circumvented in this repo.

I will be able to work on this after my next ddl on Thursday, any help is appreciated.

dimon222 commented 3 years ago

@HenryQW I know you mentioned migration to env variables completely. Did u reach some stage or still waiting stabilization on ttrss side (which might never happen) ? I could contribute if needed.

Benefits of this setup in awesome-ttrss is sudoless, preinstalled plugins with tunings and mercury coming together.

conanyangqun commented 3 years ago

Yeah I would disable watchtower for now and use a stable build, wangqiru/ttrss:latest-2021-02-23 for php8 or wangqiru/ttrss:latest-2021-02-14 for php7.

Too many changes to cope and the ENV system is being 
restruactred to be more docker friendly, but it will affect many things including the support for non-standard(80,443) port feeds which is being circumvented in this repo.

I will be able to work on this after my next ddl on Thursday, any help is appreciated.

在Macos上,用docker-compose测试了一下,wangqiru/ttrss:latest-2021-02-23这个版本仍然报错,但是wangqiru/ttrss:latest-2021-02-14可以使用。

ptsa commented 3 years ago

我用 wangqiru/ttrss:latest-2021-02-22 会有错误 Constant DAEMON_UPDATE_LOGIN_LIMIT already defined 不用其他用起来正常

HenryQW commented 3 years ago

@HenryQW I know you mentioned migration to env variables completely. Did u reach some stage or still waiting stabilization on ttrss side (which might never happen) ? I could contribute if needed.

Benefits of this setup in awesome-ttrss is sudoless, preinstalled plugins with tunings and mercury coming together.

I have not been working on this recently. I think it's still being polished. The major change that makes conifg.php optional only came out yesterday.

HenryQW commented 3 years ago

The latest build should hopefully be usable now.

Nightliss commented 3 years ago

Hi there,

I'm having the same issue

image

version: "3"
services:
  service.rss:
    image: wangqiru/ttrss:latest
    container_name: ttrss
    ports:
      - 181:80
    environment:
      - SELF_URL_PATH=http://rpi4:181/ # please change to your own domain
      - DB_PASS=ttrss # use the same password defined in `database.postgres`
      - PUID=1000
      - PGID=1000
    volumes:
      - feed-icons:/var/www/feed-icons/
    networks:
      - public_access
      - service_only
      - database_only
    stdin_open: true
    tty: true
    restart: always

  service.mercury: # set Mercury Parser API endpoint to `service.mercury:3000` on TTRSS plugin setting page
    image: wangqiru/mercury-parser-api:latest
    container_name: mercury
    networks:
      - public_access
      - service_only
    restart: always

  service.opencc: # set OpenCC API endpoint to `service.opencc:3000` on TTRSS plugin setting page
    image: wangqiru/opencc-api-server:latest
    container_name: opencc
    environment:
      - NODE_ENV=production
    networks:
      - service_only
    restart: always

  database.postgres:
    image: postgres:13-alpine
    container_name: postgres
    environment:
      - POSTGRES_PASSWORD=ttrss # feel free to change the password
    volumes:
      - ~/postgres/data/:/var/lib/postgresql/data # persist postgres data to ~/postgres/data/ on the host
    networks:
      - database_only
    restart: always

  # utility.watchtower:
  #   container_name: watchtower
  #   image: containrrr/watchtower:latest
  #   volumes:
  #     - /var/run/docker.sock:/var/run/docker.sock
  #   environment:
  #     - WATCHTOWER_CLEANUP=true
  #     - WATCHTOWER_POLL_INTERVAL=86400
  #   restart: always

volumes:
  feed-icons:

networks:
  public_access: # Provide the access for ttrss UI
  service_only: # Provide the communication network between services only
    internal: true
  database_only: # Provide the communication between ttrss and database only
    internal: true

The only thing I changed is SELF_URL_PATH.

HenryQW commented 3 years ago

I'm not sure if the latest commit from upstream has anything to do with your error. Can you try wangqiru/ttrss:latest-2021-03-01 and see if it gives you the same error?

Nightliss commented 3 years ago

image

Got some errors. I've been hosting ttrss directly before, that was so much easier than this. Appreciate the help :)

HenryQW commented 3 years ago

Can't help you if you don't post your config here. And respectively disagree with you, hosting directly is a nightmare comparing to docker.

Nightliss commented 3 years ago

After googling around I found this https://github.com/docker-library/redis/issues/269#issuecomment-778588162 which after rebooting helped. Running with latest tag just fine. When I learn docker it'll probably be easier to work with in the long run too :)

Edit: I was too hasty, feeds are not updating :(

image

version: "3"
services:
  service.rss:
    image: wangqiru/ttrss:latest
    container_name: ttrss
    ports:
      - 181:80
    environment:
      - SELF_URL_PATH=http://rpi4:181/ # please change to your own domain
      - DB_PASS=ttrss # use the same password defined in `database.postgres`
      - PUID=1000
      - PGID=1000
    volumes:
      - feed-icons:/var/www/feed-icons/
    networks:
      - public_access
      - service_only
      - database_only
    stdin_open: true
    tty: true
    restart: always

  service.mercury: # set Mercury Parser API endpoint to `service.mercury:3000` on TTRSS plugin setting page
    image: wangqiru/mercury-parser-api:latest
    container_name: mercury
    networks:
      - public_access
      - service_only
    restart: always

  service.opencc: # set OpenCC API endpoint to `service.opencc:3000` on TTRSS plugin setting page
    image: wangqiru/opencc-api-server:latest
    container_name: opencc
    environment:
      - NODE_ENV=production
    networks:
      - service_only
    restart: always

  database.postgres:
    image: postgres:13-alpine
    container_name: postgres
    environment:
      - POSTGRES_PASSWORD=ttrss # feel free to change the password
    volumes:
      - ~/postgres/data/:/var/lib/postgresql/data # persist postgres data to ~/postgres/data/ on the host
    networks:
      - database_only
    restart: always

  # utility.watchtower:
  #   container_name: watchtower
  #   image: containrrr/watchtower:latest
  #   volumes:
  #     - /var/run/docker.sock:/var/run/docker.sock
  #   environment:
  #     - WATCHTOWER_CLEANUP=true
  #     - WATCHTOWER_POLL_INTERVAL=86400
  #   restart: always

volumes:
  feed-icons:

networks:
  public_access: # Provide the access for ttrss UI
  service_only: # Provide the communication network between services only
    internal: true
  database_only: # Provide the communication between ttrss and database only
    internal: true

Raspberry Pi 4 4GB with 256GB SSD on latest DietPi 32bit

Edit:

image

I think feeds are not updating because container can't access the internet?

dimon222 commented 3 years ago

Sounds like problem with DNS resolver. Are you running under docker or under podman? I would assume it looks like Windows.

Nightliss commented 3 years ago

Just docker

image

dimon222 commented 3 years ago

Try reboot docker daemon, check your DNS configuration in /etc/resolv.conf on host node

Nightliss commented 3 years ago

image

rebooting docker doesn't help

from container: image

edit:

finally figured it out; had to add dns to the ttrss service in the compose file

ports:
      - 181:80
    dns:
      - 192.168.1.1

now it works :D but holy shit it takes so much time to make it work