I am trying to host a Flask Application in Catalyst using AppSail, I created the Flask Application and tested it in local using the command catalyst serve
, the application works fine.
After I deployed the application using catalyst deploy
when I try to access the AppSail URL I am getting the below response
{
"status": "failure",
"data": {
"message": "Internal server error has occurred. Please try again after some time",
"error_code": "INTERNAL_SERVER_ERROR"
}
}
I tried accessing the logs which I added below, but there is no error specified there. Can someone help me resolve this issue?
From the Logs screenshot, your AppSail application seems to be running at the IP address "127.0.0.1" which is inaccessible from remote environment. You can try adding the host address as "0.0.0.0" using the below code snippet in your Flask App which should resolve the "Internal Server Error" issue.
if __name__ == '__main__':
port = int(os.environ.get('X_ZOHO_CATALYST_LISTEN_PORT', 9000))
app.run(host="0.0.0.0",port=port)
You can find the official help documentation for hosting Flask App using AppSail here.