R
Railwayβ€’11mo ago
11

503 Service Unavailable

I deployed application using python flask server in Railway and I am getting this error. here's my port & host configuration
app.run(port=os.getenv("PORT", default=5000),debug=True,host='0.0.0.0')
app.run(port=os.getenv("PORT", default=5000),debug=True,host='0.0.0.0')
, here's the github repo https://github.com/sbkobaidze/rembg
25 Replies
Percy
Percyβ€’11mo ago
Project ID: d3791078-e8bf-46f2-8fa6-89c72d45a462
11
11OPβ€’11mo ago
d3791078-e8bf-46f2-8fa6-89c72d45a462
Brody
Brodyβ€’11mo ago
are you able to make the repo public?
11
11OPβ€’11mo ago
Yes wait a sec Its public now
Brody
Brodyβ€’11mo ago
add this as a railway.json file to your project
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"deploy": {
"startCommand": "gunicorn server:app"
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"deploy": {
"startCommand": "gunicorn server:app"
}
}
11
11OPβ€’11mo ago
Okay thanks ,just pushed I deployed 1 project also, with same configuration and works properly without this json file Is it necessary or in what situations is it required
Brody
Brodyβ€’11mo ago
then you are likely using a development server, that will cost much more, you always want to run flask with gunicorn as shown above
11
11OPβ€’11mo ago
Okay thank you, so
"startCommand": "gunicorn server:app"

"startCommand": "gunicorn server:app"

here server means the filename of the server right
Brody
Brodyβ€’11mo ago
yeah server.py and app is from app = Flask(__name__) in the server.py
11
11OPβ€’11mo ago
ok thanks
11
11OPβ€’11mo ago
@Brody Sadly I am getting the same error
No description
11
11OPβ€’11mo ago
No description
11
11OPβ€’11mo ago
This should be working,
Brody
Brodyβ€’11mo ago
you need to open the deployment
11
11OPβ€’11mo ago
11
11OPβ€’11mo ago
No description
11
11OPβ€’11mo ago
rembg package is 176mb , and I am on free plan but it says that disk space is 1gb
Brody
Brodyβ€’11mo ago
show me your memory metrics please
11
11OPβ€’11mo ago
No description
Brody
Brodyβ€’11mo ago
yeah you are trying to use more memory than your plan allows for, 512mb. you would need to upgrade to hobby
11
11OPβ€’11mo ago
Okay thanks, that's what I was thinking from the start πŸ˜„
Brody
Brodyβ€’11mo ago
it is both running a development server and running out of memory
11
11OPβ€’11mo ago
Okay thanks again, you are super helpful
Brody
Brodyβ€’11mo ago
no problem πŸ™‚
Want results from more Discord servers?
Add your server