Skip to content

Troubleshooting

Ryan Bayne edited this page Oct 31, 2026 · 1 revision

Troubleshooting

Status: active Category: E (product / user) Created: 2026-10-31 Last updated: 2026-10-31 Owner: TCS team

Every entry below is a failure that has actually happened on this project, with the misleading message it produced. That matters: the most expensive ones do not look like errors.


⛔ prisma db push will destroy data — do not run it

schema.prisma is not the complete schema. Several tables are managed in raw SQL — the trade execution queue among them. db push treats an unmodelled table as garbage and drops it with the data still inside. It does not error; it warns and waits for a y.

npm --prefix nest run db:check      # read-only; names any table the schema does not know about

Create tables from the SQL in nest/prisma/, then npx prisma generate for types only.

EPERM ... query_engine-windows.dll.node when building

The API is running and holds the file. This is not a broken install, and reinstalling does not help.

npm --prefix nest run build:api     # stop → build → restart → health check

MODULE_NOT_FOUND after nest run start

Means there is no build — the entry point is nest/dist/src/main.js, one directory deeper than nest start looks. Run npm --prefix nest run build:api. ⚠️ The tempting response — reinstall node_modules, or run prisma db push — is wrong twice over.

Can't reach database server

MySQL is not running. Start it, then confirm the connection string in nest/.env. Note the password is supposed to be yours; if you copied an example, it will not work.

/api/health says "mode": "fallback"

Normal. It means Redis and the job queue are unavailable, which is the expected state for a local install. The database is still connected and scoring still runs. Do not restart the API to "fix" it.

The app is empty and nothing scores

Check, in order:

  1. Is any data provider healthy? curl http://localhost:3201/api/health — the providers block reports total, healthy, degraded, failed. Several adapters need an API key; a few need none.
  2. Are there symbols? An empty watchlist scores nothing, and an empty app is the designed default.
  3. Is a bot subscribed to a protocol? A bot without a strategy_protocol subscription is never queued, silently. npm --prefix nest run audit:bot-activation names the reason per bot.

The bridge is up but reports connected: false

GET :5000/health tells you which of several things it is, and gives a remedy:

Field Reads Means
connectionState terminal-down MetaTrader 5 is not running, or was not logged in
credentialMismatch non-null this bridge is attached to an account it was not configured for — reads work, orders are refused
tradeAllowed false the terminal's Algo Trading button is off — every order will be refused with retcode 10027
tradeapiDisabled true the terminal's API trading path is disabled — a second, independent blocker

⚠️ tradeAllowed: null means unknown, not off: it is null when the bridge could not ask.

Port already in use

# Windows
netstat -ano | findstr :3201
taskkill /PID <pid> /F

npm --prefix nest install fails

Run cd nest and npm install there. The --prefix form fails if nest/package.json cannot be resolved from where you are.

Nothing in the UI changes when I edit the backend

The API serves a build, not the TypeScript sources. Rebuild with npm --prefix nest run build:api. Frontend changes are picked up by Vite's dev server automatically.

Still stuck

Ask in Discussions with the command you ran and the output you got. A defect with a reproduction is an issue; a question is a discussion.

Clone this wiki locally