[Pkg-mailman-hackers] Bug#1119862: mailman3-web: Hourly cronjob fails on "TypeError: ord() expected a character, but string of length 0 found"
Olivier Berger
olivier.berger at telecom-sudparis.eu
Sat Nov 1 14:24:44 GMT 2025
Package: mailman3-web
Version: 0+20200530-2.1
Severity: normal
Dear Maintainer,
The hourly Mailman/HyperKitty cronjob suddenly started complaining with the following error:
[ERROR/MainProcess] Failed indexing 1 - 1000 (retry 5/5): ord() expected a character, but string of length 0 found (pid 1719490): ord() expected a character, but string of length 0 found
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/haystack/management/commands/update_index.py", line 119, in do_update
backend.update(index, current_qs, commit=commit)
File "/usr/lib/python3/dist-packages/haystack/backends/whoosh_backend.py", line 251, in update
self.setup()
File "/usr/lib/python3/dist-packages/haystack/backends/whoosh_backend.py", line 162, in setup
self.index = self.storage.open_index(schema=self.schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/whoosh/filedb/filestore.py", line 176, in open_index
return indexclass(self, schema=schema, indexname=indexname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/whoosh/index.py", line 421, in __init__
TOC.read(self.storage, self.indexname, schema=self._schema)
File "/usr/lib/python3/dist-packages/whoosh/index.py", line 632, in read
check_size("int", _INT_SIZE)
File "/usr/lib/python3/dist-packages/whoosh/index.py", line 626, in check_size
sz = stream.read_varint()
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/whoosh/filedb/structfile.py", line 191, in read_varint
return read_varint(self.read)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/whoosh/util/varints.py", line 102, in read_varint
b = ord(readfn(1))
^^^^^^^^^^^^^^
TypeError: ord() expected a character, but string of length 0 found
It seems related to the hyperkitty update_index job:
# sudo -u www-data flock -n /var/run/mailman3-web/cron.hourly /usr/share/mailman3-web/manage.py runjob -v 3 hyperkitty update_index
Executing job: update_index (app: hyperkitty)
[ERROR/MainProcess] Failed indexing 1 - 1000 (retry 5/5): ord() expected a character, but string of length 0 found (pid 76363): ord() expected a character, but string of length 0 found
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/haystack/management/commands/update_index.py", line 119, in do_update
backend.update(index, current_qs, commit=commit)
File "/usr/lib/python3/dist-packages/haystack/backends/whoosh_backend.py", line 251, in update
self.setup()
File "/usr/lib/python3/dist-packages/haystack/backends/whoosh_backend.py", line 162, in setup
self.index = self.storage.open_index(schema=self.schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/whoosh/filedb/filestore.py", line 176, in open_index
return indexclass(self, schema=schema, indexname=indexname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/whoosh/index.py", line 421, in __init__
TOC.read(self.storage, self.indexname, schema=self._schema)
File "/usr/lib/python3/dist-packages/whoosh/index.py", line 632, in read
check_size("int", _INT_SIZE)
File "/usr/lib/python3/dist-packages/whoosh/index.py", line 626, in check_size
sz = stream.read_varint()
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/whoosh/filedb/structfile.py", line 191, in read_varint
return read_varint(self.read)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/whoosh/util/varints.py", line 102, in read_varint
b = ord(readfn(1))
^^^^^^^^^^^^^^
TypeError: ord() expected a character, but string of length 0 found
For what it's worth:
# ls -alrt /var/lib/mailman3/web/fulltext_index/
total 38172
drwxr-x--- 4 www-data www-data 4096 Apr 29 2022 ..
-rwxr-xr-x 1 www-data www-data 0 Jun 27 2022 MAIN_WRITELOCK
-rw-r--r-- 1 www-data www-data 16591594 Jun 13 2024 MAIN_1smnux9bu3repr2y.seg
-rw-r--r-- 1 www-data www-data 4345605 Nov 4 2024 MAIN_eda6ca7vo8esrqhn.seg
-rw-r--r-- 1 www-data www-data 4462238 Feb 18 2025 MAIN_wilyh4t6iyhh5gro.seg
-rw-r--r-- 1 www-data www-data 4196252 Jun 2 11:00 MAIN_hxw1120tj1a8zer1.seg
-rw-r--r-- 1 www-data www-data 4828226 Sep 16 00:01 MAIN_2shsbjv7oxh73n5v.seg
-rw-r--r-- 1 www-data www-data 1671473 Oct 6 21:00 MAIN_pghaxc3qdw6itwzq.seg
-rw-r--r-- 1 www-data www-data 1782145 Oct 7 07:00 MAIN_vnja90uqqvj96ue0.seg
-rw-r--r-- 1 www-data www-data 997286 Oct 8 19:00 MAIN_9simie67w00tc8qf.seg
-rw-r--r-- 1 www-data www-data 83383 Oct 8 20:00 MAIN_8run27x3kem6htr5.seg
-rw-r--r-- 1 www-data www-data 83372 Oct 8 21:00 MAIN_86d7swyljccyzynn.seg
-rw-r--r-- 1 www-data www-data 0 Oct 8 22:00 MAIN_g28zhqqjyp6n2o2y.seg
-rw-r--r-- 1 www-data www-data 0 Oct 8 22:00 _MAIN_28782.toc
drwxr-xr-x 2 www-data www-data 4096 Oct 8 22:00 .
Trying clear_index then rebuild_index didn't work, so I managed to workaround by removing that /var/lib/mailman3/web/fulltext_index/ directory, and tried a rebuild:
# sudo -u www-data flock -n /var/run/mailman3-web/cron.hourly /usr/share/mailman3-web/manage.py rebuild_index
WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'.
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
All documents removed.
Indexing 1950 emails
Hope this helps,
Best regards,
-- System Information:
Debian Release: forky/sid
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'testing'), (500, 'stable'), (100, 'bullseye-fasttrack'), (100, 'bullseye-backports-staging')
Architecture: amd64 (x86_64)
Kernel: Linux 6.16.12+deb14+1-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages mailman3-web depends on:
pn dbconfig-sqlite3 | dbconfig-pgsql | dbconfig-mysql | dbconfig-no- <none>
thanks
ii debconf [debconf-2.0] 1.5.91
ii init-system-helpers 1.69
ii python3 3.13.7-1
pn python3-django-hyperkitty <none>
pn python3-django-postorius <none>
pn python3-psycopg2 | python3-mysqldb <none>
pn python3-whoosh <none>
ii ucf 3.0052
pn uwsgi-core <none>
pn uwsgi-plugin-python3 <none>
Versions of packages mailman3-web recommends:
pn libapache2-mod-proxy-uwsgi | nginx <none>
Versions of packages mailman3-web suggests:
pn postgresql | default-mysql-server | virtual-mysql-server <none>
--
Olivier BERGER
https://www-public.imtbs-tsp.eu/~berger_o/ - OpenPGP 2048R/0xF9EAE3A65819D7E8
Ingenieur Recherche - Dept INF
Institut Mines-Telecom, Telecom SudParis, Evry (France)
More information about the Pkg-mailman-hackers
mailing list