tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
226 stars 32 forks source link

HRANA_WEBSOCKET_ERROR #94

Open kimdonginsu01 opened 1 year ago

kimdonginsu01 commented 1 year ago

Bun: 1.0.1 OS: Ubuntu 22.04.3 LTS

When trying to run drizzle-kit push:sqlite, I got this error:

LibsqlError: HRANA_WEBSOCKET_ERROR: unable to verify the first certificate
    at mapHranaError (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48441:12)
    at #openStream (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48575:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HranaClient.execute (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48474:29)
    at async TursoSqlite.query (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:42938:21)
    at async fromDatabase3 (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:12938:23)
    at async sqlitePushIntrospect (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:51949:19)
    at async Command.<anonymous> (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:53436:31) {
  code: 'HRANA_WEBSOCKET_ERROR',
  [cause]: WebSocketError: unable to verify the first certificate
      at #onSocketError (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48099:25)
      at _WebSocket.<anonymous> (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48022:78)
      at callListener (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:45693:18)
      at _WebSocket.onError (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:45647:13)
      at _WebSocket.emit (node:events:514:28)
      at emitErrorAndClose (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:46607:17)
      at ClientRequest.<anonymous> (/home/tuyenhm@aht.local/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:46504:9)
      at ClientRequest.emit (node:events:514:28)
      at TLSSocket.socketErrorListener (node:_http_client:501:9)
      at TLSSocket.emit (node:events:514:28)
}

Node.js v18.17.1

Anyone knows why?

jasongitmail commented 11 months ago

I encountered this too. I believe it may be due to https://github.com/libsql/libsql-client-ts/issues/108: Bun defaults the libsql:// protocol to WebSockets