a year ago
I'm trying to deploy a contact us service on my site but I cant get SMTP to work. or at least I think thats the problem. I have no ability to see any useful logs. only thing I see are useless http logs.
158 Replies
a year ago
for SMTP to work you'd need to specify specific ports on Railway metal's proxy which you can't do yet, and even if you could odds are other people would've taken those ports by now
So unfortunately, SMTP servers can't be hosted on Railway
a year ago
not yet anyway, maybe once Railway added custom IPs and the ability to specify a port on TCP
a year ago
yes we do, there is no restrictions on outbound traffic
a year ago
logs for what
console for example or node server/js logs. there is literally nothing in the "logs" feature besides a few 200 http entries
a year ago
click the deploy logs button
a year ago
a year ago
screenshot please
GET/, POST/ etc. not really helpful. I'm trying to see why email isnt working, despite setting all the variables and code.
this is all there is
HTTP 3/21/2025 12:20:39 AM 100.64.0.4 GET /manifest.json
HTTP 3/21/2025 12:20:39 AM 100.64.0.4 Returned 304 in 1 ms
HTTP 3/21/2025 12:20:39 AM 100.64.0.3 GET /logo192.png
HTTP 3/21/2025 12:20:39 AM 100.64.0.3 Returned 304 in 2 ms
HTTP 3/21/2025 12:20:42 AM 100.64.0.3 POST /api/request-access
HTTP 3/21/2025 12:20:42 AM 100.64.0.3 Returned 200 in 1 ms
a year ago
screenshot please
a year ago
thats what your app is printing
everything I'm doing (with email functions) is working when I test locally. as soon as I deploy to railway, nothing works, despite 200 messages, but I cant see why
a year ago
those are console logs
a year ago
that is what is being console logged
none of this shows up
/ In my request-access.js
router.post('/', async (req, res) => {
consoleAlert('EMAIL REQUEST RECEIVED');
console.log('Request body:', req.body);
try {
const { email } = req.body;
console.log(Received request for email: ${email});
// Email sending logic...
const result = await sendEmail(email);
console.log('Email sending result:', result);
// Success response
console.log('==== EMAIL PROCESS COMPLETED SUCCESSFULLY ====');
return res.json({ success: true });} catch (error) {
console.log('Error sending email:', error.message);
return res.status(500).json({ error: 'Failed to send email' });
}
});
a year ago
then there is something wrong with your code, unfortunately we wouldn't be able to offer coding assistance here
a year ago
How it Works
Any build or deployment logs emitted to standard output or standard error ( eg. console.log(…)) are captured by Railway to be viewed or searched later.
i have console.log all over my files. shows up fine locally. but not in railway. maybe more than 1 sentence for "how it works" would be helpful.
a year ago
its as simple as that, you console.log and you will be able to see it in the deploy logs, if you arent theres something wrong with your code, not the platform
I followed your extensive documentation to make it work and its not. and your response is, its my problem. we dont know how railway works under the hood. you do
a year ago
I'm sorry but this issue isn't related to the railway platform
maybe provide better docs? examples? possible things that cause problems? there is a reason why mine isnt working and I have no idea hwo to make it work on your platform. like I said, it works perfectly fine locally. I cant debug something that works on my end.
a year ago
console.log("message"); would be the example, I'm sorry but that's really all there is to it
a year ago
if you aren't seeing the logs you could be looking at the wrong service
console.log('==== EMAIL PROCESS COMPLETED SUCCESSFULLY ===='); all there is to it
a year ago
I'm sorry you're facing difficulties with your code, but we are only able to offer support for the Railway platform here
a year ago
we have extensive monitoring for our entire logging infrastructure and it's all green
I'm asking for support for this platform and the only response I'm getting is my code sucks
I have a mountain of console logs when I run this on localhost. when I deploy to railway, there is nothing
a year ago
at this point all aspects of that platform are operating correctly and without issues.
a year ago
Yep and I am confidently saying there are no issues on our side at this moment
I'm not even saying there is an "issue" with railway. I'm clearly coding exactly how your 1 line of documentation is suggesting, and its not working. its working fine on my end. but to you, its just one big mystery
a year ago
maybe start from the basics? a JavaScript file with only a console log
you mean like this?
node test-smtp-connection.js
!!!!! SMTP CONFIGURATION !!!!!
Host: smtp.hostinger.com
Port: 465
Secure: true
User: noreply@spendspace.io
Pass:
!!!!! STARTING SMTP TESTS !!!!!
Network Interfaces:
- Wi-Fi: 192.168.1.89
!!!!! TESTING TCP CONNECTION !!!!!
Attempting to connect to smtp.hostinger.com:465…
TCP connection successful!
!!!!! TESTING TLS CONNECTION !!!!!
Attempting TLS connection to smtp.hostinger.com:465…
TLS connection authorized!
TLS Protocol: TLSv1.3
Cipher: TLSAES256GCMSHA384
!!!!! TESTING SMTP AUTHENTICATION !!!!!
Verifying SMTP connection…
SMTP Verification Result: true
a year ago
I'm sorry but I'm not sure the relevance of that to what I just said
a year ago
I'm going to have to step back here and let the community involve themselves with this thread and they can offer you coding assistance if they so choose
so you have no idea why those console logs show up locally but not in railway? they are all literally console.log()
// Get network information
try {
const { networkInterfaces } = require('os');
const nets = networkInterfaces();
console.log('Network Interfaces:');
for (const name of Object.keys(nets)) {
for (const net of nets[name]) {
if (net.family === 'IPv4' && !net.internal) {
console.log(- ${name}: ${net.address});
}
}
and this looks like node (I assume you're using it) is getting fucky because of whatever reason
yes node. not sure how to "flush the buffer", but its something to figure out and try. thank you
you can try to just log a ton of nonsense to overwrite that 4KB buffer… but again, it seems like the app actually prints those http requests just fine
@ChicagoPhotoShop stop shitting on other people. This is a skill issue on your part and the Railway team have better things to do then help people troubleshoot someone elses code problems…
@Ayush I'm not shitting on other people. this is a support forum, I'm seeking support. I'm not the only one having this issue. railway has nearly zero documentation and the only support provided is "write better code". go back to what rock you came out from
@ChicagoPhotoShop - "I'm sorry you're facing difficulties with your code, but we are only able to offer support for the Railway platform here"
I get it, you must be frustrated with your vibe coding issue, but being rude isnt the right way to go about it.
you tell me to stop shitting on people, and they you come here shitting on me. seriously, go smell some grass
Relax bud, you just need some accountability. All of a sudden, when someone calls you out, then you get defensive and start throwing insults. No one's stopping you from venting, but if you're looking for help, maybe drop the attitude and focus on the issue at hand.
im calling you out for being rude and shitting on the railway team even though its not their responsibility?
happy to focus on the issue at hand. what is it that you are doing exactly? seriously, go somewhere else
you are calling me out for being rude while being rude yourself. pot meet kettle. go away already christ
You came in here whining, got called out for being rude, and now you're deflecting instead of owning up to it. If you actually want help, act like someone people would want to help. Anyways, I'm done here, good luck 😂
i do not get console.log() on railway, thats correct. but it doesnt seem like its supported here so I'm moving on. I can see all the logs I need when working locally.
i'm not an english native, so if you don't understand something I say, let me know to paraphrase myself
I made a repo in python, but you can easily translate it to js since it's just a oneline change
when you deploy from docker, it doesn't flush your strings in railway. In a few words, your content is waiting in a buffer before being served
what else can make the trick? Adding a jump in your printed or consoleloged text: \n
I'm testing and it works. But doesn't seem to work with the char \n in my case and it waits till the next flushed print
well. Adding flush to every print fixes the issue for me and now I got the logs in the correct order

before this, just the error logs were printed. So if you change console.log to console.error, it should work as well
I don't have experience with node, but I had the same issue in python and I solved it in this way. Maybe it's a docker thing, so you could try to run without it or use console.error instead
this is great, thank you @patod01 what does your railway logs panel look like?
if those came from the framework, that may be the reason. I use bottle in python, and the logs in debbug mode were made through other way but print and I have zero lines of code to print the http response codes, so my normal prints didn't work while the logs from bottle did
no idea of why that gets printed. Maybe is for the strings being made by a back tilde (`) instead of " or '?
I googled it and I came to the idea of maybe there's an environment var for node that works the same as the case described in the picture for python

in case this helps, here is the repo https://gitlab.com/patod01/test-docker. It also has an image you can pull and test from [registry.gitlab.com/patod01/test-docker](registry.gitlab.com/patod01/test-docker)
a year ago
there is nothing wrong with buffers or anything like that.
They have a Dockerfile with this -
CMD ["sh", "-c", "serve -s build -l ${PORT}"]fwiw they aren't setting a start command elsewhere, serve is the only program being ran.
a year ago
yep annoyed since the blame was placed onto the platform
a year ago
alright, y'all got this now, peace
@Brody blame wasnt on "the platform". I was asking for help and only response was write better code.
in brody's defense, he was right. He should't help in code cases 'cause it may be to hard to point out where the problem could be in the code
I understand. but not everyone is a pro, and there is no where else to go for support. never was I "blaming" railway. simply asking how it works. something like, "maybe something wrong with docker build" would have helped alot
in any case, idk if this is pro league if we are dealing with bufffered stuff and docker files. I understand that railway is meant for business, so you need some pro background. Not 100%, but something at the end of the day
What's inside the start.sh
what matters now is that you have plenty material to keep your research! and we know that you have everything to make it work 😄
this is my cmd in the docker file CMD source ../.venv/bin/activate && python [rock.py](rock.py) $MODE $PORT
I apologize @Brody for letting frustration get the best of me. been a long week.
a year ago
!s
Status changed to Solved brody • 11 months ago









