Thread: omnidb-server: fix for bug 1053100

omnidb-server: fix for bug 1053100

From
Bradford Boyle
Date:
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

Re: omnidb-server: fix for bug 1053100

From
Christoph Berg
Date:
Re: Bradford Boyle
> 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.

Hi Bradford,

thanks for the debugging! I have not had any time to spend on OmniDB,
so this is most welcome.

> 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?

I spoke to some of the 2ndQuandrant, err, EDB people at pgconf.eu last
year and they confirmed OmniDB is practically dead. Which is a pity,
because I had picked that as a pgadmin4 replacement :(.

If your patch fixes the problem, we should apply it. Hopefully that
will make OmniDB work at least for now, perhaps even for trixie. But
after that, I have little hope, and we shouldn't put too much more
(non-trivial) effort into it since the horse seems to be dead :(.

Christoph



Re: omnidb-server: fix for bug 1053100

From
Bradford Boyle
Date:
Hi Christoph,

I've pushed two fixes for omnidb to Salsa:

1. A fix for 1053100
2. Replacing a deprecated Django API to get the package working with
   Debian trixie

I've triggered a snapshot build on pgdgbuild and manually tested the
artifacts on both bookworm and trixie. I'd like to request a review and
upload, as cycles permit.

Let me know if anything needs changes.

-- Bradford


[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053100



Re: omnidb-server: fix for bug 1053100

From
Christoph Berg
Date:
Re: Bradford Boyle
> I've pushed two fixes for omnidb to Salsa:
> 
> 1. A fix for 1053100
> 2. Replacing a deprecated Django API to get the package working with
>    Debian trixie

Hi Bradford,

thanks!

I've been dabbling with django for some other hobby projects and had
seen some warnings around the url() functions, but not checked out any
details. That will be useful there too.

> I've triggered a snapshot build on pgdgbuild and manually tested the
> artifacts on both bookworm and trixie. I'd like to request a review and
> upload, as cycles permit.

Perfect, as always! Uploading shortly.

Christoph