First time here? Check out the FAQ!

Revision history  [back]

DatabaseError: column askbot_thread.text_search_vector does not exist

Hi Guys,

I recently upgraded from 0.29 to the latest git-master and everything worked fine (love the migrations!)

but some pages (example: questions/scope:all/sort:activity-desc/query:dissapear/page:3/) generate a 500 server error with the following message:

 VariableDoesNotExist: Failed lookup for key [request] in u'[{}]'

but if I look in the askbot.log I actually see this error occuring:

/opt/python-2.7.2/lib/python2.7/site-packages/django/core/handlers/base.py TIME: 2012-02-28 14:42:10,377 MSG: base.py:handle_uncaught_exception:209 Internal Server Error: /questions/scope:all/sort:activity-desc/query:dissapear/page:3/
Traceback (most recent call last):
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/srv/www/vhosts/askbot/askbot/views/readers.py", line 80, in questions
    if paginator.num_pages < search_state.page:
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/paginator.py", line 60, in _get_num_pages
    if self.count == 0 and not self.allow_empty_first_page:
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/paginator.py", line 48, in _get_count
    self._count = self.object_list.count()
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/query.py", line 334, in count
    return self.query.get_count(using=self.db)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/query.py", line 401, in get_count
    number = obj.get_aggregation(using=using)[None]
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/query.py", line 367, in get_aggregation
    result = query.get_compiler(using).execute_sql(SINGLE)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
DatabaseError: column askbot_thread.text_search_vector does not exist
LINE 1: ...estion'  AND "askbot_post"."deleted" = false  AND askbot_thr...

Is this a bug or did something go wrong with the migrations?

syncdb output:

> python manage.py syncdb
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
No fixtures found.

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.staticfiles
 > django.contrib.admin
 > django.contrib.sitemaps
 > south
 > askbot.deps.livesettings
 > keyedcache
 > robots
 > django_countries
 > djcelery
 > djkombu
 > followit

Not synced (use migrations):
 - askbot.deps.django_authopenid
 - askbot
(use ./manage.py migrate to migrate these)

migrate output:

> python manage.py migrate
Running migrations for django_authopenid:
- Nothing to migrate.
 - Loading initial data for django_authopenid.
No fixtures found.
Running migrations for askbot:
- Nothing to migrate.
 - Loading initial data for askbot.
No fixtures found.

(running against a postgres db)

I just ran the askbot/search/postgresql/thread_and_post_models_01162012.plsql file:

> psql -U askbot -f askbot/search/postgresql/thread_and_post_models_01162012.plsql 
Password for user askbot: 
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
 setup_aggregates 
------------------
 t
(1 row)

CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:154: ERROR:  cannot change name of input parameter "question_id"
HINT:  Use DROP FUNCTION first.
 add_tsvector_column 
---------------------
 t
(1 row)

 add_tsvector_column 
---------------------
 t
(1 row)

UPDATE 354
UPDATE 178
UPDATE 105
UPDATE 283
UPDATE 105
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:172: ERROR:  relation "answer" does not exist
LINE 1: SELECT concat_tsvectors(text_search_vector) FROM answer WHER...
                                                         ^
QUERY:  SELECT concat_tsvectors(text_search_vector) FROM answer WHERE question_id = 7 AND deleted=false
CONTEXT:  PL/pgSQL function "get_dependent_answers_tsv" line 9 at FOR over EXECUTE statement
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:186: NOTICE:  trigger "thread_search_vector_update_trigger" for table "askbot_thread" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:197: NOTICE:  trigger "thread_search_vector_insert_trigger" for table "askbot_thread" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:218: NOTICE:  trigger "post_search_vector_update_trigger" for table "askbot_post" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:222: NOTICE:  index "askbot_search_idx" does not exist, skipping
DROP INDEX
CREATE INDEX

DatabaseError: column askbot_thread.text_search_vector does not exist

Hi Guys,

