a year ago
I am getting this error in my nextjs application. I am not seeing enough information to understand what is going on.
I see this: Application error: a server-side exception has occurred while loading (see the server logs for more information).
Digest: 2164805080
Attachments
Pinned Solution
a year ago
That's the private networking section. I talked about public networking, you will find the port there
26 Replies
a year ago
Apologies but this looks like an issue with the application level code. Due to volume, we can only answer platform level issues.
I've made this thread public so that the community might be able to help with you query.
Status changed to Awaiting User Response Railway • 11 months ago
a year ago
I understand, but if I had visibility of the logging, I could fix it. The railway logs are not helful.
Status changed to Awaiting Railway Response Railway • 11 months ago
a year ago
This is not giving me enough to find the issue. How do I get more visibility in the logs?
Attachments
a year ago
These logs are coming from your app, not railway. you'll want to add more logs on your end to figure the error out.
Status changed to Awaiting User Response Railway • 11 months ago
a year ago
Try to add several logs at different places when your application starts or where the code is that is producing these logs
a year ago
They have a good start up guide on NextJs may help you out https://docs.railway.com/quick-start#deploying-your-project---with-the-cli
a year ago
Thanks @sim, but the issue is with the internal networking. The app is working fine. it works fine on localhost and it works find on railway when I use the public address for the api server, but I need the internal one to work so I dont get hit with egress fees.
I've had nothing but positive things to say about railway so far and have been steadily moving more to the platform, but this issue with internal vs public has been the most frustrating experience so far.
a year ago
Hello,
Please see our guide on the private network -
https://docs.railway.com/guides/private-networking#communicating-over-the-private-network
Best,
Brody
a year ago
You guys keep copy + pasting this doc, but it is not helping me. I've already tried with no success.
joselvelez
You guys keep copy + pasting this doc, but it is not helping me. I've already tried with no success.
a year ago
It's because the logs you posted is not at all helpful. The actual referenced js file in the stack trace is just a minified file which even in itself isn't helpful when reviewed
So there is actually no meaningful information you have provided other than "an error has occurred".
If you want help then you need to provide more information about your app and in this case you entire app because with the limited info provided i don't even know what to ask
Add me to your github repo or make it public and post it here so we can review and suggest solutions.
smolpaw
It's because the logs you posted is not at all helpful. The actual referenced js file in the stack trace is just a minified file which even in itself isn't helpful when reviewed So there is actually no meaningful information you have provided other than "an error has occurred". If you want help then you need to provide more information about your app and in this case you entire app because with the limited info provided i don't even know what to ask Add me to your github repo or make it public and post it here so we can review and suggest solutions.
a year ago
Yes, I agree, the initial logs I provided were not enough. I've been able to isolate it the issue to the private networking settings - which I am not getting any help from railway support except for them copy + pasting the link to their docs.
a year ago
Is the service you are trying to fetch listening on IPv6?
Are you using http:// in the URL you are trying to fetch?
Are you specifying the port in the URL you are trying to fetch? (the private port such as 8080 or 3000)
a year ago
I have a nestjs application running in my project.
I am trying to get my nextjs application (different service in the same railway project) to access the the nestjs application using the internal networking.
Ive tried setting my env variable in railway for the nextjs application to:
- gridlq
- http://gridlq - http://gridlq.railway.internal
none of these are working. Do i need to specify port as well?
when i set the env variable to the public address, it works fine.
Attachments
joselvelez
I have a nestjs application running in my project.  I am trying to get my nextjs application (different service in the same railway project) to access the the nestjs application using the internal networking. Ive tried setting my env variable in railway for the nextjs application to: \- gridlq \- [http://gridlq ](http://gridlq-)\- <http://gridlq.railway.internal> none of these are working. Do i need to specify port as well? when i set the env variable to the public address, it works fine.
a year ago
Yes, when using internal networks you need to specify the port as well.
The public endpoint works because it is configured with the port already, private endpoint isn't
So it would be something like http://gridlq.railway.internal:3000
a year ago
a year ago
gridlq.railway.internal is not listening on port 3000, it is listening on port 8080.
brody
`gridlq.railway.internal` is not listening on port 3000, it is listening on port 8080.
a year ago
Where am I supposed to see that setting?
My nestjs app defaults to port 3000 if no port is specified in the env file.
const port = process.env.PORT ?? 3000;
await app.listen(port, '::');joselvelez
Where am I supposed to see that setting? My nestjs app defaults to port 3000 if no port is specified in the env file. ```typescript const port = process.env.PORT ?? 3000; await app.listen(port, '::'); ```
a year ago
If you are able to access your nestjs api on public url then check your railway deployment for public endpoint and see if it's listening on port 3000 or 8080. You can do this by going into your nestjs app -> Settings -> Networking, then click the edit button and check what port is being used. If it's other than 3000 then use that port for the internal url
joselvelez
I did that. There is no information on port there. 
a year ago
That's the private networking section. I talked about public networking, you will find the port there
a year ago
Ok, that is confusing because I am trying to use the internal network, not the public. Are you saying that both use the same port and I can reference the public to know what the private one is using?
a year ago
I am assuming you got the port wrong. So if the public endpoint is working then check what port the public endpoint is using then use that for the private endpoint
a year ago
in your nextjs env variable
a year ago
That worked. Thank you! The fix was getting the port from the public networking.
a year ago
just curious, what was it set to, 8080 ?
a year ago
Status changed to Solved uxuz • 11 months ago