tursodatabase / tursodatabase/libsql-client-ts

Non explicit LibsqlError: SERVER_ERROR: Server returned HTTP status 400

Open
#202 3 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
576
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Hi guys, I'm following this tutorial about multi-tenant app with RemixJS + Drizzle + Turso. In short, when creating a tenant (called organization), a new database is created specifically for this tenant. So, I'm facing some issues with libsql.
Even by cloning original repo (from the tutorial), doing await db.query or await db.select or await db.insert broke the app with this error: "LibsqlError: SERVER_ERROR: Server returned HTTP status 400". Seems like it happened when my app try to execute some queries for the specific database organization. I try to understand what cause this problem.

Dependencies version:
"@libsql/client": "^0.3.6",
"drizzle-orm": "^0.28.6",
"drizzle-kit": "^0.19.13",

Check the following screenshot showing the error:
Screenshot 2024-04-12 at 03 25 31

This is the screenshot of the concerned file, line 48 is the problem:
Screenshot 2024-04-12 at 04 15 26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tutorial's tenant-database creation flow and the concerned file at line 48, then reproduce the failing await db.query, db.select, or db.insert using the listed dependency versions. Trace the HTTP 400 response to determine why requests for the tenant database fail; done means the cloned example executes these operations without LibsqlError.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.