Connection failed, fetch failed.
I am trying to use drizzle (with planetscale drivers) to connect to a local mysql server but i consistantly get errors like HANDSHAKE_NO_SSL_SUPPORT & ERR_SSL_WRONG_VERSION_NUMBER
Do note that this issue persists no matter what SQL db i use.
MariaDB, Mysql, Sqlite, Sqlite3 doesn't matter.
I hate discords new formatting.
23 Replies
This is my drizzle configuration.
Connection looks like this.
And the conncetionstring looks like this.
mysql://MariaInterface:MARIADB@localhost:3306/lucia?ssl={"rejectUnauthorized":false}
Hello, @Mark! I did research and I think this issue is not related to drizzle. It might be with your server setup.
https://github.com/lbdremy/solr-node-client/issues/362
GitHub
{ library: 'SSL routines', function: 'ssl3_get_record', reaso...
I am using solr 8.11. behingd a nginx server at digitalocean on ubuntu 20.00. trying to run the code: // Use var solr = require('solr-client') in your code var solr = require('solr-clie...
Weird, this shouldn't matter though, unless drizzle or the db for some reason wants a TLS / HTTPS connection.
I have previously been able to use drizzle in other projects for DB access without issues, nor this TLS issue.
I got kind of confused with that issue, are they implying that the mysql (MariaDB in this case) server got incorrectly set up?
I combed through the project, there is no mentions of HTTPS / TLS connections in the code, i am unsure what the cause is anymore.
Am I right that you are trying to connect to MariaDB using planetscale drivers?
Yes.
The example project i use has a planetscale config.
Honestly, I am not familiar with MariaDB, but as far as I know, drizzle doesn't support MariaDB now.
https://github.com/drizzle-team/drizzle-orm/issues/203
MariaDB and Mysql are pretty similar, MariaDB has all the stuff that mysql has for dependancy reasons.
Either way that doesn't matter as stated in my first message.
I've used Mysql, Maria, sqlite, no difference.
I looked for issues about this for both maria and mysql, both turned up nearly nothing.
I saw a post that said to use Host, username and password in the connect code.
However that turned up nothing, it works sure (No errors about the code itself) but the SSL issues still occur.
Ok, did you test with other drivers? For example
mysql2
?With drizzle db:push
but i would assume so.
I have used a db explorer like dbeaver and it connects without any issues without TLS, SSL or anything like that.
drizzle-kit push:mysql
I get the error "HANDSHAKE_NO_SUPPORT" which is unlikely to happen in the first place.
There is SSL support but is likely a bug with something else.
When i run SHOW VARIABLES WHERE "%SSL%";
I get this:
Give me a sec, i will answer your question in a bit
Yes, i have tried mysql2.
that is how i get the HANDSHAKE_NO_SUPPORT error.
I am not 100% sure if the "have_ssl" can be a cause, interesting, so you have this issue will all db (MySQL,SQLite)
Yes.
sqlite i am a bit unsure of, i will have to check if i actually did use it.
It will be weird if that one woud fail considering its not meant to really be on the web due to the fact that you cannot secure it with user auth (at least to my knowledge)
Ima see if i can change the use_ssl to yes and if it resolves anything.
I will try to investigate tomorrow, I haven’t faced this issue before
It doesn't seem to be very common.
Okay, moment of truth.
Nope, same issue.
Wait hold on, i am getting a breakthrough.
wait so. i go back to:
It kind of semi works but it complains about the await?
⨯ SyntaxError: await is only valid in async functions and the top level bodies of modules
at (action-browser)/./src/server/db/index.ts (/home/mark/next-lucia-auth/.next/server/app/(auth)/login/page.js:893:1)
at __webpack_require__ (/home/mark/next-lucia-auth/.next/server/webpack-runtime.js:33:42)
at eval (./src/lib/auth/index.ts:10:68)
at (action-browser)/./src/lib/auth/index.ts (/home/mark/next-lucia-auth/.next/server/app/(auth)/login/page.js:772:1)
at __webpack_require__ (/home/mark/next-lucia-auth/.next/server/webpack-runtime.js:33:42)
at eval (./src/lib/auth/actions.ts:21:67)
at (action-browser)/./src/lib/auth/actions.ts (/home/mark/next-lucia-auth/.next/server/app/(auth)/login/page.js:761:1)
at Function.__webpack_require__ (/home/mark/next-lucia-auth/.next/server/webpack-runtime.js:33:42)
printing the connection results in this.
So it seems to be valid, problem is that still says wrong version number.
Seems like drizzle gets all of the required info like username, password and so on from the conncetionurl, which is nice to know but confusing on why it fails.so, you get the same error or it`s something new?
This gives a new error. But it seems to connect properly, it gives query is not a valid function despite it being one.
(That is if you fix the await problems)
Can you show the query please?
Give me a minute, i just got on my computer.
Vscode's intellisense.
try this
will be surprising if it wont start complaining about async functions
Same error
Wait no, it gave a different error that was resolved with a restart of the project that later went to
you should rewrite your
connect
function or use await connect()
in async function. Because db
has type Promise<...>
Interesting
It's kinda annoying though because now i have look through all of my imports and and initialize an awaited db.
so i have to look all over the place
Regardless that seems to be a fix, although an annoying one because i just have to expect the code to error somewhere sometime about db.
I don't think we can return an awaited db type, the code will just complain, thanks for your help! 😁