This happens to me sometimes when the space tries to load to a port that isn’t 7860.
Flask will do 5000 unless told to launch on port 7860.
Sometimes need to do docker and nginx.conf to reverse proxy to port 7860.
I see your app.py is
import os
exec(os.environ.get('APP'))
Check which port it’s aiming at if you haven’t debugged this part yet.
so, I guess 7860 applies to Gradio and Docker SDK space
port 8501 for Streamlit space
Only port 8501 is allowed for Streamlit Spaces (default port). As a result if you provide a `config.toml` file for your Space make sure the default port is not overridden.