Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memos container failing to start due to database migration issues. #4014

Closed
n1njaznutz opened this issue Oct 13, 2024 · 2 comments
Closed

Memos container failing to start due to database migration issues. #4014

n1njaznutz opened this issue Oct 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@n1njaznutz
Copy link

Describe the bug

I am running Memos via Portainer on Synology NAS with PostgreSQL database based on the docker compose found here : https://mariushosting.com/how-to-install-memos-with-postgresql-on-your-synology-nas/ . Following the image upgrade to v0.22.5, the containter no longer starts due to what appears to be database migration issues. I have also done a full, clean reinstall via docker compose and the problem persists. I have included the docker compose file and container log file for info. I am pretty sure this issue has arisen since v0.22.5 - I had no problems before.

Steps to reproduce

Docker Compose File:

version: "3.9"
services:
db:
image: postgres:16
container_name: Memos-DB
hostname: memos-db
mem_limit: 512m
cpu_shares: 768
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "memos", "-U", "memosuser"]
timeout: 45s
interval: 10s
retries: 10
volumes:
- /volume1/docker/memos/db:/var/lib/postgresql/data:rw
environment:
POSTGRES_DB: memos
POSTGRES_USER: memosuser
POSTGRES_PASSWORD: memospass
restart: on-failure:5

memos:
image: ghcr.io/usememos/memos:stable
container_name: Memos
hostname: memos
security_opt:
- no-new-privileges:true
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:5230/
user: 1026:100
ports:
- 5240:5230
environment:
MEMOS_DRIVER: postgres
MEMOS_DSN: 'postgresql://memosuser:memospass@memos-db:5432/memos?sslmode=disable'
volumes:
- /volume1/docker/memos/data:/var/opt/memos:rw
restart: on-failure:5
depends_on:
db:
condition: service_healthy

Container Log File:

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
syncing data to disk ... ok
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
waiting for server to start....2024-10-13 13:17:57.735 UTC [49] LOG: starting PostgreSQL 16.4 (Debian 16.4-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-10-13 13:17:57.737 UTC [49] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-10-13 13:17:57.780 UTC [52] LOG: database system was shut down at 2024-10-13 13:17:56 UTC
2024-10-13 13:17:57.799 UTC [49] LOG: database system is ready to accept connections
done
server started
CREATE DATABASE
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2024-10-13 13:17:58.557 UTC [49] LOG: received fast shutdown request
waiting for server to shut down....2024-10-13 13:17:58.559 UTC [49] LOG: aborting any active transactions
2024-10-13 13:17:58.561 UTC [49] LOG: background worker "logical replication launcher" (PID 55) exited with exit code 1
2024-10-13 13:17:58.563 UTC [50] LOG: shutting down
2024-10-13 13:17:58.577 UTC [50] LOG: checkpoint starting: shutdown immediate
.2024-10-13 13:18:00.249 UTC [50] LOG: checkpoint complete: wrote 922 buffers (5.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.324 s, sync=1.156 s, total=1.686 s; sync files=301, longest=0.108 s, average=0.004 s; distance=4255 kB, estimate=4255 kB; lsn=0/1912100, redo lsn=0/1912100
2024-10-13 13:18:00.256 UTC [49] LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
2024-10-13 13:18:01.015 UTC [1] LOG: starting PostgreSQL 16.4 (Debian 16.4-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-10-13 13:18:01.076 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-10-13 13:18:01.076 UTC [1] LOG: listening on IPv6 address "::", port 5432
2024-10-13 13:18:01.461 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-10-13 13:18:01.506 UTC [65] LOG: database system was shut down at 2024-10-13 13:18:00 UTC
2024-10-13 13:18:01.786 UTC [1] LOG: database system is ready to accept connections
2024-10-13 13:18:07.127 UTC [76] ERROR: relation "migration_history" does not exist at character 33
2024-10-13 13:18:07.127 UTC [76] STATEMENT: SELECT version, created_ts FROM migration_history ORDER BY created_ts DESC
2024-10-13 13:23:01.608 UTC [63] LOG: checkpoint starting: time
2024-10-13 13:23:17.217 UTC [63] LOG: checkpoint complete: wrote 156 buffers (1.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=15.356 s, sync=0.035 s, total=15.610 s; sync files=119, longest=0.005 s, average=0.001 s; distance=805 kB, estimate=805 kB; lsn=0/19DB5C0, redo lsn=0/19DB588

The version of Memos you're using.

v.0.22.5

Screenshots or additional context

No response

@n1njaznutz n1njaznutz added the bug Something isn't working label Oct 13, 2024
@mariushosting
Copy link

Related to: #3873
to solve this just change the following line in the compose:

ghcr.io/usememos/memos:stable

with

ghcr.io/usememos/memos:latest

@n1njaznutz
Copy link
Author

Related to: #3873
to solve this just change the following line in the compose:

ghcr.io/usememos/memos:stable

with

ghcr.io/usememos/memos:latest

Thank you @mariushosting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants