// libSQL error reference

404 Not Found: 404 Not Found: unknown database or endpoint

No database exists at the URL: the name is wrong, it was deleted, or the URL points at the wrong host.

Erro
404 Not Found
Categoria
Remote server and Hrana errors
Mensagem de erro
Server returned HTTP status 404 Not Found

O que significa

A 404 from a remote libSQL connection means the server has no database at that address. The request itself was fine; the target was not. The usual forms: a typo in the database name in the libsql:// URL, a database deleted while an old URL is still configured, an environment mixup where staging points at a dropped database, or a platform API call to a name that does not exist. The libsql JS client surfaces this as SERVER_ERROR: Server returned HTTP status 404.

Causas comuns

  • The database name in the URL is misspelled.
  • The database was destroyed and the URL is stale.
  • The URL belongs to another environment or organization.
  • A platform API call names a database or resource that does not exist.

Find the cause

Run `turso db list`. If the name is missing, the URL is stale or wrong. If it is present, compare `turso db show <name> --url` character by character with the URL in your config: libsql URLs are `<db>-<org>.turso.io`, so a wrong org slug produces a valid-looking URL with nothing behind it. A 404 on one environment but not another usually means the database exists in one org only.

Como corrigir

  1. List your databases and compare with the URL your client uses:

    turso db list
  2. Get the exact connect string for the database and paste it into your config verbatim:

    turso db show mydb --url
  3. If the database is gone, recreate it, then re-apply your schema:

    turso db create mydb
    turso db shell mydb < schema.sql
  4. Reproduce the request shape by hand to see the raw status:

    curl -s -o /dev/null -w '%{http_code}\n' https://mydb-myorg.turso.io/v2/pipeline

Other ways to handle it

If the database is gone and you only need local work, switch to a file: URL. To recreate from what still exists, turso db create mydb --from-db <other-db> copies an existing database, or re-apply your schema with turso db shell mydb < schema.sql.

Reproduza com segurança

Reproducing this honestly needs a real Turso URL: point @libsql/client at `libsql://definitely-not-a-real-db-example.turso.io` and you get SERVER_ERROR with status 404, since nothing lives at that host. You can also create a database, note the URL, destroy it with `turso db destroy <name>`, and reuse the old URL. `turso dev` always answers, so it cannot reproduce a 404.

Perguntas

My libsql URL looks correct but I still get 404. What now?

URLs are <db>-<org>.turso.io, so a wrong org slug produces a valid-looking host with nothing behind it. Compare the URL character by character with turso db show mydb --url, then check turso db list in the organization you think the database lives in.

Can I test a Turso database URL from the command line?

Yes: curl -s -o /dev/null -w '%{http_code}\n' https://mydb-myorg.turso.io/v2/pipeline returns 404 for a dead host and another status (usually 401) when the host exists but wants a token.

Does turso dev ever return 404?

No. The local dev server always answers for its own database, so a 404 means you are pointing at the cloud, not at turso dev.

Erros relacionados

More remote server and hrana errors errors

O código e o texto da mensagem são de libSQL / Turso documentation. Veja toda a libSQL error list ou pesquise todos os erros do banco de dados.

// menos erros, correções mais rápidas

Work on libSQL in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for libSQL and the other databases you use.

Texto e dados desta página: CC BY 4.0, com crédito ao SQLly (sqlly.app). Código e trechos SQL: MIT. Detalhes da licença O texto citado das mensagens de erro pertence ao fornecedor do banco de dados.