connection error, fetch failed

not sure if this issue comes from drizzle or planetscale but I'm getting this error while trying to do any queries from my db while on local dev
{
e: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async postJSON (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:128:22)
at async Connection.execute (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:86:23)
at async PlanetScalePreparedQuery.execute
cause: [Error: 0093F4DB01000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
] {
library: 'SSL routines',
reason: 'wrong version number',
code: 'ERR_SSL_WRONG_VERSION_NUMBER'
}
}
{
e: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async postJSON (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:128:22)
at async Connection.execute (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:86:23)
at async PlanetScalePreparedQuery.execute
cause: [Error: 0093F4DB01000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
] {
library: 'SSL routines',
reason: 'wrong version number',
code: 'ERR_SSL_WRONG_VERSION_NUMBER'
}
}
5 Replies
Liltripple_reid
Liltripple_reidOP14mo ago
tried to use this
DATABASE_URL="mysql://username:[email protected]:3306/toldyouso?ssl={"rejectUnauthorized": true}&sslcert=/etc/ssl/cert.pem"
DATABASE_URL="mysql://username:[email protected]:3306/toldyouso?ssl={"rejectUnauthorized": true}&sslcert=/etc/ssl/cert.pem"
but it's not working either
{
e: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async postJSON (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:128:22)
at async Connection.execute (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:86:23)
at async PlanetScalePreparedQuery.execute (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/drizzle-orm/planetscale-serverless/index.mjs:31:26)
file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@trpc/server/dist/adapters/next.mjs:44:9 {
cause: [Error: 0093F4DB01000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
] {
library: 'SSL routines',
reason: 'wrong version number',
code: 'ERR_SSL_WRONG_VERSION_NUMBER'
}
}
{
e: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async postJSON (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:128:22)
at async Connection.execute (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:86:23)
at async PlanetScalePreparedQuery.execute (file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/drizzle-orm/planetscale-serverless/index.mjs:31:26)
file:///Users/a3tech/Developer/personal_projects/remarkable/node_modules/.pnpm/@[email protected]/node_modules/@trpc/server/dist/adapters/next.mjs:44:9 {
cause: [Error: 0093F4DB01000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
] {
library: 'SSL routines',
reason: 'wrong version number',
code: 'ERR_SSL_WRONG_VERSION_NUMBER'
}
}
similar error but now also mentions drizzle
KG
KG14mo ago
Did you ever solve this? Getting the same thing... If anyone comes across this, I was using the PlanetScale driver when trying to connect to MySQL
Liltripple_reid
Liltripple_reidOP13mo ago
Hey yes Sorry man haven’t check discord in some days The best solution is to use the HOST, USER, PASSWORD method to authenticate with drizzle And only use the database url for db:push @KG
KG
KG13mo ago
@Liltripple_reid thanks, very helpful! 🍻
louden
louden13mo ago
I'm getting this error consistently as well, but i'm using planetscale's CLI to connect to a remote branch pscale connect <DATABASE> <BRANCH> which ideally, should provide a consistent connection of 127.0.0.1:3306 instead of copying and pasting different env variables. That said, I can get it to connect without this same error via both a URL connection or the HOST, USER, PASSWORD methods. Anyone else running into something similar?
Want results from more Discord servers?
Add your server