Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relation "wagtailcore_page" does not exist #161

Closed
veronicabasso opened this issue Apr 20, 2018 · 8 comments
Closed

relation "wagtailcore_page" does not exist #161

veronicabasso opened this issue Apr 20, 2018 · 8 comments

Comments

@veronicabasso
Copy link

veronicabasso commented Apr 20, 2018

It's not a bug, it's a problem caused by me, and I would be grateful if someone can help me.

I am using django-1.11 and postgresql database. I wanted to implement blog using puput django package. I have deleted all the tables for wagtail and puput (a big mistake). Now when I run puput_initial_data I get the following error:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 355, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/puput/management/commands/puput_initial_data.py", line 20, in handle
    rootpage = Page.objects.first()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/query.py", line 564, in first
    objects = list((self if self.ordered else self.order_by('pk'))[:1])
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/query.py", line 250, in __iter__
    self._fetch_all()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/query.py", line 1118, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 894, in execute_sql
    raise original_exception
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 884, in execute_sql
    cursor.execute(sql, params)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "wagtailcore_page" does not exist
LINE 1: ...d_at", "wagtailcore_page"."live_revision_id" FROM "wagtailco...

Can somebody please help me?

@MiltonLn
Copy link
Collaborator

Hi, please can you paste your requirements? (pip freeze)

@veronicabasso
Copy link
Author

Hi @MiltonLn , Thanks for your quick response. Here is my output for pip3 freeze:

ansicolors==1.1.8
beautifulsoup4==4.6.0
blinker==1.3
certifi==2018.4.16
chardet==3.0.4
cloud-init==17.2
command-not-found==0.3
configobj==5.0.6
configparser==3.5.0
cryptography==1.2.3
defusedxml==0.5.0
Django==1.11.4
django-annoying==0.10.4
django-appconf==1.0.2
django-colorful==1.2
django-comments-xtd==2.1.0
django-contrib-comments==1.8.0
django-countries==5.0
django-crispy-forms==1.6.1
django-datetime-widget==0.9.3
django-el-pagination==3.2.4
django-friendship==1.5.0
django-gulp==3.0.0
django-imagekit==4.0.2
django-modelcluster==4.1
django-multiselectfield==0.1.8
django-social-share==1.1.2
django-summernote==0.8.8.2
django-taggit==0.22.2
django-tinymce==2.6.0
django-treebeard==4.3
djangorestframework==3.8.2
docutils==0.14
draftjs-exporter==2.0.0
easy-thumbnails==2.5
env-tools==2.1.0
futures==3.1.1
geopy==1.11.0
gunicorn==19.7.1
hibagent==1.0.1
html5lib==0.999999999
idna==2.6
Jinja2==2.8
jsonpatch==1.10
jsonpointer==1.9
language-selector==0.1
MarkupSafe==0.23
numpy==1.13.1
oauthlib==2.0.7
pilkit==2.0
Pillow==5.1.0
prettytable==0.7.2
psutil==5.2.2
psycopg2==2.7.4
puput==1.0
pyasn1==0.1.9
pybind11==2.2.0
pycurl==7.43.0
pygobject==3.20.0
PyJWT==1.6.1
pyserial==3.0.1
python-apt==1.1.0b1+ubuntu0.16.4.1
python-debian==0.1.27
python-gnupg==0.4.1
python-systemd==231
python3-openid==3.1.0
pytz==2018.4
PyYAML==3.11
requests==2.18.4
requests-oauthlib==0.8.0
six==1.11.0
social-auth-app-django==2.1.0
social-auth-core==1.7.0
SRTM.py==0.3.2
ssh-import-id==5.5
tini==3.0.1
ufw==0.35
unattended-upgrades==0.1
Unidecode==0.4.21
urllib3==1.22
wagtail==2.0.1
webencodings==0.5.1
Willow==1.1

@MiltonLn
Copy link
Collaborator

Ok, I read that you deleted all the tables, maybe it's a dumb question but, did you migrated them back? If you didn't please migrate them again and tell me if this solves your issue.

@veronicabasso
Copy link
Author

I migrated them again. However, wagtailcore_page relation isn't created.

@MiltonLn
Copy link
Collaborator

But did you do that deleting the whole database? because Django tracks the migrations and if you manually deleted the tables from database the migrations would be marked as done.

@veronicabasso
Copy link
Author

I didn't delete the whole database, only tables for wagtail and puput. I will try to rollback my migrations and retry again.

@maximekl
Copy link

maximekl commented May 7, 2018

i had the same problem, short story :

  • Installed Waigtail version > 2
  • Installed Puput version > 1
  • Using Django 1.11

I had the code for Django 2.0 with migration, i downgraded to waigtail 1.13 and Puput 0.9.2, removed all table related and cleared row related in django_migrations.

Do migrate and puput_initial_data and it will work

@MiltonLn
Copy link
Collaborator

MiltonLn commented May 7, 2018

Thanks for your help @maximekl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants