uWSGI, Flask, sqlalchemy, and postgres: SSL error: decryption failed or bad record mac

前端 未结 2 1934
灰色年华
灰色年华 2020-11-28 22:30

I\'m trying to setup an application webserver using uWSGI + Nginx, which runs a Flask application using SQLAlchemy to communicate to a Postgres database.

When I make

2条回答
  •  一生所求
    2020-11-28 23:10

    As an alternative you might dispose the engine. This is how I solved the problem.

    Such issues may happen if there is a query during the creation of the app, that is, in the module that creates the app itself. If that states, the engine allocates a pool of connections and then uwsgi forks.

    By invoking 'engine.dispose()', the connection pool itself is closed and new connections will come up as soon as someone starts making queries again. So if you do that at the end of the module where you create your app, new connections will be created after the UWSGI fork.

提交回复
热议问题