Bug
Fresh installs with the Docker image (ghcr.io/navino16/librarr:latest or :develop) fail with SqliteError: no such table: user on every route. The setup wizard returns Internal Server Error when attempting to create an admin account.
Root Cause
In server/datasource.ts, the synchronize option is:
synchronize: isProduction ? false : synchronize,
When NODE_ENV=production (set by the Dockerfile), synchronize is always false regardless of DB_SYNCHRONIZE. The code falls through to use migrations instead, but no migration files ship with the image:
$ find /app/dist/server/migration -type f
(empty)
This means a fresh install in production mode can never create its database tables.
Steps to Reproduce
docker compose up -d with the docker-compose from the docs
- Open
http://localhost:5055
- Complete step 1 (admin account) → Internal Server Error
- Container logs show:
SqliteError: no such table: user
Workaround
Temporarily set NODE_ENV=development and DB_SYNCHRONIZE=true to let TypeORM create the tables, then switch back to NODE_ENV=production (keeping DB_SYNCHRONIZE=true). The app crashes under NODE_ENV=development because Next.js standalone mode requires production, so you must switch back after the DB initializes.
Suggested Fix
Either:
- Ship migration files with the image so
typeorm can run them on first start
- Change the synchronize logic to allow initial schema creation in production (e.g., sync if the DB is empty)
- Remove the
isProduction guard: synchronize: synchronize — let DB_SYNCHRONIZE control it directly
Environment
- Image:
ghcr.io/navino16/librarr:latest and :develop
- Docker, Unraid host
- Node 24 Alpine base
Bug
Fresh installs with the Docker image (
ghcr.io/navino16/librarr:latestor:develop) fail withSqliteError: no such table: useron every route. The setup wizard returns Internal Server Error when attempting to create an admin account.Root Cause
In
server/datasource.ts, the synchronize option is:When
NODE_ENV=production(set by the Dockerfile),synchronizeis alwaysfalseregardless ofDB_SYNCHRONIZE. The code falls through to use migrations instead, but no migration files ship with the image:This means a fresh install in production mode can never create its database tables.
Steps to Reproduce
docker compose up -dwith the docker-compose from the docshttp://localhost:5055SqliteError: no such table: userWorkaround
Temporarily set
NODE_ENV=developmentandDB_SYNCHRONIZE=trueto let TypeORM create the tables, then switch back toNODE_ENV=production(keepingDB_SYNCHRONIZE=true). The app crashes underNODE_ENV=developmentbecause Next.js standalone mode requires production, so you must switch back after the DB initializes.Suggested Fix
Either:
typeormcan run them on first startisProductionguard:synchronize: synchronize— letDB_SYNCHRONIZEcontrol it directlyEnvironment
ghcr.io/navino16/librarr:latestand:develop