502 Bad Gateway when using Zerops Subdomain Access

I am setting up a python project and I want to use Zerops subdomain during development. However, when I access said domain I am met with a 502 Bad Gateway NGINX error.
25 Replies
EdwardD
EdwardDOP2w ago
😨
No description
Aleš
Aleš2w ago
send zerops.yml @Jan Saidl @Matěj Pavlíček maybe release related?
EdwardD
EdwardDOP2w ago
zerops:
- setup: python0
# ==== how to build your application ====
build:
# what technologies should the build
# container be based on (can be an array)

# select which files / folders to deploy
# after the build succesfully finished
# (can be an array of files)
deployFiles: [app.py, templates, static]

# ==== how to run your application ====
run:
# what technology should the runtime
# container be based on, can be extended
# in `run.prepareCommands` using
# `zsc install nodejs@20`

# *optional* install dependencies that your
# runtime service requires, this runs on a
# separate container that prepare the final
# runtime image, so if files source files
# are needed here, they can be passed from
# build using "addToRunPrepare" param
prepareCommands:
- pip install requests flask flask_limiter

# what ports your app listens on
# and whether it supports http traffic
ports:
- port: 3200
httpSupport: true

# how to start your application
start: python3 app.py
zerops:
- setup: python0
# ==== how to build your application ====
build:
# what technologies should the build
# container be based on (can be an array)

# select which files / folders to deploy
# after the build succesfully finished
# (can be an array of files)
deployFiles: [app.py, templates, static]

# ==== how to run your application ====
run:
# what technology should the runtime
# container be based on, can be extended
# in `run.prepareCommands` using
# `zsc install nodejs@20`

# *optional* install dependencies that your
# runtime service requires, this runs on a
# separate container that prepare the final
# runtime image, so if files source files
# are needed here, they can be passed from
# build using "addToRunPrepare" param
prepareCommands:
- pip install requests flask flask_limiter

# what ports your app listens on
# and whether it supports http traffic
ports:
- port: 3200
httpSupport: true

# how to start your application
start: python3 app.py
Jan Saidl
Jan Saidl2w ago
I think there is a problem with installing L7balancer for the LEGACY core 😦
EdwardD
EdwardDOP2w ago
oh, that's unfortunate there is no rush for me setting it up do not worry i am just messing around 🙂
Jan Saidl
Jan Saidl2w ago
I'm working on a fix.
EdwardD
EdwardDOP2w ago
i assume the issue installing something for the legacy core explains the empty box on the services page?
No description
EdwardD
EdwardDOP2w ago
thank you 😃
Aleš
Aleš2w ago
fixed
EdwardD
EdwardDOP2w ago
Thank you
EdwardD
EdwardDOP2w ago
I’m not sure if this is a Zerops thing or me being bad at coding
Aleš
Aleš2w ago
that's still the legacy package right? I just fixed this, I don't think @Jan Saidl fixed that balancer problem yet
No description
EdwardD
EdwardDOP2w ago
There is text there now but yeah not sure if it is fixed yet Again, no rush haha I’m just tinkering at this point
Jan Saidl
Jan Saidl2w ago
Hi, there is a problem, Application is listening only on local interface. 127.0.0.1:3200
No description
EdwardD
EdwardDOP2w ago
Oh that is my bad haha, forgot I was running in development mode Apologies Thank you for your help; it is much appreciated
Jan Saidl
Jan Saidl2w ago
I'm always happy when it's not zerops' fault 😉
EdwardD
EdwardDOP2w ago
I can understand 🤣 Can’t complain either, zerops has been flawless for me since day one mostly Except for a few blips which were solved quickly 🙏
Aleš
Aleš2w ago
it should work even with development mode, you just need to set host somehow to 0.0.0.0
EdwardD
EdwardDOP2w ago
Ah, I’ll look into it tonight Thank you My fault for committing the sin of moving from express to flask 🤣
EdwardD
EdwardDOP2w ago
Thank you for the post
Aleš
Aleš2w ago
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8000, debug=True)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8000, debug=True)
or using envs might work as well
FLASK_RUN_HOST="0.0.0.0"
FLASK_RUN_HOST="0.0.0.0"
EdwardD
EdwardDOP2w ago
Awesome Actually Good point, envs Do I have to set any modules to install during container preparation or does it do that for me?
Aleš
Aleš2w ago
express would have the same problem, it's just that most frameworks use 0.0.0.0 by default
EdwardD
EdwardDOP2w ago
Yeah, makes sense
Want results from more Discord servers?
Add your server