Error in the title triggers sometimes when using celery with more than one worker on a postgresql db with SSL turned on. I'm in a flask + SQLAlchemy configuration
As mentionned here : https://github.com/celery/celery/issues/634 the solution in the django-celery plugin was to simply dispose all db connection at the start of the task.
In flask + SQLAlchemy configuration, doing this worked for me :
from celery.signals import task_prerun
@task_prerun.connect
def on_task_init(*args, **kwargs):
engine.dispose()
in case you don't know what "engine" is and how to get it, see here : http://flask.pocoo.org/docs/patterns/sqlalchemy/
来源:https://stackoverflow.com/questions/15410248/celery-sqlalchemy-databaseerror-databaseerror-ssl-error-decryption-faile