libsql-client-ts icon indicating copy to clipboard operation
libsql-client-ts copied to clipboard

HRANA_WEBSOCKET_ERROR

Open kimdonginsu01 opened this issue 2 years ago • 1 comments

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/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48441:12)
    at #openStream (/home/[email protected]/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/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48474:29)
    at async TursoSqlite.query (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:42938:21)
    at async fromDatabase3 (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:12938:23)
    at async sqlitePushIntrospect (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:51949:19)
    at async Command.<anonymous> (/home/[email protected]/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/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48099:25)
      at _WebSocket.<anonymous> (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48022:78)
      at callListener (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:45693:18)
      at _WebSocket.onError (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:45647:13)
      at _WebSocket.emit (node:events:514:28)
      at emitErrorAndClose (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:46607:17)
      at ClientRequest.<anonymous> (/home/[email protected]/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?

kimdonginsu01 avatar Sep 18 '23 10:09 kimdonginsu01

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

jasongitmail avatar Oct 10 '23 20:10 jasongitmail