R
Railway3mo ago
DVT

LibSQL not working on private network

I have a Go project where I'm using LibSQL as the database, in railway, I have my Go server and the LibSQL template running. When I use the public url for the database it works fine, but when I use the private url it doesn't work. I verified that I'm passing the correct private url from the logs. The error I get is:
failed to execute query INSERT INTO database (column_1, column_2)
VALUES ("value_1", "value_2")
error code = 2: Error executing statement: Hrana: `http error: `error trying to connect: received corrupt message of type InvalidContentType``
failed to execute query INSERT INTO database (column_1, column_2)
VALUES ("value_1", "value_2")
error code = 2: Error executing statement: Hrana: `http error: `error trying to connect: received corrupt message of type InvalidContentType``
Project ID: ce1bc4e2-67b7-470d-94a2-730b2908e061
6 Replies
Percy
Percy3mo ago
Project ID: ce1bc4e2-67b7-470d-94a2-730b2908e061
DVT
DVTOP3mo ago
Project ID:ce1bc4e2-67b7-470d-94a2-730b2908e061
Brody
Brody3mo ago
please send the private url you are using, the template should come with one
DVT
DVTOP3mo ago
I'm passing the variable to the server like:
LIBSQL_PRIVATE_URL="${{libSQL.SQLD_PRIVATE_URL}}"
LIBSQL_PUBLIC_URL="${{libSQL.SQLD_PUBLIC_URL}}"
LIBSQL_PRIVATE_URL="${{libSQL.SQLD_PRIVATE_URL}}"
LIBSQL_PUBLIC_URL="${{libSQL.SQLD_PUBLIC_URL}}"
private url is libsql://libsql.railway.internal:8080?tls=0
Brody
Brody3mo ago
and what error are you getting, the log you provided does not have an error message about a connection
DVT
DVTOP3mo ago
I think I fixed it, I was using the github.com/tursodatabase/go-libsql library, I switched to github.com/tursodatabase/libsql-client-go/libsql and it's working now not sure why it was working with the public url and not the private one previously
Want results from more Discord servers?
Add your server