Skip to content

Database errors ​

Thrown as DatabaseError (its code says which kind). Each entry is an identifier (error.id), then the message as the error states it, where {expression} stands for the value of that expression in the source ({…} for one too long to show), then what to do about it: the text useFullErrorMessages(messages) and explain(error) add, where {name} stands for the error's parameter of that name. See Errors.

database.aborted ​

The statement was cancelled because its AbortSignal fired.

The caller's AbortSignal fired, and the database was asked to cancel the statement; inside a transaction, the transaction is rolled back.

database.abortedBefore ​

The statement was not run: its AbortSignal had fired.

The {what} was not run: its AbortSignal had fired.

The caller's AbortSignal had fired before the statement was sent; nothing was sent to the database.

database.abortedNotCancelled ​

The call was aborted by its AbortSignal, but cancelling the statement failed, so it ran to its end.

error.cause says why cancelling failed (an AggregateError of the cancel's error and the statement's own, when the statement then failed too); where the runtime cannot cancel (no node:net and node:tls, as on a Worker without nodejs_compat), the statement always runs to its end. The connection is not reused.

database.abortedQueued ​

The statement was not run: its AbortSignal fired while it waited for the statements before it on this transaction's connection.

The caller's AbortSignal fired; nothing was sent to the database.

database.abortedWaiting ​

The statement was not run: its AbortSignal fired while it waited for a free connection.

The {what} was not run: its AbortSignal fired while it waited for a free connection.

The caller's AbortSignal fired; nothing was sent to the database. A larger pool, or fewer statements at once, shortens the wait.

database.adapterClosed ​

This adapter is closed: adapter.close() was called.

Create a new adapter to keep using the database.

database.callTimeout ​

The call ran longer than its timeoutMs ({timeoutMs} ms), which covers every statement it runs.

Give the call a larger timeoutMs: it covers every statement the call runs.

database.cancelFailed ​

A cancel request for this connection failed, and it may still reach the server and cancel whatever runs next.

The connection takes no more statements; release it (it is closed, not pooled) and acquire a new one.

database.closed ​

The SQLite database is closed.

Create a new adapter to keep using the database.

database.connectionFailed ​

Lost the connection to the database, or could not open one: {error.message}.

Check that the database is running and that the connection settings are right; the cause is the driver's error.

database.connectionReleased ​

This connection was {…}.

Acquire a new connection.

database.locked ​

The database is locked by another connection ({code}).

Another connection holds the lock. Retry the statement or the transaction (the error is retryable), or let SQLite wait for the lock with the busy_timeout pragma.

database.openFailed ​

Could not open the SQLite database ({code}): {error.message}.

Check the filename and its directory's permissions; the cause is the driver's error.

database.rejected ​

The database rejected the statement (SQLSTATE {code}){said}.

The database rejected the statement (MySQL error {errno}, {…}){said}.

The database rejected the statement ({code}){said}.

The cause is the driver's error, with the database's full report; error.sql is the statement. Look the SQL state up in the database's documentation.

database.streamConnectionGone ​

The connection of this stream was released or destroyed while the stream was open.

Keep the connection until the stream is finished, or leave the for-await loop first.

database.timeout ​

The statement was cancelled because it ran longer than its timeoutMs ({timeoutMs} ms).

Give the call a larger timeoutMs, or make the statement faster (an index, a narrower query); inside a transaction, the transaction is rolled back.

database.timeoutNotCancelled ​

The statement ran longer than its timeoutMs ({timeoutMs} ms), but cancelling it failed, so it ran to its end.

error.cause says why cancelling failed (an AggregateError of the cancel's error and the statement's own, when the statement then failed too); where the runtime cannot cancel (no node:net and node:tls, as on a Worker without nodejs_compat), the statement always runs to its end. The connection is not reused.

database.timeoutQueued ​

The statement was not run: it waited longer than its timeoutMs ({timeoutMs} ms) for the statements before it on this transaction's connection.

Give the call a larger timeoutMs, or run fewer statements at once on the transaction.

database.timeoutSpent ​

The statement was not run: its timeoutMs ({timeoutMs} ms) was spent before it could start.

The statement was not run: the call's timeoutMs was spent before it could start.

Give the call a larger timeoutMs: the time is shared by every statement of a call.

database.timeoutWaiting ​

The statement was not run: it waited longer than its timeoutMs ({timeoutMs} ms) for a free connection.

The {what} was not run: it waited longer than its timeoutMs ({timeoutMs} ms) for a free connection.

Nothing was sent to the database. Give the pool more connections, run fewer statements at once, or give the call a larger timeoutMs.

database.transactionTimeout ​

The transaction ran longer than its timeoutMs ({level.timeoutMs} ms), which covers every statement in it, so it was stopped and rolled back.

Give the transaction a larger timeoutMs, or do less in it.

database.unreachable ​

Could not reach the database, or lost the connection to it ({code}).

Could not reach the database, or lost the connection to it ({…}).

Check that it is running and that the connection settings are right.