vfedotovs / sslv_web_scraper

ss.lv web scraping app helps automate information scraping and filtering from classifieds and emails results and stores scraped data in database
GNU General Public License v3.0
5 stars 3 forks source link

BUG: DB container keep logging FATAL: database "new_docker_user" does not exist #267

Closed vfedotovs closed 5 months ago

vfedotovs commented 5 months ago

Web Scraper version checks

Reproducible Example

After running make all 
db container does not have database created in 

2024-05-26 15:09:21.859 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-05-26 15:09:21.859 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-05-26 15:09:21.859 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-05-26 15:09:21.860 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-05-26 15:09:21.862 UTC [65] LOG:  database system was shut down at 2024-05-26 15:09:21 UTC
2024-05-26 15:09:21.865 UTC [1] LOG:  database system is ready to accept connections
2024-05-26 15:09:51.095 UTC [79] FATAL:  database "new_docker_user" does not exist
2024-05-26 15:10:21.159 UTC [99] FATAL:  database "new_docker_user" does not exist
2024-05-26 15:10:51.221 UTC [108] FATAL:  database "new_docker_user" does not exist
2024-05-26 15:11:21.282 UTC [117] FATAL:  database "new_docker_user" does not exist

Issue Description

This behavior is with posgress version 14.x,15.x,16.x

Expected Behavior

Turns out is related to docker compose healch check command behaviour

Fix is Change test line in docker-compose.yml to this so check runs agenst specific DB - FATAL error goes away
test: ["CMD-SHELL", "pg_isready -U new_docker_user -d new_docker_db"]

vfedotovs commented 5 months ago

Resolved in #268