Blyp Docs

Troubleshooting

Use this page when database mode is configured but logs are missing, inserts fail, or Blyp falls back to a disabled database state.

High-risk area: Schema mismatches can make database logging effectively unusable. Treat the generated Blyp schema as a strict compatibility contract.

destination: "database" is set, but database logging is silently disabled

Likely cause: You are using blyp.config.json instead of an executable config file, so the adapter runtime object cannot be loaded.

Fix: Move the config to blyp.config.ts, blyp.config.mts, blyp.config.js, or another executable blyp.config.* file and wire the adapter there.

Database logging is disabled because the dialect is unsupported

Likely cause: For a SQL-backed Prisma or Drizzle setup, database.dialect is not postgres or mysql.

Fix: Use one of the supported SQL dialects and make sure it matches your ORM configuration. MongoDB through Mongoose does not require database.dialect.

Database logging is enabled without an adapter

Likely cause: destination: "database" is set but database.adapter is missing.

Fix: Provide createPrismaDatabaseAdapter({ client, model }), createDrizzleDatabaseAdapter({ db, table }), or createMongooseDatabaseAdapter({ mongoose, mongoUrl }).

Prisma delegate blypLog is missing

Likely cause: The Prisma client does not expose the expected delegate, usually because the model is missing, renamed, or the generated client is stale.

Fix: Make sure the Prisma model is BlypLog, mapped to blyp_logs, run migrations, then run blyp db:generate.

Drizzle adapter fails because db.insert or the table reference is missing

Likely cause: The adapter received the wrong DB object, the wrong table symbol, or an incomplete runtime stub.

Fix: Pass the real Drizzle DB instance and the correct table symbol:

createDrizzleDatabaseAdapter({
  db,
  table: blypLogs,
});

Mongoose adapter is configured but database logging is disabled

Likely cause: The adapter is missing both a Mongoose object and an existing connection.

You may see this warning:

[Blyp] Warning: Mongoose adapter requires either a mongoUrl or an existing connection. Database logging is disabled.

Fix: Pass a Mongoose module/object or an existing connection:

createMongooseDatabaseAdapter({
  mongoose,
  mongoUrl: process.env.MONGODB_URI,
});

Mongoose is not installed

Likely cause: The app config imports mongoose, but the package is missing from dependencies.

Fix: Install Mongoose:

bun add mongoose

MongoDB connection is missing or not ready

Likely cause: MONGODB_URI is missing when using mongoUrl, or the existing Mongoose connection does not expose a native db instance yet.

Fix: Set MONGODB_URI before starting the app, or wait until the existing Mongoose connection is open before passing it to Blyp.

MongoDB logs are inserted but not visible in the expected collection

Likely cause: The adapter is writing to a custom collection value while you are inspecting the default blyp_logs collection.

Fix: Check the configured collection name:

createMongooseDatabaseAdapter({
  mongoose,
  mongoUrl: process.env.MONGODB_URI,
  collection: "blyp_logs",
});

Migrations ran, but inserts still fail

Likely cause: The database contains a table or model that looks similar to Blyp but does not match the actual contract.

Fix: Compare the live schema against Schema Contract. Verify:

The adapter points to the wrong model or table symbol

Likely cause: Prisma config uses a different delegate name, or Drizzle config points to a table other than blypLogs.

Fix:

Logs are missing at request boundaries in callback-style servers

Likely cause: The process or request path completes before the async database queue is flushed.

Fix: Call:

await logger.flush();

at the boundary where you need a hard durability point. This matters most in callback-style servers such as Express, Fastify, and NestJS.

traceId is visible in other Blyp outputs but not in the database schema

Likely cause: The database schema or migration state is older than the current Blyp contract.

Fix: Regenerate or update the Blyp database schema and migrations so the supported traceId column is present.