#987653 radicale: Fails when using WSGI due to python3.8 changes

Package:
src:radicale
Source:
radicale
Submitter:
Guillem Jover
Date:
2024-10-24 18:03:07 UTC
Severity:
important
Tags:
#987653#5
Date:
2021-04-27 01:26:49 UTC
From:
To:
[ Not setting as serious, even though it might be, because I don't
  think this is a setup directly supported by Debian? Even though
  upstream seems to. ]

Hi!

Just upgraded my server to bullseye, and one of the errors was with
radicale, which I've got setup using libapache2-mod-wsgi-py3. This
fails now due to some python changes in 3.8. The error was stuff like:

  ,---
  […] [ERROR] An exception occurred during PUT request on '….vcf': preexec_fn not supported within subinterpreters
  `---

The problem stems from:

  <https://bugs.python.org/issue34651>

which caused this:

  <https://bugs.python.org/issue37951>

but that is deemed expected, and it needs to be fixed in the callers.
Such as was done in FreeIPA:

  <https://github.com/freeipa/freeipa/pull/3769/commits/7ee24413f0945b7d582a33795cdfc7c59471cb69>

To ameliorate the situation the following got implemented in 3.9,
which we have in bullseye:

  <https://bugs.python.org/issue36046>


In radicale the problem can be found in:

  /usr/lib/python3/dist-packages/radicale/storage/multifilesystem/lock.py

As a workaround, once I commented the conditionals around the preeexec_fn
assignment the daemon stopped failing. I guess a proper fix might be to
use the new user, group and extra_groups parameters to Popen. Or to
avoid setting preexec_fn if there's no need to switch user and groups.

Thanks,
Guillem