Why did this error occur? The app itself works, but it's annoying me
As usual, I deployed my bot and here it is
28 Replies
Project ID:
N/A
You might find these helpful:
- two instances
- My bot's Dashboard
- My bot is running but there is no service!
⚠️ experimental feature
N/A
Set an environment variable called PORT to 8080 and ensure that the same value is being set in your app
Your app should either be hardcoding that value or pulling it from the environment variables
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Just noticed you asked why, might as well give an explanation.
Railway expects a port to be exposed, but your app is exposing a different port. To fix this, you have to ensure that your app is exposing the port that Railway expects.
You can set the port that Railway expects by setting the PORT environment variable to a 4 digit number (usually 3000, 8000, 8080).
Once you've done that, set the port that your app is exposed on. This is usually done through a PORT variable in your code. You can set it to copy from the environment variable (recommended) or hardcode it.
It's just that I don't use anything that requires a port.
Yes you do, all webapps require a port
Even discord bots
Well, I say this to the fact that I have nowhere to use port 8080 in my code
Please send your code, I'll take a look
Also, you're trying to access the URL of your bot. Is your bot prepared to take those requests? Most discord bots aren't
I think maybe because of this
That's your database connection, that won't cause the issue
I don't have anything like that anymore.
Then why did you send that part of your code?
Please send your repo. You would have defined port somewhere in your code
I thought she was the problem
GitHub
GitHub - x4zx/GiveawayBot
Contribute to x4zx/GiveawayBot development by creating an account on GitHub.
First off, delete the procfile, you don’t need that on Railway
How do you run the main file then?
build and start commands, Railway auto detects what it thinks should be run or you can override it in the settings
or a dockerfile, or a nixpacks.toml
Understood
I’m completely unfamiliar with pymongo and disnake, but I’m not seeing any code built to handle requests. What do you expect to see what you access your bot’s url?
What is a bot URL? It's just the first time I've heard of this
I mean the URL on Railway. What you’re accessing when you see the Application error you originally posted about
I did nothing, the site itself gave this error after the deployment
what I’m saying is that I don’t think your app is creating a site
what do you expect when you go to the site?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
that’s what I’m trying to get at, was just making sure that they’re not expecting that domain to actually display any content
Exactly, this domain was. I removed it