# 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.

Source: https://sqlly.app/errors/libsql/database-not-found-404
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Error: `404 Not Found`
- Category: Remote server and Hrana errors

Error message:

```text
Server returned HTTP status 404 Not Found
```

## What it means

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`.

## Common causes

- 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.

## How to fix it

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

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

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

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

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

## Reproduce it safely

```sql
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.
```

## How SQLly helps

SQLly keeps the URL per connection, so after a `turso db show mydb --url` copy-paste you can test the corrected URL from the desktop before touching your app's environment variables.

## Questions

### 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`.

## Related errors

- [`401 Unauthorized`](https://sqlly.app/errors/libsql/unauthorized-401): 401 Unauthorized: bad or missing auth token
- [`403 Forbidden`](https://sqlly.app/errors/libsql/forbidden-403): 403 Forbidden: no permission for this resource
- [`connection reset / interrupted`](https://sqlly.app/errors/libsql/connection-interrupted): Connection reset or dropped

The code and message text are from the [libSQL / Turso documentation](https://docs.turso.tech/).
