Getting this error when trying to deploy
error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on https://ask.replit.com/c/help/13 and a staff member will take a look.
@QwertyQwerty88 Still looking into this. It seems to be an issue with the modules (perhaps stemming from an older template). I tried migrating it to Nix but that didn’t resolve it. We think the psycopg2 module might be one of the culprits that isn’t being installed on the deployment for some reason.
I wanted to give you a progress update in case you wanted to do a bit of troubleshooting for yourself while the team looks into it further. I’ll let you know what we find out.
We’re also investigating the lack of logs which I’ve seen for a few “failed to promote” deployments now. We should almost always have logs for these situations.
@QwertyQwerty88 I’ve invited you to a Repl that deploys, but with some disclaimers.
We converted it to Nix and added an env section in the .replit. It’s pretty ugly. Honestly, it might even be better to start a new Python Repl from scratch and just copy the code over rather than address the old template issues.
After doing that, there was a remaining error (which will show in the logs once we get that fix pushed out this week):
Traceback (most recent call last):
RuntimeError: The Werkzeug web server is not designed to run in production. Pass allow_unsafe_werkzeug=True to the run() method to disable this error.
Basically, Werkzeug is not designed for a production environment, and the typical way to circumvent it would be to deploy the application using a dedicated WSGI server like gunicorn or similar. For now, I am passing the unsafe flag just to confirm it deploys successfully, but it’s not recommended and you’ll probably want to update it.