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
| Code | Meaning |
|---|---|
SQLITE_BUSY
|
SQLITE_BUSY: the database is busy
5
SQLITE_BUSY
|
SQLITE_AUTH
|
SQLITE_AUTH: authorization denied
23
authorization denied
|
Remote server and Hrana errors
| Code | Meaning |
|---|---|
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
| Code | Meaning |
|---|---|
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
| Code | Meaning |
|---|---|
SQLITE_BUSY: database is locked
|
embedded replica file locked
5
SQLITE_BUSY: database is locked
|
replica out of date
|
stale reads from a failing replica replica out of date with the primary |
A faster way to work with libSQL
SQLly is a native SQL client for macOS, Windows and Linux with schema-aware IntelliSense and guardrails for risky statements.
Text and data on this page: CC BY 4.0, credit SQLly (sqlly.app). Code and SQL snippets: MIT. License details Quoted error message text belongs to its database vendor. View as Markdown