question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Postgres SSL error: decryption failed or bad record mac

See original GitHub issue

There is an error running Wooey on a Postgres database backend (and using the same backend for celery):

[2015-08-12 13:19:33,616: ERROR/MainProcess] Unrecoverable error: OperationalError('SSL error: decryption failed or bad record mac\n',)
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
psycopg2.OperationalError: SSL error: decryption failed or bad record mac

This SO post mentions the error with another library and the solution suggests opening the DB connection within the job.The Heroku Postgres documentation makes it a bit clearer:

The Postgres connection is shared between more than one process or thread. Typical offenders are Resque workers or Unicorn. Be sure to correctly establish the PG connection after the fork or thread has initialized to resolve this issue.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
revmischacommented, Mar 14, 2017

I’m experiencing this too, inside of Flask

0reactions
pietropinocommented, Feb 23, 2021

I had the same problem with Flask + uSWGI + psycopg2. I solved it by inserting the line:

lazy-apps = true

in the file uswgi.ini.

See also: here, here and here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

decryption failed or bad record mac in multiprocessing
I am trying to get all the PC cores to work simultaneously while filling a PostgreSQL database, I have edited the ...
Read more >
(psycopg2.OperationalError) SSL error: decryption failed or ...
I kept seeing this error message with a uwsgi/Flask/SQLAlchemy ... OperationalError) SSL error: decryption failed or bad record mac.
Read more >
SSL error: decryption failed or bad mac - PostgreSQL
Hello,. Using PostgreSQL 9.6.7 on x86_64-pc-linux-gnu. OS is a Debian 4.9.82-1+deb9u3 (2018-03-02), libpq5 (9.6.7), openssl stable 1.1.0f.
Read more >
SSL error: decryption failed or bad record mac (pg as Samba ...
Hi, I'm trying to use an SSL-enabled (OpenSSL 0.9.7d) Postgres 7.3.9 as database backend to Samba 3.0.11. On startup Samba opens a connection,...
Read more >
SSL error: decryption failed or bad record mac - Odoo
SSL error : decryption failed or bad record mac ... Thanks for your subscription! ... Hi there! I'm facing a problem with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found