django-cms / django-filer

File and Image Management Application for django
https://django-filer.readthedocs.io/
Other
1.76k stars 577 forks source link

Fresh install of cmsplugin-filer gives migration error, nonexistent parent node (u'filer', u'0001_initial') #563

Closed irslambouf closed 9 years ago

irslambouf commented 9 years ago

Hello, did fresh install or cmsplugin-filer with pip install cmsplugin-filer added:

INSTALLED_APPS = (
    ....
    'filer',
    ...
    'cmsplugin_filer_file',
    'cmsplugin_filer_folder',
    'cmsplugin_filer_link',
    'cmsplugin_filer_image',
    'cmsplugin_filer_teaser',
    'cmsplugin_filer_video',
    ...
)

and

MIGRATION_MODULES = {
    'filer' : 'filer.migrations', 
     ...
    'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django',
    'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django',
    'cmsplugin_filer_link': 'cmsplugin_filer_link.migrations_django',
    'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
    'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django',
    'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
}

try to run ./manage.py migrate, or makemigrations filer or runserver

and getting error:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 63, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 17, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 48, in __init__
    self.build_graph()
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 245, in build_graph
    self.graph.add_dependency(migration, key, parent)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/migrations/graph.py", line 46, in add_dependency
    "Migration %s dependencies reference nonexistent parent node %r" % (migration, parent)
KeyError: u"Migration cmsplugin_filer_teaser.0001_initial dependencies reference nonexistent parent node (u'filer', u'0001_initial')"
yakky commented 9 years ago

Which version of Django, django-filer and cmsplugin-filer are involved?

irslambouf commented 9 years ago

django = 1.7.8 django-filer = 0.99 cmsplugin-filer==0.10.1

irslambouf commented 9 years ago

Removed 'filer' : 'filer.migrations', migrated and then added it back. This gave following traceback:

Operations to perform:
  Synchronize unmigrated apps: spurl, mptt, recurrence, debug_toolbar, aldryn_search, djangocms_admin_style, sitemaps, compressor, scheduler_app, standard_form, sekizai, haystack, treebeard, post_office
  Apply all migrations: links_plugin, djangocms_inherit, wiki_app, easy_thumbnails, djangocms_flash, djangocms_file, sites, menus, contenttypes, djangocms_googlemap, filer, django_nyt, sessions, reversion, djangocms_column, auth, pdfviewer_plugin, djangocms_picture, djangocms_style, admin, djangocms_link, djangocms_video, vacation_calendar, djangocms_teaser, cms, djangocms_text_ckeditor
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying filer.0001_initial...Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 161, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 68, in migrate
    self.apply_migration(migration, fake=fake)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 102, in apply_migration
    migration.apply(project_state, schema_editor)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/migrations/migration.py", line 108, in apply
    operation.database_forwards(self.app_label, schema_editor, project_state, new_state)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 36, in database_forwards
    schema_editor.create_model(model)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/backends/schema.py", line 270, in create_model
    self.execute(sql, params)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/backends/schema.py", line 111, in execute
    cursor.execute(sql, params)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 81, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/opt/bitnami/python/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 485, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: table "filer_clipboard" already exists

Did ./manage.py dbshell and dropped all filer related tables, re-run migrations, and now works.

yakky commented 9 years ago

@irslambouf latest filer version is 0.9.11 which has improved Django 1.7 support If this should happen again with 0.9.11 please feel free to reopen this issue