Column 'starting_email_id' cannot be null

Hello,
after upgrading from Debian 11 to Debian 12 achiving incoming mails always fails with
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 581, in get_or_create return self.get(**kwargs), False File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 435, in get raise self.model.DoesNotExist(
During handling of the above exception (Thread matching query does not exist.), another exception occurred: File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 73, in execute return self.cursor.execute(query, args) File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute res = self._query(query) File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 316, in _query self._do_get_result(db) File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 147, in _do_get_result self._result = result = self._get_result() File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 349, in _get_result return self._get_db().store_result()
During handling of the above exception ((1048, "Column 'starting_email_id' cannot be null")), another exception occurred: File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python3/dist-packages/django/views/decorators/http.py", line 40, in inner return func(request, *args, **kwargs) File "/usr/lib/python3/dist-packages/hyperkitty/views/mailman.py", line 117, in _decorator return func(request, *args, **kwargs) File "/usr/lib/python3/dist-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "/usr/lib/python3/dist-packages/hyperkitty/views/mailman.py", line 163, in archive add_to_list(mlist_fqdn, msg) File "/usr/lib/python3/dist-packages/hyperkitty/lib/incoming.py", line 153, in add_to_list email.save() File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 739, in save self.save_base(using=using, force_insert=force_insert, File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 763, in save_base pre_save.send( File "/usr/lib/python3/dist-packages/django/dispatch/dispatcher.py", line 180, in send return [ File "/usr/lib/python3/dist-packages/django/dispatch/dispatcher.py", line 181, in <listcomp> (receiver, receiver(signal=self, sender=sender, **named)) File "/usr/lib/python3/dist-packages/hyperkitty/signals.py", line 48, in Email_on_pre_save kwargs["instance"].on_pre_save() File "/usr/lib/python3/dist-packages/hyperkitty/models/email.py", line 239, in on_pre_save thread, _thread_created = Thread.objects.get_or_create( File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 588, in get_or_create return self.create(**params), True File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 453, in create obj.save(force_insert=True, using=self.db) File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 739, in save self.save_base(using=using, force_insert=force_insert, File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 776, in save_base updated = self._save_table( File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 881, in _save_table results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw) File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 919, in _do_insert return manager._insert( File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 1270, in _insert return query.get_compiler(using=using).execute_sql(returning_fields) File "/usr/lib/python3/dist-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql cursor.execute(sql, params) File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 78, in execute raise IntegrityError(*tuple(e.args))
Exception Type: IntegrityError at /hyperkitty/api/mailman/archive Exception Value: (1048, "Column 'starting_email_id' cannot be null")
Postorius Version 1.3.8 HyperKitty Version 1.3.7
Any ideas how to fix this?
Klauas

On Mon, Aug 18, 2025 at 11:32 AM kroerig--- via Mailman-users < mailman-users@mailman3.org> wrote:
Hello,
after upgrading from Debian 11 to Debian 12 achiving incoming mails always fails with
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 581, in get_or_create return self.get(**kwargs), False File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 435, in get raise self.model.DoesNotExist(
During handling of the above exception (Thread matching query does not exist.), another exception occurred: File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 73, in execute return self.cursor.execute(query, args) File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute res = self._query(query) File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 316, in _query self._do_get_result(db) File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 147, in _do_get_result self._result = result = self._get_result() File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 349, in _get_result return self._get_db().store_result()
During handling of the above exception ((1048, "Column 'starting_email_id' cannot be null")), another exception occurred: File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python3/dist-packages/django/views/decorators/http.py", line 40, in inner return func(request, *args, **kwargs) File "/usr/lib/python3/dist-packages/hyperkitty/views/mailman.py", line 117, in _decorator return func(request, *args, **kwargs) File "/usr/lib/python3/dist-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "/usr/lib/python3/dist-packages/hyperkitty/views/mailman.py", line 163, in archive add_to_list(mlist_fqdn, msg) File "/usr/lib/python3/dist-packages/hyperkitty/lib/incoming.py", line 153, in add_to_list email.save() File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 739, in save self.save_base(using=using, force_insert=force_insert, File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 763, in save_base pre_save.send( File "/usr/lib/python3/dist-packages/django/dispatch/dispatcher.py", line 180, in send return [ File "/usr/lib/python3/dist-packages/django/dispatch/dispatcher.py", line 181, in <listcomp> (receiver, receiver(signal=self, sender=sender, **named)) File "/usr/lib/python3/dist-packages/hyperkitty/signals.py", line 48, in Email_on_pre_save kwargs["instance"].on_pre_save() File "/usr/lib/python3/dist-packages/hyperkitty/models/email.py", line 239, in on_pre_save thread, _thread_created = Thread.objects.get_or_create( File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 588, in get_or_create return self.create(**params), True File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 453, in create obj.save(force_insert=True, using=self.db) File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 739, in save self.save_base(using=using, force_insert=force_insert, File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 776, in save_base updated = self._save_table( File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 881, in _save_table results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw) File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 919, in _do_insert return manager._insert( File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 1270, in _insert return query.get_compiler(using=using).execute_sql(returning_fields) File "/usr/lib/python3/dist-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql cursor.execute(sql, params) File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 78, in execute raise IntegrityError(*tuple(e.args))
Exception Type: IntegrityError at /hyperkitty/api/mailman/archive Exception Value: (1048, "Column 'starting_email_id' cannot be null")
Postorius Version 1.3.8 HyperKitty Version 1.3.7
Any ideas how to fix this?
Klauas
It looks like you did not run some migrations. However, because this is packaged Mailman3, I am not sure I know how to do that.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]

On August 18, 2025 9:35:13 AM GMT, Odhiambo Washington via Mailman-users <mailman-users@mailman3.org> wrote:
It looks like you did not run some migrations. However, because this is packaged Mailman3, I am not sure I know how to do that.
Django-admin migrate
Where Django-admin is whatever the name of the Django admin command is.
However, the primary support resource for the Debian/Ubuntu package is Debian. See <https://wiki.list.org/x/12812344>.
-- Mark Sapiro <mark@msapiro.net> Sent from my Not_an_iThing with standards compliant, open source software.

On Debian Django-admin is wrapped with /usr/share/mailman3-web/manage.py But /usr/share/mailman3-web/manage.py makemigrations && /usr/share/mailman3-web/manage.py migrate only reports: Operations to perform: Apply all migrations: account, admin, auth, contenttypes, django_mailman3, django_q, hyperkitty, postorius, sessions, sites, socialaccount Running migrations: No migrations to apply.

On Mon, Aug 18, 2025 at 3:13 PM kroerig--- via Mailman-users < mailman-users@mailman3.org> wrote:
On Debian Django-admin is wrapped with /usr/share/mailman3-web/manage.py But /usr/share/mailman3-web/manage.py makemigrations && /usr/share/mailman3-web/manage.py migrate only reports: Operations to perform: Apply all migrations: account, admin, auth, contenttypes, django_mailman3, django_q, hyperkitty, postorius, sessions, sites, socialaccount Running migrations: No migrations to apply.
So, as was already mentioned, the primary support resource for the Debian/Ubuntu package is Debian. See <https://wiki.list.org/x/12812344> However, if you use the method detailed here - https://docs.mailman3.org/en/latest/install/virtualenv.html - then "your support are belong to us" :-) Seeing as your versions of HyperKitty and Postorius are lagging much behind, you probably should upgrade to the current supported versions.
Mine are (I use virtualenv): Postorius Version 1.3.13 HyperKitty version 1.3.12.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]

On 18.08.25 12:42, Mark Sapiro wrote:
On August 18, 2025 9:35:13 AM GMT, Odhiambo Washington via Mailman-users <mailman-users@mailman3.org> wrote:
It looks like you did not run some migrations. However, because this is packaged Mailman3, I am not sure I know how to do that.
Django-admin migrate
Where Django-admin is whatever the name of the Django admin command is.
However, the primary support resource for the Debian/Ubuntu package is Debian. See <https://wiki.list.org/x/12812344>.
On Debian the command is
mailman-web migrate
Cheers -- Peppo
-- Universität Bern Phil.-nat. Fakultät Institut für Informatik
Dr. Peppo Brambilla Systemadministrator
Neubrückstrasse 10 3012 Bern Schweiz Telefon +41 31 684 33 10
participants (4)
-
kroerig@web.de
-
Mark Sapiro
-
Odhiambo Washington
-
Peppo Brambilla