django.db.utils.ProgrammingError: invalid dsn: invalid connection option "gssencmode"
search cancel

django.db.utils.ProgrammingError: invalid dsn: invalid connection option "gssencmode"

book

Article ID: 374719

calendar_today

Updated On:

Products

VMware Tanzu Data Suite

Issue/Introduction

Connecting postgres with gssencmode parameter resulting into below error:



"/var/tmp/myenv/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection

    connection = Database.connect(**conn_params)

  File "/var/tmp/myenv/lib/python3.7/site-packages/psycopg2/__init__.py", line 130, in connect

    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)

django.db.utils.OperationalError: FATAL:  no pg_hba.conf entry for host "xx.xx.xx.xx", user "choudrup", database "test_restore", no encryption
dsn = _ext.make_dsn(dsn, **kwargs)

  File "/var/tmp/myenv/lib/python3.7/site-packages/psycopg2/extensions.py", line 177, in make_dsn

    parse_dsn(dsn)

django.db.utils.ProgrammingError: invalid dsn: invalid connection option "gssencmode"

Environment

Vmware Tanzu Postgres 15.4.0

Cause

Binaries for psycopg2 are not built with gssencmode parameter.

Resolution

Customer installed the compatible binary for psycopg2 i,e.   ms.version.addpkg("psycopg2-binary", "2.9.5")