listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

Error connecting to the database

Open harnish99 opened this issue 1 year ago • 1 comments

I'm using Listmonk, deployed with Docker Compose. It was functioning smoothly, but suddenly I started experiencing issues related to the database connection. The Listmonk app is throwing the following errors: 2024/08/02 16:16:42 init.go:289: connecting to db: listmonk_db:5432/listmonk 2024/08/02 16:16:42 main.go:142: the database does not appear to be setup. Run --install. 2024/08/02 16:16:49 main.go:102: v3.0.0 (f9120d9 2024-02-04T11:20:27Z, linux/amd64) 2024/08/02 16:16:49 init.go:150: reading config: config.toml

Additionally, the Listmonk database is generating errors indicating that the "templates" table does not exist: 2024-08-02 10:56:24.882 UTC [553] ERROR: relation "templates" does not exist at character 16 2024-08-02 10:56:24.882 UTC [553] STATEMENT: SELECT id FROM templates LIMIT 1 2024-08-02 10:57:25.580 UTC [606] ERROR: relation "templates" does not exist at character 16 2024-08-02 10:57:25.580 UTC [606] STATEMENT: SELECT id FROM templates LIMIT 1 2024-08-02 10:58:26.066 UTC [658] ERROR: relation "templates" does not exist at character 16 2024-08-02 10:58:26.066 UTC [658] STATEMENT: SELECT id FROM templates LIMIT 1

The issue arose unexpectedly, with no changes made to the deployment configuration.

This is the compose file that is used to deploy listmonk `version: "3.7"

x-app-defaults: &app-defaults restart: unless-stopped image: listmonk/listmonk:latest ports: - "9001:9000" networks: - nginxproxymanager_default

x-db-defaults: &db-defaults image: postgres:13 shm_size: 1g ports: - "9432:5432" networks: - nginxproxymanager_default environment: - POSTGRES_PASSWORD=** - POSTGRES_USER=** - POSTGRES_DB=** restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U listmonk"] interval: 10s timeout: 5s retries: 6

services: db: <<: *db-defaults container_name: listmonk_db volumes: - type: volume source: listmonk-data target: /var/lib/postgresql/data

app: <<: *app-defaults container_name: listmonk_app depends_on: - db volumes: - ./config.toml:/listmonk/config.toml

networks: nginxproxymanager_default: external: true

volumes: listmonk-data:`

Please advice on how to resolve this issue.

harnish99 avatar Aug 02 '24 11:08 harnish99

From the error, it looks like the database is either deleted or corrupted somehow. Something to do with Docker volumes most likely. I'm not sure how to debug this, unfortunately.

knadh avatar Aug 02 '24 11:08 knadh

This issue has been marked 'stale' after 90 days of inactivity. If there is no further activity, it will be closed in 7 days.

github-actions[bot] avatar Nov 01 '24 02:11 github-actions[bot]