manage.py loaddata: Problem installing fixture... Email matching query does not exist

245 views
Skip to first unread message

Moritz Both

unread,
Jul 7, 2022, 3:42:47 PM7/7/22
to Django users

Greetings,
 I am a mailman3 user and trying to migrate the database from sqlite to mysql. I did it like here:
https://www.rockandnull.com/django-dumpdata/

Basically I exported the data from sqlite using "dumpdate" and try to import using "loaddata". I did do "migrate --run-syncdb"

Unfortunatlly I get the error below. I am totally new to django. On the mailman3 mailing list, folks pointed me here - this seems to be a django issue?

Thank you inadvance for any help.
Moritz

Mailman Core Version     GNU Mailman 3.3.5 (Tom Sawyer)
Mailman Core API Version     3.1
Mailman Core Python Version     3.8.13 (default, May 19 2022, 15:06:19) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]

Traceback (most recent call last):
  File "/home/daneben/.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py", line 173, in __get__
    rel_obj = self.field.get_cached_value(instance)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/db/models/fields/mixins.py", line 15, in get_cached_value
    return instance._state.fields_cache[cache_name]
KeyError: 'starting_email'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/home/daneben/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 78, in handle
    self.loaddata(fixture_labels)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 123, in loaddata
    self.load_label(fixture_label)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 190, in load_label
    obj.save(using=self.using)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/core/serializers/base.py", line 223, in save
    models.Model.save_base(self.object, using=using, raw=True, **kwargs)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/db/models/base.py", line 763, in save_base
    pre_save.send(
  File "/home/daneben/.local/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 180, in send
    return [
  File "/home/daneben/.local/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 181, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
  File "/home/daneben/.local/lib/python3.8/site-packages/hyperkitty/signals.py", line 96, in Thread_on_pre_save
    kwargs["instance"].on_pre_save()
  File "/home/daneben/.local/lib/python3.8/site-packages/hyperkitty/models/thread.py", line 157, in on_pre_save
    self.find_starting_email()
  File "/home/daneben/.local/lib/python3.8/site-packages/hyperkitty/models/thread.py", line 149, in find_starting_email
    if self.starting_email is not None:
  File "/home/daneben/.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py", line 187, in __get__
    rel_obj = self.get_object(instance)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py", line 307, in get_object
    return super().get_object(instance)
  File "/home/daneben/.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py", line 154, in get_object
    return qs.get(self.field.get_reverse_related_filter(instance))
  File "/home/daneben/.local/lib/python3.8/site-packages/django/db/models/query.py", line 435, in get
    raise self.model.DoesNotExist(
hyperkitty.models.email.DoesNotExist: Problem installing fixture '/home/daneben/mailman-suite/datadump.json': Email matching query does not exist.

Luiz Angelo Daros de Luca

unread,
Sep 27, 2022, 1:54:41 PM9/27/22
to Django users
Hello Moritz,

I got the same problem doing the same mailman3 migration (but to a postgres db).
Do you have a solution?

Regards,

Moritz Both

unread,
Sep 28, 2022, 3:45:08 AM9/28/22
to django...@googlegroups.com
Hi Luiz,

unfortunately, no. Still on sqlite with a lot of instability, and cannot
use hyperkitty.

If you find a solution I'd be glad.

Regards,
Moritz


Am 27.09.22 um 19:54 schrieb Luiz Angelo Daros de Luca:
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/Sc__IxjTS-4/unsubscribe
> <https://groups.google.com/d/topic/django-users/Sc__IxjTS-4/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e8afbea0-8517-41ee-94ef-4e893005dae4n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/e8afbea0-8517-41ee-94ef-4e893005dae4n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
aldebaran Programmierung & IT-Lösungen GmbH
Softwareentwicklung / Individualsoftware

mail: in...@aldebaran.de https://www.aldebaran.de
Tel: +49-511-270 416-0 Fax: +49-511-270 416-33
Adresse: Hanomaghof 2 Ort: D-30449 Hannover

Geschäftsführung: Moritz Both - Dr. Torsten Crass
Barbara Kraus - Ursula (Usch) Wildt

Handelsregister: Amtsgericht Hannover HRB 56 991

Informationen zur Verarbeitung personenbezogener Daten:
https://www.aldebaran.de/datenschutz/

Luiz Angelo Daros de Luca

unread,
Oct 17, 2022, 9:58:43 PM10/17/22
to django...@googlegroups.com
Hello Moritz,

I have good news. I managed to migrate from sqlite3 to postgresql.

You need to apply this patch and load each mailman app individually
because it conflicts with existing objects, truncating the *_profile
tables on the way.

https://gitlab.com/mailman/hyperkitty/-/merge_requests/469

The commit message has a little how-to.

I still haven't tested it on my production server but I might do it soon.

Regards,

Luiz

subin

unread,
Oct 18, 2022, 1:16:32 PM10/18/22
to django...@googlegroups.com
Please reach out to Sophie at .

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJq09z7ZMFHkUy46b2tJHLcny_bHmMyCfzP%3DCRQwXMgQZzJnzQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages