Opened 7 years ago

Closed 7 years ago

#7953 closed (invalid)

django contenttypes post_sync breaking syncdb (again)

Reported by: mspang Owned by: nobody
Component: Uncategorized Version: 1.0-alpha
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Got this error:

$ ./ syncdb
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): no
Traceback (most recent call last):

File "/home/mspang/django/interblag/", line 14, in main


File "/home/mspang/django/1.0/core/management/", line 248, in execute


File "/home/mspang/django/1.0/core/management/", line 77, in run_from_argv

self.execute(*args, options.dict)

File "/home/mspang/django/1.0/core/management/", line 91, in execute

output = self.handle(*args, options)

File "/home/mspang/django/1.0/core/management/", line 173, in handle

return self.handle_noargs(options)

File "/home/mspang/django/1.0/core/management/commands/", line 108, in handle_noargs

emit_post_sync_signal(created_models, verbosity, interactive)

File "/home/mspang/django/1.0/core/management/", line 489, in emit_post_sync_signal

verbosity=verbosity, interactive=interactive)

File "/home/mspang/django/1.0/dispatch/", line 358, in send


File "/home/mspang/django/1.0/dispatch/", line 47, in robustApply

return receiver(*arguments, named)

File "/home/mspang/django/1.0/contrib/auth/management/", line 26, in create_permissions

ctype = ContentType.objects.get_for_model(klass)

File "/home/mspang/django/1.0/contrib/contenttypes/", line 28, in get_for_model

defaults = {'name': smart_unicode(opts.verbose_name_raw)},

File "/home/mspang/django/1.0/db/models/", line 85, in get_or_create

return self.get_query_set().get_or_create(kwargs)

File "/home/mspang/django/1.0/db/models/", line 325, in get_or_create

return self.get(kwargs), False

File "/home/mspang/django/1.0/db/models/", line 297, in get

num = len(clone)

File "/home/mspang/django/1.0/db/models/", line 153, in len

self._result_cache = list(self.iterator())

File "/home/mspang/django/1.0/db/models/", line 268, in iterator

for row in self.query.results_iter():

File "/home/mspang/django/1.0/db/models/sql/", line 204, in results_iter

for rows in self.execute_sql(MULTI):

File "/home/mspang/django/1.0/db/models/sql/", line 1608, in execute_sql

cursor.execute(sql, params)

File "/home/mspang/django/1.0/db/backends/", line 18, in execute

return self.cursor.execute(sql, params)

File "/home/mspang/django/1.0/db/backends/sqlite3/", line 144, in execute

return Database.Cursor.execute(self, query, params)

pysqlite2.dbapi2.OperationalError: no such table: django_content_type

I didn't have django.contrib.contenttypes in INSTALLED_APPS at the time, but adding it made
the problem go away.

Change History (1)

comment:1 Changed 7 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

You say "again" in the summary as if this is a re-occurrence of a previously-fixed bug but give no pointers to any old bug like this. For those of us not around since day 1 or perhaps with not the greatest memories, it would be helpful if you actually identified any previous identical bugs.

As it is, as mentioned here:

the auth framework requires contenttypes. The syncdb output indicates you've got auth in your INSTALLED_APPs. Therefore you need contenttypes also. Since you didn't have it, you got an error. Adding contenttypes fixed the eerror. What's the problem?

Note: See TracTickets for help on using tickets.
Back to Top