Can't host Convex on Railway
vmoraes424
FREEOP

a year ago

Hello! I have my sideproject that I wanted to host on Railway. But it keep getting an error, I would like some help to host this by myself.

The error I'm getting is on my page "Server Error Called by Client"

I've configured everything on Railway according to the docs

90 Replies

vmoraes424
FREEOP

a year ago

564baf2b-7f02-4c82-b6a1-8f7ffb169d88


a year ago

Hi! this error you are getting is in the convex dashboard or in your site_armor service?


vmoraes424
FREEOP

a year ago

is in my site


vmoraes424
FREEOP

a year ago

when I open it, my screen went white and this error popped in the console


a year ago

and how can you be sure it is related to the convex instance?


vmoraes424
FREEOP

a year ago

I did everything the docs told me to do


vmoraes424
FREEOP

a year ago

and I had this problem


vmoraes424
FREEOP

a year ago

I don't know


a year ago

Can you access the convex dashboard and try doing some queries?


vmoraes424
FREEOP

a year ago

yes, in my dashboard hosted on railway is normal


vmoraes424
FREEOP

a year ago

1382757165349208155


vmoraes424
FREEOP

a year ago

with nothing in the table


vmoraes424
FREEOP

a year ago

I have to put this URL in the NEXT_PUBLIC_CONVEX_URL, right?

1382757391837433876


a year ago

any error logs on the Convex service?


vmoraes424
FREEOP

a year ago

lemme see


a year ago

iirc when you setup Convex with the CLI it shows an option to use a self hosted deployment


a year ago

but seems like it's somehow connecting to Convex from your screenshot, hopefully


vmoraes424
FREEOP

a year ago

ok, the URL was from the cloud deployment I was trying to do yesterday


a year ago

oof


a year ago

That was going to be my next question 😅


a year ago

There's no referenced env vars in your service


a year ago

according to that image


vmoraes424
FREEOP

a year ago

there we go


vmoraes424
FREEOP

a year ago

now I receive this error

1382758068697174181


vmoraes424
FREEOP

a year ago

I tried to ssh this, and run this commands


vmoraes424
FREEOP

a year ago

but it didnt work as well


a year ago

add that command to the pre deploy step of your service and it should work


vmoraes424
FREEOP

a year ago

which one?


a year ago

you can find that by going to your service settings and then look for pre deploy step, should be below the start command


a year ago

the nextjs one


a year ago

also, I would recommend using reference variables for your service as Medim said.

something like this should work:

NEXT_PUBLIC_CONVEX_URL=https://${{"Convex Backend".RAILWAY_PUBLIC_DOMAIN}}

vmoraes424
FREEOP

a year ago

I have one

1382758831012053083


vmoraes424
FREEOP

a year ago

the other one is from yesterday


a year ago

but you're hardcoding it instead of using reference variables


vmoraes424
FREEOP

a year ago

I'll deleve deploy key, right?


a year ago

basically Railway will pull up your URL automatically from your service


vmoraes424
FREEOP

a year ago

hmm


a year ago

yep, you'll need a deploy key


vmoraes424
FREEOP

a year ago

like this?

1382759289415798937


a year ago

prefix it with https://


vmoraes424
FREEOP

a year ago

and where can I find it?


vmoraes424
FREEOP

a year ago

it automaticly did it


a year ago

it's somewhere in the Convex dashboard


vmoraes424
FREEOP

a year ago

because in the dasboard it shows this

1382759535751467109


vmoraes424
FREEOP

a year ago

that's why i didn't put it


a year ago

I don't remember that variable already including https:// so I would check it before hand


vmoraes424
FREEOP

a year ago

yeah it did


a year ago

oh then I would follow what Convex is saying to do, unfortunately I'm not that familiar with the self hosted option


vmoraes424
FREEOP

a year ago

ok


vmoraes424
FREEOP

a year ago

back to the pre deploy command


vmoraes424
FREEOP

a year ago

i didnt find


vmoraes424
FREEOP

a year ago

do you know what it is?


a year ago

sorry, it's called pre-deploy step

1382760011821744330


vmoraes424
FREEOP

a year ago

ok, but I put npx convex dev in there?


a year ago

no, you put npx convex deploy as you're not in dev anymore


vmoraes424
FREEOP

a year ago

ok, let's see what it builds


vmoraes424
FREEOP

a year ago

ok, it crashed

1382761289314734223


vmoraes424
FREEOP

a year ago

<:lfg:786867302888505364>


a year ago

hmm, can you send full logs?


a year ago

weird that it didn't find the .next build directory


vmoraes424
FREEOP

a year ago

hmm


vmoraes424
FREEOP

a year ago

I put next build && npx convex deploy now


vmoraes424
FREEOP

a year ago

but i dont think its gonna work


vmoraes424
FREEOP

a year ago

it it appears to be working

1382761743171846324


a year ago

hmmm


a year ago

it's using the cloud one


a year ago

no?


vmoraes424
FREEOP

a year ago

im trying to redeploy with the npx convex deploy


vmoraes424
FREEOP

a year ago

yeah, I think so


vmoraes424
FREEOP

a year ago

ok, got it


vmoraes424
FREEOP

a year ago

i had to put this command

1382765424701346043


vmoraes424
FREEOP

a year ago

and this two other variables

1382765458557767841


vmoraes424
FREEOP

a year ago

thanks guys for the help


vmoraes424
FREEOP

a year ago

appreciate it


a year ago

great but still weird


a year ago

are you sure that you did set on the pre-deploy step and not on the custom build command?


vmoraes424
FREEOP

a year ago

no


vmoraes424
FREEOP

a year ago

it went in the build


vmoraes424
FREEOP

a year ago

and worked


vmoraes424
FREEOP

a year ago

soooo


a year ago

oh that's where it failed


vmoraes424
FREEOP

a year ago

I'm not touching it


vmoraes424
FREEOP

a year ago

before it was in pre-deploy


vmoraes424
FREEOP

a year ago

now is in build


a year ago

hmmm maybe Convex somehow needs to know the build command


a year ago

anyway, nice to know it's working!


vmoraes424
FREEOP

a year ago

thank you for the help


vmoraes424
FREEOP

a year ago

vamo brasil



vmoraes424
FREEOP

a year ago

see you there


Welcome!

Sign in to your Railway account to join the conversation.

Loading...