etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.2k stars 129 forks source link

psycopg2.errors.UndefinedTable: relation "watson_searchentry" does not exist #290

Closed rkmullapudi closed 4 months ago

rkmullapudi commented 2 years ago

We are seeing this error when you deploy our project. This was working fine till last week or so but not sure what was changed in Watson. Could someone look at it.

/home/../env/bin/python manage.py makemigrations
/home/../env/bin/python manage.py migrate
/home/../env/bin/pip install django-watson
/home/../bin/python manage.py installwatson
+ /home/../env/bin/python manage.py installwatson
Traceback (most recent call last):
  File "/home/../env/lib/python3.8/site-packages/django/db/backends/utils.py", line 82, in _execute
    return self.cursor.execute(sql)
psycopg2.errors.UndefinedTable: relation "watson_searchentry" does not exist
The above exception was the direct cause of the following exception:
.........
........
django.db.utils.ProgrammingError: relation "watson_searchentry" does not exist
script returned exit code 2

Here is the list of versions that we are in our django based web application:

Django version: 3.1.6
Python version: 3.8
Pip version: 21.2.4
virtualenv version: 20.4.3
django-watson version: 1.5.5
etianen commented 2 years ago

Somehow you've lost the database table used by django-watson.

You can rebuild the whole thing using:

./manage.py migrate watson zero --fake ./manage.py migrate watson

However, something has deleted your django-waston database table. Possibly other things have been deleted too. You should see whether your database is configured correctly, or in fact even still exists.

On Thu, 4 Nov 2021 at 05:11, rkmullapudi @.***> wrote:

We are seeing this error when you deploy our project. This was working fine till last week or so but not sure what was changed in Watson. Could someone look at it.

/home/../env/bin/python manage.py makemigrations /home/../env/bin/python manage.py migrate /home/../env/bin/pip install django-watson /home/../bin/python manage.py installwatson

  • /home/../env/bin/python manage.py installwatson Traceback (most recent call last): File "/home/../env/lib/python3.8/site-packages/django/db/backends/utils.py", line 82, in _execute return self.cursor.execute(sql) psycopg2.errors.UndefinedTable: relation "watson_searchentry" does not exist The above exception was the direct cause of the following exception: ......... ........ django.db.utils.ProgrammingError: relation "watson_searchentry" does not exist script returned exit code 2

Here is the list of versions that we are in our django based web application:

Django version: 3.1.6 Python version: 3.8 Pip version: 21.2.4 virtualenv version: 20.4.3 django-watson version: 1.5.5

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/etianen/django-watson/issues/290, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEKCHGZG36LCLVLW4OPDTUKIPX3ANCNFSM5HKS5KJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

rkmullapudi commented 2 years ago

Thank you @etianen and I really appreciate for your recommendation. We were able to resolve the issue as follows:

           sh '/home/....../env/bin/python manage.py makemigrations'
//         sh '/home/....../env/bin/python manage.py showmigrations'
//         sh '/home/....../env/bin/python manage.py migrate --fake watson zero'
//         sh '/home/....../env/bin/python manage.py migrate --fake classifieds zero'
//         sh '/home/....../env/bin/python manage.py migrate --fake comments zero'
//         sh '/home/....../env/bin/python manage.py migrate --fake shopping zero'
//         sh '/home/....../env/bin/python manage.py migrate --fake myAppl zero'
//         sh '/home/....../env/bin/python manage.py migrate --fake wishlist zero'
//         sh '/home/....../env/bin/python manage.py migrate --fake customer zero'
//         sh '/home/....../env/bin/pip install --upgrade django'
//         sh '/home/....../env/bin/pip install django==3.1.6'
//         sh 'find . -path "*/migrations/*.py" -not -name "__init__.py" -delete'
//         sh 'find . -path "*/migrations/*.pyc"  -delete'
//         sh '/home/....../env/bin/python manage.py showmigrations'
//         sh '/home/....../env/bin/python manage.py makemigrations'
//         sh '/home/....../env/bin/python manage.py migrate --fake-initial'
//         sh '/home/....../env/bin/python manage.py showmigrations'
//         sh '/home/....../env/bin/python manage.py installwatson'
//         sh '/home/....../env/bin/python manage.py buildwatson'
rkmullapudi commented 4 months ago

Closing this one as this is no longer an issue for us. Thank you for your support.