R
Railway6mo ago
Nafi

Railway occasionally fails to detect open ports

I've recently created the SurrealDB template for Railway, and upon further experimentation I've found that making changes to the original github repository, or publishing a new docker image, sometimes causes Railway to not handle incoming requests via any networking solution (railway TCP proxy, HTTPS cloudflare proxying). The issue seems to resolve itself after detaching the database volume, and creating a completely new service for the database, then reattaching the volume (but this method is not a guaranteed fix). I'm building an app that will be shipped to production very soon and critical outages like this cannot happen every time there is a SurrealDB update. I've tested everything on my local machine with no issues, so I'm starting to wonder whether it's a server-side latency issue on Railway?
46 Replies
Percy
Percy6mo ago
Project ID: N/A
Nafi
Nafi6mo ago
N/A
Brody
Brody6mo ago
that template is actually a work in progress last I checked oh you're the creator, I didn't realize with the difference pfp photos I had a look at your start.sh script, and environment variables, I don't think there is anything you are doing that can't be done with the official surrealdb image. I'll try my hand at creating a template for it, and if successful I would have no problem handing the template over to you so that you can publish and collect it's kickback
Nafi
Nafi6mo ago
thanks
Brody
Brody6mo ago
@Nafi - here is the completed (but unpublished) template https://railway.app/template/9zvHt- unpublish your current template delete your template fork my template https://railway.app/button?code=9zvHt- publish your fork of my template profit?
Nafi
Nafi6mo ago
looks great man! glad you added --no-banner as well as thinking of adding that to the original Btw @Brody where in the docs did you find the start environment variables?
Brody
Brody6mo ago
the help flag prints them. some things I left as a flag, like enabling auth, don't think too many people want no auth on their database so putting it as a flag kinda hides it away a tiny bit to help prevent accidental changes to auth yeah formatting was very messed up on that, railway trims whitespace from the log lines
Nafi
Nafi6mo ago
@Brody could you send me the markdown you used for the template?
Brody
Brody6mo ago
I mean sure, but why? the markdown is on the template I gave you? I really hope you aren't trying to manually update your template? when I said I'd hand over the template, I really meant it, fork my template and publish it unless you have tried that and the markdown is missing?
Nafi
Nafi6mo ago
I forked it, but all of the published markdown is removed I cant copy raw markdown cause its rendered on your template
Brody
Brody6mo ago
gotcha, use this https://bookmarklets.up.railway.app/template-clone/ I know for a fact this copy's the overview markdown
Nafi
Nafi6mo ago
82056
No description
Nafi
Nafi6mo ago
ill try diff browser
Brody
Brody6mo ago
are you trying to clone to your team account? that's very bugged
Nafi
Nafi6mo ago
thats probably why ill switch still no, tried different browser and hobby workspace ill install something that isnt ungoogle chromium or opera gx 💀
Brody
Brody6mo ago
neither should be a problem, I used that bookmarklet last night to clone your template
Nafi
Nafi6mo ago
got you a train btw
Brody
Brody6mo ago
oh awesome, thank you so much! when you use the bookmarklet, make sure you have swapped to your hobby account, and not selected on the team plan
Nafi
Nafi6mo ago
yeah I did im gonna try on firefox
Brody
Brody6mo ago
I'm away from the computer right now so I can't confirm that my bookmarklet still works
Nafi
Nafi6mo ago
No description
Nafi
Nafi6mo ago
No description
Nafi
Nafi6mo ago
its cool dw maybe u can just copy pasta the markdown once ur home? I can try and just take it from the surreal github its just uve already done it is all
Nafi
Nafi6mo ago
thanks
Brody
Brody6mo ago
and then you can just copy the image address for the template logo and it's description
Nafi
Nafi6mo ago
yeye thanks brodie really appreciate this
Brody
Brody6mo ago
no problem, templates are my jam
Nafi
Nafi6mo ago
is Brody your real name?
Brody
Brody6mo ago
yes lol
Nafi
Nafi6mo ago
thats so cool dude
Brody
Brody6mo ago
thank you!
Nafi
Nafi6mo ago
Railway
Deploy SurrealDB on Railway
A scalable, distributed, collaborative, document-graph database
Brody
Brody6mo ago
woohoo hopefully when railway starts working on improving the template experience they will add an option for us users to transfer them to each other, right now it's either fork/clone or ask the team to manually transfer
Nafi
Nafi6mo ago
I think the healthcheck was the reason it wasnt detecting open ports yeah that would be awesome
Brody
Brody6mo ago
nope, nothing like that
Nafi
Nafi6mo ago
what do you think?
Brody
Brody6mo ago
not sure, but you had the tcp proxy enabled? it uses http
Nafi
Nafi6mo ago
didnt change anything. I tried both
Brody
Brody6mo ago
did you have a PORT variable when you had it on http mode?
Nafi
Nafi6mo ago
to be fair, the problem only seemed to arise after I added the DB_ prefix to the ENV vars so that may just be it when you suggested that did you just mean credentials? DB_USER and DB_PASS
Brody
Brody6mo ago
not sure what it was, but rest assured you are now the owner of a fully feature complete template when I suggested those variables I had not at all looked into the surrealdb docs, so I did suggest the wrong variables, but that wouldn't have caused issues with ports
Nafi
Nafi6mo ago
yeah fair enough
Brody
Brody6mo ago
yeah, what does the status on the domain say?
Nafi
Nafi6mo ago
it was because I didn't add https that time, it works fine https:// prefix
Brody
Brody5mo ago
ah gotcha @Melissa this thread is a case of doing a manual transfer (with some difficulties), and ive made templates for other users in the past (where they forked my template) a simple native transfer dialog would be awsome!