Magic ports aren't being resolved correctly
wilsonowilson
PROOP

a year ago

I have just generated a domain that points to port 4000 of my railway deployment.

Problem is, it's stll pointing to the port of my custom domain (9600)

Any idea why?

Project: https://railway.app/project/045e21af-ff58-4d2c-a95a-4147dea211c9/service/c040e311-95df-41bf-82ff-e87da0aa84fe/settings

Domain: https://curator-production-2781.up.railway.app/

0 Replies

brody
EMPLOYEE

a year ago

can you show me the public networking section of your service please


wilsonowilson
PROOP

a year ago

Here you go!

1259589111946150000


brody
EMPLOYEE

a year ago

what port did you choose when you setup the custom domain?


wilsonowilson
PROOP

a year ago

4000


wilsonowilson
PROOP

a year ago

Tried creating another domain with another running port (4001). It's still showing a blank screen https://curator-production-658d.up.railway.app/


brody
EMPLOYEE

a year ago

where does this 9600 port come in play?


wilsonowilson
PROOP

a year ago

That's the default port (currently set by the $PORT variable)


wilsonowilson
PROOP

a year ago

I'm running two services in the same instance here. The start command runs the 9600 port and the other application runs after the first has initialized


brody
EMPLOYEE

a year ago

your custom domain works?


wilsonowilson
PROOP

a year ago

Yup!


wilsonowilson
PROOP

a year ago


wilsonowilson
PROOP

a year ago


wilsonowilson
PROOP

a year ago

Oddly enough, if I create a new domain and point it to 9600, it works just fine


brody
EMPLOYEE

a year ago

but the railway provided domain does not?


wilsonowilson
PROOP

a year ago

The railway provided domain (sj-curator-production.up.railway.app) works just fine. If I create a new domain pointing to 9600 it also works https://curator-production-1d4f.up.railway.app/


brody
EMPLOYEE

a year ago

im lost, then what is the issue?


wilsonowilson
PROOP

a year ago

Ah sorry. let me try to explain better


wilsonowilson
PROOP

a year ago

I'm trying to use magic ports in railway


wilsonowilson
PROOP

a year ago

The new feature that I'm really excited about 🔥


wilsonowilson
PROOP

a year ago

I'm running two apps on a single instance


wilsonowilson
PROOP

a year ago

One on port 9600 (default). That is connected to my custom domain and the railway provided domain which works just fine


wilsonowilson
PROOP

a year ago

And the other on port 4000.


wilsonowilson
PROOP

a year ago

I'm now trying to provision a new domain for port 4000


wilsonowilson
PROOP

a year ago

But when I do, it only shows a blank screen like so https://curator-production-2781.up.railway.app/


wilsonowilson
PROOP

a year ago

And I'm not sure why this is happening


wilsonowilson
PROOP

a year ago

For the domain on port 9600, it works just fine


wilsonowilson
PROOP

a year ago

And when I provision a new domain for port 9600, it works fine too. https://curator-production-1d4f.up.railway.app/


wilsonowilson
PROOP

a year ago

It's just port 4000 which shows a blank screen


wilsonowilson
PROOP

a year ago

Let me know if that's still unclear


brody
EMPLOYEE

a year ago

how do you know the blank screen is not your app?


wilsonowilson
PROOP

a year ago

The markup doesn't match is one


wilsonowilson
PROOP

a year ago

It's just an empty and tag


wilsonowilson
PROOP

a year ago

But in my app, the default markup is much different.


wilsonowilson
PROOP

a year ago

I've noticed this also happens when I choose a port that isn't running.


brody
EMPLOYEE

a year ago

the white screen is a 0 byte response


brody
EMPLOYEE

a year ago

how do you know your app is running on the port 4000?


wilsonowilson
PROOP

a year ago

the logs indicate it is.

1259592369490231600


wilsonowilson
PROOP

a year ago

It also shows up in Railway magic

1259592454961762300


brody
EMPLOYEE

a year ago

you are running a dev server, you can't really expect things to work properly when you run a dev server


brody
EMPLOYEE

a year ago

from this, i assume you are trying to run a frontend and a backend in the same service?


wilsonowilson
PROOP

a year ago

So the use-case is a little weird.
I'm trying to run an automated integration test suite and preview the results in vitest (so I can post it to slack).


wilsonowilson
PROOP

a year ago

Which is why I'm using a dev server


brody
EMPLOYEE

a year ago

okay well thats better than just running a dev server to handle the sites traffic


brody
EMPLOYEE

a year ago

where are these tests being ran from? within the container?


wilsonowilson
PROOP

a year ago

exactly


wilsonowilson
PROOP

a year ago

And i'm just running an exec command in node to start them up


brody
EMPLOYEE

a year ago

so why does it need to be exposed publicly if the tests are being ran inside the container?


wilsonowilson
PROOP

a year ago

The goal was being able to debug quickly. We're running a few snapshot tests (the json structure we're testing can often change), so being able to see the snapshots in vitest's ui is very helpful


wilsonowilson
PROOP

a year ago

The goal was to have a one click link to the vitest report


brody
EMPLOYEE

a year ago

gotcha


wilsonowilson
PROOP

a year ago

Ideally it would just be a static html page, and I could serve that from the main server, but there's no way to do this in vitest afaik


brody
EMPLOYEE

a year ago

hey as long as you arent serving the actual site with a dev server thats good with me


brody
EMPLOYEE

a year ago

very common mistake


wilsonowilson
PROOP

a year ago

I can imagine ahaha


brody
EMPLOYEE

a year ago

try having the dev server listen on the 0.0.0.0 host


wilsonowilson
PROOP

a year ago

trying it now!


wilsonowilson
PROOP

a year ago

IT WORKED!!!!


wilsonowilson
PROOP

a year ago

THANK YOU SO MUCH 💜



brody
EMPLOYEE

a year ago

no problem!


Loading...