connection reset / interrupted: Connection reset or dropped
The network path to the server dropped mid-request: the socket closed, the request timed out, or a proxy cut the connection.
- 오류
connection reset / interrupted
의미
Remote libSQL runs over HTTP/WebSocket. Any hop between client and server can drop: TLS handshake failure, a load balancer idle timeout, a WebSocket closed by the server, or plain network loss. The client sees a closed socket or an interrupted request rather than a server error, so no HTTP status arrives. These failures are usually transient, and a retry often succeeds.
일반적인 원인
- Network loss between client and server, including wifi and VPN blips.
- An idle WebSocket closed by a proxy or load balancer timeout.
- Server restart or failover on the remote database.
- The client gave up on a request that exceeded its own timeout.
Find the cause
Decide first whether writes may have been applied before the drop: if the connection died mid-transaction, the transaction rolled back; if it died mid-batch with individual autocommit statements, some may have applied. Check by reading the data. Then look at where it dropped: a timeout with no bytes returned points at the network or proxy; a clean close right after connect points at the server refusing or restarting. `curl` to the same URL from the same machine separates your client from the network.
해결 방법
-
Retry idempotent reads and use transactions for multi-statement writes so a dropped connection cannot leave partial state:
await db.batch(['INSERT ...', 'UPDATE ...'], 'write');
-
Check reachability and latency by hand when it recurs:
curl -s -o /dev/null -w '%{http_code} %{time_total}\n' https://mydb-myorg.turso.io/v2/pipeline -
Wrap remote calls in your own timeout; @libsql/client has no request timeout for remote clients (its
timeoutconfig is a local-file busy timeout):const res = await Promise.race([ db.execute(sql), new Promise((_, rej) => setTimeout(() => rej(new Error('client timeout')), 10_000)) ]);
Other ways to handle it
For HTTP-only clients, prefer the /v2/pipeline endpoint, which is stateless per request, over interactive transactions that need a live session. For flaky networks, embedded replicas keep reads local.
안전하게 재현하세요
Local and honest: start `turso dev --db-file scratch.db`, open a client, then kill the turso process mid-request to get a socket close. Real-world flakiness (proxies, TLS, wifi) cannot be reproduced offline; the kill-based repro only covers the server-gone-away shape.
질문
If the connection drops mid-transaction, did my writes apply?
An interactive transaction rolls back when its connection dies. A batch is atomic: all of it applies or none. Individual autocommit statements that already returned stay applied, so read the data back to check rather than replaying blindly.
Does @libsql/client have a request timeout option?
Not for remote clients. The timeout config sets a busy timeout and only affects local file: databases. For remote calls, wrap the promise in your own timeout (Promise.race with a rejected timer, or an AbortSignal on a custom fetch).
Why do my WebSocket connections die after quiet periods?
Proxies and load balancers close idle sockets. For long idle periods prefer the HTTP pipeline shape, or issue a cheap keepalive statement; either way treat the closed socket as a retryable failure.
관련 오류
404 Not Found404 Not Found: unknown database or endpointSQLITE_BUSY: database is lockedembedded replica file lockedtoo many connectionsToo many connections to one database
More remote server and hrana errors errors
429 Too Many Requestsrequest rate limit hitTransaction timed-outinteractive transaction abortedError in remote responseError in remote response500 Internal Server Errorserver failed on a valid request402 Payment Required402 Payment Required409 Conflict409 Conflictdatabase not foundturso CLI: database not found
코드와 메시지 텍스트의 출처는 다음과 같습니다 libSQL / Turso documentation. 전체 목록은 libSQL error list 또는 모든 데이터베이스 오류 검색.
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.
이 페이지의 텍스트와 데이터: CC BY 4.0, 출처: SQLly (sqlly.app). 코드와 SQL 스니펫: MIT. 라이선스 세부 정보 인용된 오류 메시지 텍스트의 권리는 해당 데이터베이스 공급업체에 있습니다.