[Python-modules-team] Bug#960499: python3-psycopg2: fails with "psycopg2.OperationalError: insufficient data in "T" message"

Karsten Hilbert karsten.hilbert at gmx.net
Wed May 13 11:44:11 BST 2020


Package: python3-psycopg2
Version: 2.7.7-1
Severity: important

Dear Maintainers,

users report the following exception:

Traceback (most recent call last):
  File "/usr/share/gnumed/Gnumed/wxpython/gmGuiMain.py", line 3457, in OnInit
    if not self.__verify_praxis_branch():
  File "/usr/share/gnumed/Gnumed/wxpython/gmGuiMain.py", line 3687, in __verify_praxis_branch
    banner = praxis.db_logon_banner
  File "/usr/share/gnumed/Gnumed/business/gmPraxis.py", line 500, in _get_db_logon_banner
    rows, idx = gmPG2.run_ro_queries(queries = [{'cmd': 'select _(message) from cfg.db_logon_banner'}])
  File "/usr/share/gnumed/Gnumed/pycommon/gmPG2.py", line 1547, in run_ro_queries
    curs.execute(query['cmd'], args)
  File "/usr/lib/python3/dist-packages/psycopg2/extras.py", line 142, in execute
    return super(DictCursor, self).execute(query, vars)
psycopg2.OperationalError: insufficient data in "T" message

which looks like a problem at the Python3/C boundary of psycopg2 or even
in the C part of psycopg2 below Python itself  (or even libpq ? - unlikely).

This happens on the following system:

	Platform: uname_result(system='Linux', node='X1slapper', release='5.4.0-29-generic', version='#33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020', machine='x86_64', processor='x86_64')
	Python 3.8.2 (default, Apr 27 2020, 15:53:34) <\n>[GCC 9.3.0] on linux (posix)
	lsb_release: {'ID': 'Ubuntu', 'DESCRIPTION': 'Ubuntu 20.04 LTS', 'RELEASE': '20.04', 'CODENAME': 'focal'}
	threading: sys.thread_info(name='pthread', lock='semaphore', version='NPTL 2.31')

	psycopg2 module version: 2.8.4 (dt dec pq3 ext lo64)
	PostgreSQL via DB-APImodule "<module 'psycopg2' from '/usr/lib/python3/dist-packages/psycopg2/__init__.py'>": API level 2.0, thread safety 2, parameter style "pyformat"
	libpq version (compiled in): 120002
	libpq version (loaded now) : 120002

The failing query is rather simple (and probably immaterial):

	select _(message) from cfg.db_logon_banner

where _() is a plpgsql function providing a translation lookup.

The very same code works just fine on Python 3.7 / psycopg2 2.7.

Any ideas where else to look ?

Karsten


-- System Information:
Debian Release: 10.4
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable-debug'), (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 5.6.0-trunk-686-pae (SMP w/2 CPU cores)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-psycopg2 depends on:
ii  libc6    2.28-10
ii  libpq5   11.7-0+deb10u1
ii  python3  3.7.3-1

python3-psycopg2 recommends no packages.

Versions of packages python3-psycopg2 suggests:
ii  python-psycopg2-doc  2.7.7-1

-- no debconf information



More information about the Python-modules-team mailing list