iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.08k stars 1.78k forks source link

Invidious looks for the wrong database ignoring the config #2360

Closed 89Q12 closed 3 years ago

89Q12 commented 3 years ago

Describe the bug I updated my instance roughly 8 hours ago and since then my logs get spammed with postgres_1 | 2021-08-28 16:13:46.360 UTC [2344] FATAL: database "kemal" does not exist and sometimes postgres_1 | 2021-08-28 16:19:11.174 UTC [4645] LOG: could not receive data from client: Connection reset by peer

The invidious logs seem fine, now the weird part users can login and register. The only thing that doesnt work is updating channels/subscriptions which is also weird because obviously if the database isnt there nothing should work. Also the database container isnt reachable from the outside obviously.

My config for both container is:

POSTGRES_DB: invidious
POSTGRES_PASSWORD: *******
POSTGRES_USER: kemal

database_url: postgres://kemal:*******@localhost:5432/invidious

Additional context

unixfox commented 3 years ago

What was the previous version that your instance were running on?

Are you sure you aren't running two instances of invidious? Check docker ps -a.

We didn't introduce any changes to the docker environment related to the database on Invidious since 15 May so this issue must be due to something wrong on your end.

89Q12 commented 3 years ago

The previous version was 2021.08.24-5c74196 and I dont have 2 instances running.

Okay weird, is there any other place where the env vars can be stored besides config.yml/docker-compose.yml?

unixfox commented 3 years ago

Environment variables take precedence over the variables stored in config.yml so if you have correctly set the environment variables then it should be fine.

I really don't know what's causing the issue that you are having. Maybe you could enable the postgresql query logs and this would log the IP address of the client doing the SQL query so that you can narrow down if there is only one IP address doing the SQL requests or multiple ones. If you were to see two IP addresses then depending on your setup it could be that a second invidious process is running with an incorrect config: https://stackoverflow.com/questions/57015003/log-all-queries-in-the-official-postgres-docker-image Note: Maybe the IP address is not shown, I don't remember exactly and I haven't tested this.

89Q12 commented 3 years ago

Okay, seems like u were right but its not a second invidious instances but rather something different but still thanks for the help I appreciate it 👍 and postgres doesnt log ips