I recently upgraded from 0.29 to the latest git-master and everything worked fine (love the migrations!)

but some pages (example: questions/scope:all/sort:activity-desc/query:dissapear/page:3/) generate a 500 server error with the following message:

 VariableDoesNotExist: Failed lookup for key [request] in u'[{}]'

but if I look in the askbot.log I actually see this error occuring:

/opt/python-2.7.2/lib/python2.7/site-packages/django/core/handlers/base.py TIME: 2012-02-28 14:42:10,377 MSG: base.py:handle_uncaught_exception:209 Internal Server Error: /questions/scope:all/sort:activity-desc/query:dissapear/page:3/
Traceback (most recent call last):
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/srv/www/vhosts/askbot/askbot/views/readers.py", line 80, in questions
    if paginator.num_pages < search_state.page:
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/paginator.py", line 60, in _get_num_pages
    if self.count == 0 and not self.allow_empty_first_page:
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/paginator.py", line 48, in _get_count
    self._count = self.object_list.count()
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/query.py", line 334, in count
    return self.query.get_count(using=self.db)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/query.py", line 401, in get_count
    number = obj.get_aggregation(using=using)[None]
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/query.py", line 367, in get_aggregation
    result = query.get_compiler(using).execute_sql(SINGLE)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
DatabaseError: column askbot_thread.text_search_vector does not exist
LINE 1: ...estion'  AND "askbot_post"."deleted" = false  AND askbot_thr...

Is this a bug or did something go wrong with the migrations?

syncdb output:

> python manage.py syncdb
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
No fixtures found.

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.staticfiles
 > django.contrib.admin
 > django.contrib.sitemaps
 > south
 > askbot.deps.livesettings
 > keyedcache
 > robots
 > django_countries
 > djcelery
 > djkombu
 > followit

Not synced (use migrations):
 - askbot.deps.django_authopenid
 - askbot
(use ./manage.py migrate to migrate these)

migrate output:

> python manage.py migrate
Running migrations for django_authopenid:
- Nothing to migrate.
 - Loading initial data for django_authopenid.
No fixtures found.
Running migrations for askbot:
- Nothing to migrate.
 - Loading initial data for askbot.
No fixtures found.

(running against a postgres db)

I just ran the askbot/search/postgresql/thread_and_post_models_01162012.plsql file:

> 

psql -U askbot -f askbot/search/postgresql/thread_and_post_models_01162012.plsql Password for user askbot: CREATE FUNCTION CREATE FUNCTION CREATE FUNCTION CREATE FUNCTION CREATE FUNCTION CREATE FUNCTION CREATE FUNCTION CREATE FUNCTION setup_aggregates ------------------ t (1 row) row)

CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:154: ERROR:  cannot change name of input parameter "question_id"
HINT:  Use DROP FUNCTION first.
 add_tsvector_column 
---------------------
 t
(1 row)

 add_tsvector_column 
---------------------
 t
(1 row)

UPDATE 354
UPDATE 178
UPDATE 105
UPDATE 283
UPDATE 105
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:172: ERROR:  relation "answer" does not exist
LINE 1: SELECT concat_tsvectors(text_search_vector) FROM answer WHER...
                                                         ^
QUERY:  SELECT concat_tsvectors(text_search_vector) FROM answer WHERE question_id = 7 AND deleted=false
CONTEXT:  PL/pgSQL function "get_dependent_answers_tsv" line 9 at FOR over EXECUTE statement
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:186: NOTICE:  trigger "thread_search_vector_update_trigger" for table "askbot_thread" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:197: NOTICE:  trigger "thread_search_vector_insert_trigger" for table "askbot_thread" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:218: NOTICE:  trigger "post_search_vector_update_trigger" for table "askbot_post" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:222: NOTICE:  index "askbot_search_idx" does not exist, skipping
DROP INDEX
CREATE INDEX

DatabaseError: column askbot_thread.text_search_vector does not exist

Hi Guys,

