omnidb-server: fix for bug 1053100

From: Bradford Boyle <bradford(dot)d(dot)boyle(at)gmail(dot)com>
To: pgsql-pkg-debian(at)lists(dot)postgresql(dot)org
Subject: omnidb-server: fix for bug 1053100
Date: 2024-06-20 06:50:08
Message-ID: CAOMoQbTE3MUJHZh3HkbwkkGbeEBy37AMAQwZUPr7atvmMZyXMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-debian

Hi All,

I have been looking at Debian bug 1053100 (omnidb-server crashes when
creating a new PostgreSQL connection) [1] and I have identified that
this is caused by a change in one of OmniDB's Python dependencies.

OmniDB configures Django's session serialization format to use Python's
`pickle` module instead of the default JSON-based serialization. The
class `Session` has a field `v_databases` that is a dictionary tha
contains references to objects holding information for the various
connections the user has configured. When a connection to a PostgreSQL
database is configured, the `Session` object ends up transitively
referencing an instance of `PGSpecial` from provided by the Python
package `pgspecial`. A recent change in `pgspecial` means that
`PGSpecial` objects are no longer serializable with Python's `pickle`
module.

Reviewing OmniDB's use of `PGSpecial` within its `PostgreSQL` class, it
appears to be a "stateless" in that it does not use the `PGSpecial`
object in any way that would cause its fields to be change value from
when it was constructed. Based on this observation, an approach to
fixing the reported bug is to patch OmniDB's `PostgreSQL` class to omit
`PGSpecial` during serialization and to recreate it during
deserialization. I have a attached a patch that will do this. In my
limited local testing, this fixes the bug. If there are no concerns with
the proposed patch, I can update the package on s.d.o.

It looks like Django 5.x has deprecated `PickleSerializer` [2] so its
unlikely that OmniDB will continue working going forward. At the moment,
Debian testing still provides Django 4.2 but I do not know if the Debian
Python team has plans to update to the newer major version. Independent
of the Django major version incompatibility, it looks like the upstream
repo for OmniDB has gone inactive and the project is unmaintained [3].
Does it make sense to continue publishing packages of OmniDB for newer
releases of Debian and Ubuntu?

-- Bradford

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053100
[2]: https://github.com/django/django/pull/15139
[3]: https://github.com/OmniDB/OmniDB

Attachment Content-Type Size
0001-Customize-PostgreSQL-class-pickle-serialization.patch application/octet-stream 1.8 KB

Responses

Browse pgsql-pkg-debian by date

  From Date Subject
Next Message Christoph Berg 2024-06-20 09:26:08 Re: omnidb-server: fix for bug 1053100
Previous Message Bradford Boyle 2024-06-15 03:30:01 pgvector 0.7.2 - New upstream version