OperationalError: no such table: wagtailcore_collection

1,081 views
Skip to first unread message

Leonardo Mateo

unread,
May 12, 2016, 3:37:15 PM5/12/16
to Wagtail support
Hi,

I'm getting the The error message "OperationalError: no such table: wagtailcore_collection" when I click on the image link in the Wagtail admin portal.

Here is the full error message, Can someone please assist?

OperationalError at /admin/images/

no such table: wagtailcore_collection
Request Method:GET
Request URL:http://localhost:8000/admin/images/
Django Version:1.9.6
Exception Type:OperationalError
Exception Value:
no such table: wagtailcore_collection
Exception Location:/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 323
Python Executable:/Volumes/Storage/env/wagtail_vdcristo_unify/venv/bin/python
Python Version:2.7.10
Python Path:
['/Volumes/Storage/env/wagtail_vdcristo_unify/vdcristo_unify',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python27.zip',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/plat-darwin',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/plat-mac',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/Extras/lib/python',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/lib-tk',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/lib-old',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/lib-dynload',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages']
Server time:Thu, 12 May 2016 19:04:56 +0000

Traceback Switch to copy-and-paste view

  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/core/handlers/base.py in get_response
    1.                     response = self.process_exception_by_middleware(e, request)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/core/handlers/base.py in get_response
    1.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/views/decorators/cache.py in _cache_controlled
    1.             response = viewfunc(request, *args, **kw)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/wagtail/wagtailadmin/decorators.py in decorated_view
    1.             return view_func(request, *args, **kwargs)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/wagtail/wagtailadmin/utils.py in wrapped_view_func
    1.                 return view_func(request, *args, **kwargs)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/views/decorators/vary.py in inner_func
    1.             response = func(*args, **kwargs)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/wagtail/wagtailimages/views/images.py in index
    1.     if len(collections) < 2:
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/models/query.py in __len__
    1.         self._fetch_all()
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/models/query.py in _fetch_all
    1.             self._result_cache = list(self.iterator())
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/models/query.py in __iter__
    1.         results = compiler.execute_sql()
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py in execute_sql
    1.             cursor.execute(sql, params)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/utils.py in execute
    1.             return super(CursorDebugWrapper, self).execute(sql, params)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/utils.py in execute
    1.                 return self.cursor.execute(sql, params)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/utils.py in __exit__
    1.                 six.reraise(dj_exc_type, dj_exc_value, traceback)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/utils.py in execute
    1.                 return self.cursor.execute(sql, params)
      ...
  • /Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute
    1.         return Database.Cursor.execute(self, query, params)
      ...


Thanks,

Leo

Matthew Westcott

unread,
May 12, 2016, 3:41:44 PM5/12/16
to wag...@googlegroups.com
Try running: ./manage.py migrate

Cheers,
- Matt

Leonardo Mateo

unread,
May 12, 2016, 4:42:43 PM5/12/16
to Wagtail support
Hi Matt,

After running ./manage.py migrate, I'm now getting this error, when clicking on the images link, see below.

OperationalError at /admin/images/

no such column: wagtailimages_image.collection_id
Request Method:GET
Request URL:http://localhost:8000/admin/images/
Django Version:1.9.6
Exception Type:OperationalError
Exception Value:
no such column: wagtailimages_image.collection_id
Exception Location:/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 323
Python Executable:/Volumes/Storage/env/wagtail_vdcristo_unify/venv/bin/python
Python Version:2.7.10
Python Path:
['/Volumes/Storage/env/wagtail_vdcristo_unify/vdcristo_unify',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python27.zip',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/plat-darwin',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/plat-mac',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/Extras/lib/python',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/lib-tk',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/lib-old',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/lib-dynload',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages']
Server time:Thu, 12 May 2016 20:38:58 +0000

Matthew Westcott

unread,
May 12, 2016, 4:52:36 PM5/12/16
to wag...@googlegroups.com
Hmm - that still looks like the migrations haven't been successfully applied. Were there any error messages when you ran ./manage.py migrate?

