You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING:root:The rdbms API is not available because the MySQLdb library could not be loaded.
Creating tables ...
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/a/django/testapp/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/a/django/testapp/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/a/django/testapp/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/a/django/testapp/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/a/django/testapp/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/a/django/testapp/django/core/management/commands/syncdb.py", line 109, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/a/django/testapp/django/core/management/sql.py", line 190, in emit_post_sync_signal
interactive=interactive, db=db)
File "/a/django/testapp/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/a/django/testapp/django/contrib/contenttypes/management.py", line 20, in update_contenttypes
content_types.remove(ct)
ValueError: list.remove(x): x not in list
Only happens sometimes (nearly always with one particular project), fairly hard to reproduce, feels like a concurrency issue (but disabling threading doesn't help) or something similar to this: https://code.djangoproject.com/ticket/7052. With testapp I get it most often after adding:
Note that the order is actually significant -- swapping auth with contenttypes seems to fix the issue... Also note that for testapp frequency of this happening may be low (varies a lot depending on what exactly you have in settings), so to see it you'll likely need something like this:
i ran into this issue myself recently. i'm pretty sure its an eventual consistency issue.
i was able to work around it by temporarily changing the consistency policy, but its a bit of a hack. it also requires modifying the command code.
a better solution might be to always run commands with a strong consistency policy and then change to eventual consistency explicitly. like when running tests or the actual app.
Only happens sometimes (nearly always with one particular project), fairly hard to reproduce, feels like a concurrency issue (but disabling threading doesn't help) or something similar to this: https://code.djangoproject.com/ticket/7052. With testapp I get it most often after adding:
and using a specific set and order of INSTALLED_APPS:
Note that the order is actually significant -- swapping auth with contenttypes seems to fix the issue... Also note that for testapp frequency of this happening may be low (varies a lot depending on what exactly you have in settings), so to see it you'll likely need something like this:
The text was updated successfully, but these errors were encountered: