// referencia de errores

libSQL error codes

libSQL is a fork of SQLite, so errors on a local file are the same SQLite result codes. Remote databases (Turso Cloud or a self-hosted sqld) talk the Hrana protocol over HTTP, so failures arrive as HTTP status codes and server error messages instead. Both shapes are listed here.

Reading a libSQL error

On a local file or embedded replica, libSQL reuses SQLite result codes, so you see things like SQLITE_BUSY: database is locked. Look those up in the SQLite catalog too.

Against a remote server, the client reports SERVER_ERROR: Server returned HTTP status ... and the body carries the server's own message. The HTTP status is often the most reliable part.

Turso Cloud adds platform errors on top: expired auth tokens (401), permission limits (403), missing databases (404), and request-rate limits (429).

The Turso CLI (turso db tokens create, turso db show) reports its own errors when a name or organization does not exist.

All libSQL errors in this reference

19 codes, 18 with a full write-up (linked). Codes and messages are from the libSQL / Turso documentation.

Local SQLite errors

CódigoSignificado
SQLITE_BUSY SQLITE_BUSY: the database is busy 5 SQLITE_BUSY
SQLITE_AUTH SQLITE_AUTH: Autorización denegada 23 autorización denegada

Remote server and Hrana errors

CódigoSignificado
404 Not Found 404 Not Found: unknown database or endpoint Server returned HTTP status 404 Not Found
429 Too Many Requests request rate limit hit Server returned HTTP status 429 Too Many Requests
connection reset / interrupted Connection reset or dropped The connection was interrupted while communicating with the server
too many connections Too many connections to one database Too many connections to the database
Transaction timed-out interactive transaction aborted interactive transaction not allowed in HTTP queries
Error in remote response Error in remote response Error in remote response
500 Internal Server Error server failed on a valid request Server returned HTTP status 500 Internal Server Error
402 Payment Required 402 Payment Required Server returned HTTP status 402 Payment Required
409 Conflict 409 Conflict Server returned HTTP status 409 Conflict
database not found turso CLI: database not found database not found: <name>
socket closed unexpectedly Hrana socket closed the socket connection was closed unexpectedly

Authentication and tokens

CódigoSignificado
401 Unauthorized 401 Unauthorized: bad or missing auth token Server returned HTTP status 401 Unauthorized
403 Forbidden 403 Forbidden: no permission for this resource Server returned HTTP status 403 Forbidden
auth token expired Auth token expired 401 Unauthorized: auth token is invalid or expired
no organization turso CLI: no organization no organization selected or available

Replicas and consistency

CódigoSignificado
SQLITE_BUSY: database is locked embedded replica file locked 5 SQLITE_BUSY: La base de datos está bloqueada
replica out of date stale reads from a failing replica replica out of date with the primary
// un cliente, todos los motores

A faster way to work with libSQL

SQLly es un cliente SQL nativo para macOS, Windows y Linux, con IntelliSense que entiende el esquema y protecciones frente a instrucciones peligrosas.

Texto y datos de esta página: CC BY 4.0, con atribución a SQLly (sqlly.app). Código y fragmentos SQL: MIT. Detalles de la licencia El texto citado de los mensajes de error pertenece a su proveedor de base de datos.