- Matt
> --
> You received this message because you are subscribed to the Google Groups "Wagtail support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wagtail+u...@googlegroups.com.
> To post to this group, send email to wag...@googlegroups.com.
> Visit this group at https://groups.google.com/group/wagtail.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/f0cbf649-a419-4523-9bef-4bb234d2ab15%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Leonardo Mateo

unread,
May 12, 2016, 10:20:35 PM5/12/16
to Wagtail support
Matt,

Here are more error messages:

(venv)LeonardosiMac2:vdcristo_unify lmateo$ ./manage.py migrate

/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/utils/six.py:808: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.

  return meta(name, bases, d)


Operations to perform:

  Apply all migrations: wagtailusers, wagtailembeds, wagtailadmin, sessions, admin, wagtailcore, auth, contenttypes, wagtaildocs, taggit, wagtailsearch, home, wagtailforms, wagtailredirects, wagtailimages

Running migrations:

  Rendering model states... DONE

  Applying home.0009_auto_20160512_1820...Traceback (most recent call last):

  File "./manage.py", line 10, in <module>

    execute_from_command_line(sys.argv)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line

    utility.execute()

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv

    self.execute(*args, **cmd_options)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute

    output = self.handle(*args, **options)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 200, in handle

    executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 92, in migrate

    self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 121, in _migrate_all_forwards

    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 198, in apply_migration

    state = migration.apply(state, schema_editor)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/migrations/migration.py", line 123, in apply

    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/migrations/operations/fields.py", line 121, in database_forwards

    schema_editor.remove_field(from_model, from_model._meta.get_field(self.name))

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/schema.py", line 247, in remove_field

    self._remake_table(model, delete_fields=[field])

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/schema.py", line 197, in _remake_table

    self.quote_name(model._meta.db_table),

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 110, in execute

    cursor.execute(sql, params)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute

    return super(CursorDebugWrapper, self).execute(sql, params)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute

    return self.cursor.execute(sql, params)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__

    six.reraise(dj_exc_type, dj_exc_value, traceback)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute

    return self.cursor.execute(sql, params)

  File "/Volumes/Storage/env/wagtail_vdcristo_unify/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 323, in execute

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

django.db.utils.OperationalError: near ")": syntax error

Matthew Westcott

unread,
May 13, 2016, 4:35:22 AM5/13/16
to wag...@googlegroups.com
There's an error in one of your project's migration files (home/migrations/0009_auto_20160512_1820.py) which means the migration is failing to complete. This probably isn't a Wagtail issue, but if you post that file we might be able to work out what's going wrong.

Cheers,
- Matt
> To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/34fa070e-5565-4efa-a016-f0c544dfaa01%40googlegroups.com.

Leonardo Mateo

unread,
May 13, 2016, 9:04:35 AM5/13/16
to wag...@googlegroups.com
Matt,

Attached you'll find the requested file. Thanks for your assistance.

Leo

You received this message because you are subscribed to a topic in the Google Groups "Wagtail support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wagtail/TXRDo5UX25U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wagtail+u...@googlegroups.com.
To post to this group, send an email to wag...@googlegroups.com.
0009_auto_20160512_1820.py

Leonardo Mateo

unread,
May 13, 2016, 5:12:14 PM5/13/16
to Wagtail support
I was able to sort this out.  I manually deleted all migrations related to this model, and ran ./manage.py migrate and that took care of it.

Thanks for your support.

Leo
> To unsubscribe from this group and stop receiving emails from it, send an email to wagtail+unsubscribe@googlegroups.com.
> To post to this group, send email to wag...@googlegroups.com.
> Visit this group at https://groups.google.com/group/wagtail.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/34fa070e-5565-4efa-a016-f0c544dfaa01%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Wagtail support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wagtail/TXRDo5UX25U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wagtail+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages