Describe the Bug
There is a discrepancy between running the application locally via npm start and via Docker when using the SQLite/Knex backend:
- Via
npm start (Local Windows): The server logs multiple [autopurge] errors (.filter is not a function) and then hard-crashes immediately with SqliteError: no such table: templates. The UI never becomes available.
- Via Docker: The application successfully boots up and the UI is accessible. Demo users are present, but demo data is missing. The background autopurge sequence logs the same
.filter is not a function errors, but it does not crash the container.
This indicates an issue with how the SQLite database file is initialized, located, or migrated depending on the environment.
Steps to Reproduce
- Clone the repository:
git clone https://github.com/coolstartnow/isms-builder
- Install dependencies:
npm install
- Run locally:
npm start -> Observe the hard crash (no such table: templates).
- Run via Docker -> Observe that the UI works and demo users exist, but data is missing and autopurge logs errors.
Expected Behaviour
The application should initialize the SQLite database identically in both environments, apply all schema migrations/seeds automatically, and run the autopurge service without throwing .filter TypeErrors or crashing.
Actual Behaviour
Local execution crashes completely due to missing tables, while the Docker setup bypasses the crash but leaves the database in a partially uninitialized state (missing demo data / malfunctioning autopurge).
Environment
- OS: Windows 11 (PowerShell) / Docker (Linux Container)
- Node.js version: v24.14.0
- STORAGE_BACKEND (json/sqlite): sqlite (Knex / better-sqlite3)
Relevant Logs (from local npm start crash)
[storage] Backend: sqlite (Knex)
[autopurge] Templates: deletedTmpl.filter is not a function
[autopurge] Risks: items.filter is not a function
[autopurge] Goals: items.filter is not a function
[autopurge] Guidance: items.filter is not a function
[autopurge] Training: items.filter is not a function
[autopurge] Contracts: items.filter is not a function
[autopurge] NDAs: items.filter is not a function
[autopurge] Policies: items.filter is not a function
[autopurge] GDPR VVT: items.filter is not a function
[autopurge] GDPR AV: items.filter is not a function
[autopurge] GDPR DSFA: items.filter is not a function
[autopurge] GDPR Incidents: items.filter is not a function
[autopurge] GDPR DSAR: items.filter is not a function
[autopurge] GDPR TOMs: items.filter is not a function
[autopurge] Public Incidents: items.filter is not a function
[autopurge] Suppliers: items.filter is not a function
[autopurge] Findings: items.filter is not a function
[notifier] SMTP nicht konfiguriert — E-Mail-Benachrichtigungen deaktiviert
ISMS Builder listening on http://localhost:3000
[storage] Backend: sqlite — Knex template store ready
C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\better-sqlite3\lib\methods\wrappers.js:5
return this[cppdb].prepare(sql, this, false);
^
SqliteError: select * from `templates` where `deleted_at` is not null order by `deleted_at` desc - no such table: templates
at Database.prepare (C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\better-sqlite3\lib\methods\wrappers.js:5:21)
at Client_BetterSQLite3._query (C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\knex\lib\dialects\better-sqlite3\index.js:42:34)
at executeQuery (C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\knex\lib\execution\internal\query-executioner.js:37:17)
at Client_BetterSQLite3.query (C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\knex\lib\client.js:157:12)
at Runner.query (C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\knex\lib\execution\runner.js:141:36)
at ensureConnectionCallback (C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\knex\lib\execution\internal\ensure-connection-callback.js:13:17)
at Runner.ensureConnection (C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\knex\lib\execution\runner.js:318:20)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async Runner.run (C:\Users\j.erfurt\Documents\Repositories\isms-builder\node_modules\knex\lib\execution\runner.js:30:19)
at async Object.getDeletedTemplates (C:\Users\j.erfurt\Documents\Repositories\isms-builder\server\db\stores\templateStore.js:220:18) {
code: 'SQLITE_ERROR'
}
Describe the Bug
There is a discrepancy between running the application locally via
npm startand via Docker when using the SQLite/Knex backend:npm start(Local Windows): The server logs multiple[autopurge]errors (.filter is not a function) and then hard-crashes immediately withSqliteError: no such table: templates. The UI never becomes available..filter is not a functionerrors, but it does not crash the container.This indicates an issue with how the SQLite database file is initialized, located, or migrated depending on the environment.
Steps to Reproduce
git clone https://github.com/coolstartnow/isms-buildernpm installnpm start-> Observe the hard crash (no such table: templates).Expected Behaviour
The application should initialize the SQLite database identically in both environments, apply all schema migrations/seeds automatically, and run the autopurge service without throwing
.filterTypeErrors or crashing.Actual Behaviour
Local execution crashes completely due to missing tables, while the Docker setup bypasses the crash but leaves the database in a partially uninitialized state (missing demo data / malfunctioning autopurge).
Environment
Relevant Logs (from local
npm startcrash)