I recently upgraded from 0.29 to the latest git-master and everything worked fine (love the migrations!)

but some pages (example: questions/scope:all/sort:activity-desc/query:dissapear/page:3/) generate a 500 server error with the following message:

 VariableDoesNotExist: Failed lookup for key [request] in u'[{}]'

but if I look in the askbot.log I actually see this error occuring:

/opt/python-2.7.2/lib/python2.7/site-packages/django/core/handlers/base.py TIME: 2012-02-28 14:42:10,377 MSG: base.py:handle_uncaught_exception:209 Internal Server Error: /questions/scope:all/sort:activity-desc/query:dissapear/page:3/
Traceback (most recent call last):
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/srv/www/vhosts/askbot/askbot/views/readers.py", line 80, in questions
    if paginator.num_pages < search_state.page:
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/paginator.py", line 60, in _get_num_pages
    if self.count == 0 and not self.allow_empty_first_page:
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/core/paginator.py", line 48, in _get_count
    self._count = self.object_list.count()
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/query.py", line 334, in count
    return self.query.get_count(using=self.db)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/query.py", line 401, in get_count
    number = obj.get_aggregation(using=using)[None]
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/query.py", line 367, in get_aggregation
    result = query.get_compiler(using).execute_sql(SINGLE)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/opt/python-2.7.2/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
DatabaseError: column askbot_thread.text_search_vector does not exist
LINE 1: ...estion'  AND "askbot_post"."deleted" = false  AND askbot_thr...

Is this a bug or did something go wrong with the migrations?

syncdb output:

> python manage.py syncdb
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
No fixtures found.

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.staticfiles
 > django.contrib.admin
 > django.contrib.sitemaps
 > south
 > askbot.deps.livesettings
 > keyedcache
 > robots
 > django_countries
 > djcelery
 > djkombu
 > followit

Not synced (use migrations):
 - askbot.deps.django_authopenid
 - askbot
(use ./manage.py migrate to migrate these)

migrate output:

> python manage.py migrate
Running migrations for django_authopenid:
- Nothing to migrate.
 - Loading initial data for django_authopenid.
No fixtures found.
Running migrations for askbot:
- Nothing to migrate.
 - Loading initial data for askbot.
No fixtures found.

(running against a postgres db)

I just ran the askbot/search/postgresql/thread_and_post_models_01162012.plsql file:

psql -U askbot -f askbot/search/postgresql/thread_and_post_models_01162012.plsql Password for user askbot: CREATE FUNCTION CREATE FUNCTION CREATE FUNCTION CREATE FUNCTION setup_aggregates ------------------ t (1 row)

CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:154: ERROR:  cannot change name of input parameter "question_id"
HINT:  Use DROP FUNCTION first.
 add_tsvector_column 
---------------------
 t
(1 row)

 add_tsvector_column 
---------------------
 t
(1 row)

UPDATE 354
UPDATE 178
UPDATE 105
UPDATE 283
UPDATE 105
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:172: ERROR:  relation "answer" does not exist
LINE 1: SELECT concat_tsvectors(text_search_vector) FROM answer WHER...
                                                         ^
QUERY:  SELECT concat_tsvectors(text_search_vector) FROM answer WHERE question_id = 7 AND deleted=false
CONTEXT:  PL/pgSQL function "get_dependent_answers_tsv" line 9 at FOR over EXECUTE statement
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:186: NOTICE:  trigger "thread_search_vector_update_trigger" for table "askbot_thread" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:197: NOTICE:  trigger "thread_search_vector_insert_trigger" for table "askbot_thread" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
CREATE FUNCTION
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:218: NOTICE:  trigger "post_search_vector_update_trigger" for table "askbot_post" does not exist, skipping
DROP TRIGGER
CREATE TRIGGER
psql: askbot/search/postgresql/thread_and_post_models_01162012.plsql:222: NOTICE:  index "askbot_search_idx" does not exist, skipping
DROP INDEX
CREATE INDEX