a month ago
i am trying to deploying bot but its start and crash immidately and name or service not known error showing 11 times in logs section please give me some advice
1 Replies
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 1 month ago
a month ago
That error usually means the bot is trying to connect to a hostname that cannot be resolved.
I’d check your environment variables first, especially anything containing a hostname or URL, such as:
DATABASE_URL- Redis host/URL
- API endpoints
- Webhook URLs
- Any custom
HOSTvariable
Make sure there are no typos, missing domains, extra spaces, or variables that are empty in Railway.
If your bot connects to another Railway service, also verify that you’re using the correct Railway internal/private hostname and that the target service is actually running.
The fact that "Name or service not known" appears 11 times probably means the application is retrying the same failed connection several times before crashing.
If possible, look at the first occurrence of that error in the logs. Usually the lines immediately above it reveal exactly which connection is failing.
You can also test the suspected hostname from the deployment with:
getent hosts YOUR_HOSTNAMEor:
nslookup YOUR_HOSTNAMEIf that fails, you’ve found the DNS/hostname issue.
If you can share the first 20–30 lines around the first "Name or service not known" error (with passwords/tokens removed), it should be possible to identify exactly which service or hostname is causing the crash.