{"action":"created","issue":{"url":"https://api.github.com/repos/wagtail/wagtail/issues/4941","repository_url":"https://api.github.com/repos/wagtail/wagtail","labels_url":"https://api.github.com/repos/wagtail/wagtail/issues/4941/labels{/name}","comments_url":"https://api.github.com/repos/wagtail/wagtail/issues/4941/comments","events_url":"https://api.github.com/repos/wagtail/wagtail/issues/4941/events","html_url":"https://github.com/wagtail/wagtail/issues/4941","id":387509261,"node_id":"MDU6SXNzdWUzODc1MDkyNjE=","number":4941,"title":"no such table: main.wagtailcore_page__old","user":{"login":"jwogrady","id":2075310,"node_id":"MDQ6VXNlcjIwNzUzMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/2075310?v=4","gravatar_id":"","url":"https://api.github.com/users/jwogrady","html_url":"https://github.com/jwogrady","followers_url":"https://api.github.com/users/jwogrady/followers","following_url":"https://api.github.com/users/jwogrady/following{/other_user}","gists_url":"https://api.github.com/users/jwogrady/gists{/gist_id}","starred_url":"https://api.github.com/users/jwogrady/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwogrady/subscriptions","organizations_url":"https://api.github.com/users/jwogrady/orgs","repos_url":"https://api.github.com/users/jwogrady/repos","events_url":"https://api.github.com/users/jwogrady/events{/privacy}","received_events_url":"https://api.github.com/users/jwogrady/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-04T22:31:38Z","updated_at":"2018-12-05T12:17:15Z","closed_at":null,"author_association":"NONE","body":"\r\n### Issue Summary\r\n\r\nWhile completing the tutorial started getting this error.\r\n\r\nreturn Database.Cursor.execute(self, query, params)\r\ndjango.db.utils.OperationalError: no such table: main.wagtailcore_page__old\r\n\r\n\r\n### Steps to Reproduce\r\n\r\nFollow the Extend the HomePage model section in the [tutorial](http://docs.wagtail.io/en/v2.3/getting_started/tutorial.html).\r\n\r\nI've started a clean project, performed the migrations... but when I save a post I get a no such table error.\r\n\r\n### Technical details\r\n\r\nRequest Method: POST\r\nRequest URL: http://localhost:8000/admin/pages/3/edit/\r\n\r\nDjango Version: 2.1.4\r\nPython Version: 3.7.1\r\nInstalled Applications:\r\n['home',\r\n 'search',\r\n 'wagtail.contrib.forms',\r\n 'wagtail.contrib.redirects',\r\n 'wagtail.embeds',\r\n 'wagtail.sites',\r\n 'wagtail.users',\r\n 'wagtail.snippets',\r\n 'wagtail.documents',\r\n 'wagtail.images',\r\n 'wagtail.search',\r\n 'wagtail.admin',\r\n 'wagtail.core',\r\n 'modelcluster',\r\n 'taggit',\r\n 'django.contrib.admin',\r\n 'django.contrib.auth',\r\n 'django.contrib.contenttypes',\r\n 'django.contrib.sessions',\r\n 'django.contrib.messages',\r\n 'django.contrib.staticfiles']\r\nInstalled Middleware:\r\n['django.contrib.sessions.middleware.SessionMiddleware',\r\n 'django.middleware.common.CommonMiddleware',\r\n 'django.middleware.csrf.CsrfViewMiddleware',\r\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n 'django.contrib.messages.middleware.MessageMiddleware',\r\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\r\n 'django.middleware.security.SecurityMiddleware',\r\n 'wagtail.core.middleware.SiteMiddleware',\r\n 'wagtail.contrib.redirects.middleware.RedirectMiddleware']\r\n\r\n\r\n\r\nTraceback:\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/backends/utils.py\" in _execute\r\n  85.                 return self.cursor.execute(sql, params)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py\" in execute\r\n  296.         return Database.Cursor.execute(self, query, params)\r\n\r\nThe above exception (no such table: main.wagtailcore_page__old) was the direct cause of the following exception:\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/core/handlers/exception.py\" in inner\r\n  34.             response = get_response(request)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/core/handlers/base.py\" in _get_response\r\n  126.                 response = self.process_exception_by_middleware(e, request)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/core/handlers/base.py\" in _get_response\r\n  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/views/decorators/cache.py\" in _wrapped_view_func\r\n  44.         response = view_func(request, *args, **kwargs)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/wagtail/admin/urls/__init__.py\" in wrapper\r\n  102.             return view_func(request, *args, **kwargs)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/wagtail/admin/decorators.py\" in decorated_view\r\n  34.             return view_func(request, *args, **kwargs)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/wagtail/admin/views/pages.py\" in edit\r\n  357.                 submitted_for_moderation=is_submitting,\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/wagtail/core/models.py\" in save_revision\r\n  639.             approved_go_live_at=approved_go_live_at,\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py\" in create\r\n  651.             return super(RelatedManager, self.db_manager(db)).create(**kwargs)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/manager.py\" in manager_method\r\n  82.                 return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/query.py\" in create\r\n  413.         obj.save(force_insert=True, using=self.db)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/wagtail/core/models.py\" in save\r\n  1433.         super().save(*args, **kwargs)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/base.py\" in save\r\n  718.                        force_update=force_update, update_fields=update_fields)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/base.py\" in save_base\r\n  748.             updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/base.py\" in _save_table\r\n  831.             result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/base.py\" in _do_insert\r\n  869.                                using=using, raw=raw)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/manager.py\" in manager_method\r\n  82.                 return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/query.py\" in _insert\r\n  1136.         return query.get_compiler(using=using).execute_sql(return_id)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py\" in execute_sql\r\n  1289.                 cursor.execute(sql, params)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/backends/utils.py\" in execute\r\n  100.             return super().execute(sql, params)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/backends/utils.py\" in execute\r\n  68.         return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/backends/utils.py\" in _execute_with_wrappers\r\n  77.         return executor(sql, params, many, context)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/backends/utils.py\" in _execute\r\n  85.                 return self.cursor.execute(sql, params)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/utils.py\" in __exit__\r\n  89.                 raise dj_exc_value.with_traceback(traceback) from exc_value\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/backends/utils.py\" in _execute\r\n  85.                 return self.cursor.execute(sql, params)\r\n\r\nFile \"/Users/{myuser}/projects/podum/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py\" in execute\r\n  296.         return Database.Cursor.execute(self, query, params)\r\n\r\nException Type: OperationalError at /admin/pages/3/edit/\r\nException Value: no such table: main.wagtailcore_page__old\r\n"},"comment":{"url":"https://api.github.com/repos/wagtail/wagtail/issues/comments/444465751","html_url":"https://github.com/wagtail/wagtail/issues/4941#issuecomment-444465751","issue_url":"https://api.github.com/repos/wagtail/wagtail/issues/4941","id":444465751,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDQ2NTc1MQ==","user":{"login":"gasman","id":85097,"node_id":"MDQ6VXNlcjg1MDk3","avatar_url":"https://avatars2.githubusercontent.com/u/85097?v=4","gravatar_id":"","url":"https://api.github.com/users/gasman","html_url":"https://github.com/gasman","followers_url":"https://api.github.com/users/gasman/followers","following_url":"https://api.github.com/users/gasman/following{/other_user}","gists_url":"https://api.github.com/users/gasman/gists{/gist_id}","starred_url":"https://api.github.com/users/gasman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasman/subscriptions","organizations_url":"https://api.github.com/users/gasman/orgs","repos_url":"https://api.github.com/users/gasman/repos","events_url":"https://api.github.com/users/gasman/events{/privacy}","received_events_url":"https://api.github.com/users/gasman/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T12:17:14Z","updated_at":"2018-12-05T12:17:14Z","author_association":"COLLABORATOR","body":"Hi @jwogrady - thanks for the report. This is a new one on me... as far as I can see, a table name ending in `__old` is an internal Django implementation detail when running schema migrations on SQLite databases (see [docs](https://docs.djangoproject.com/en/2.1/topics/migrations/#sqlite), [source code](https://github.com/django/django/blob/196b420fcb0cbdd82970e2b9aea80251bde82056/django/db/backends/sqlite3/schema.py)) so it's not clear why anything outside of running the migration would be referring to that table. My best guess is that your `runserver` task still has a connection to sqlite open from before you ran the migration, and sqlite is somehow rewriting queries to redirect them to what it thinks the 'real' table should be.\r\n\r\nDid you have `./manage.py runserver` running in another console window while you ran `./manage.py migrate`? If so, does the problem persist if you stop `runserver` with ctrl+C and then start it again?\r\n\r\nIf you can attach your current home/models.py file as it stands, and the corresponding migration file (there should be three of them in home/migrations, numbered 0001, 0002 and 0003 - 0003 is the relevant one) that might give us some further clues. Also, please let us know if there are any places where you've departed from the instructions in the tutorial (for example, running it through a 'real' webserver rather than `./manage.py runserver`)."}}
{"actor":{"display_login":"gasman"}}