Ask Your Question
0

Postgres Migration Issue and relation "askbot_thread" does not exist

asked 2013-10-24 05:29:08 -0500

SocialQA gravatar image

updated 2013-10-24 05:30:39 -0500

I am using postgres, but looks like migration fails on auth_user table, and due to that when I run the server I get the following error:

DatabaseError at /questions/
relation "askbot_thread" does not exist
LINE 1: SELECT COUNT(DISTINCT "askbot_thread"."id") FROM "askbot_thr...
                                                         ^
Request Method: GET
Request URL:    http://localhost:8002/questions/
Django Version: 1.4.8
Exception Type: DatabaseError
Exception Value:    
relation "askbot_thread" does not exist
LINE 1: SELECT COUNT(DISTINCT "askbot_thread"."id") FROM "askbot_thr...

Here is the result from migration.

$python manage.py syncdb
Please run command

    python manage.py collectstatic
WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

current transaction is aborted, commands ignored until end of transaction block

Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table south_migrationhistory
Creating table livesettings_setting
Creating table livesettings_longsetting
Creating table djkombu_queue
Creating table djkombu_message
Creating table followit_followuser

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use 'anu'): 
E-mail address: auduwage@gmail.com
Password: 
Password (again): 
Askbot Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

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

Not synced (use migrations):
 - longerusername
 - askbot.deps.django_authopenid
 - robots
 - djcelery
 - group_messaging
 - askbot
(use ./manage.py migrate to migrate these)
[1]+  Done                    open -a /Applications/Emacs.app $1 settings.py
(vGA_Migration)anu@cmbmac:[~/code/vGA_Migration/gopheranswers]$python manage.py migrate askbot
Please run command

    python manage.py collectstatic
WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

relation "askbot_badgedata" does not exist
LINE 1: ..."."slug", "askbot_badgedata"."awarded_count" FROM "askbot_ba...
                                                             ^

Running migrations for askbot:
 - Migrating forwards to 0164_update_postgres_user_search.
 > askbot:0001_initial
FATAL ERROR - The following SQL query failed: ALTER TABLE "auth_user" ADD COLUMN "website" varchar(200) NULL;
The error was: column "website" of relation "auth_user" already exists

FATAL ERROR - The following SQL query failed: ALTER TABLE "auth_user" ADD COLUMN "about" text NULL;
The error was: column "about" of relation "auth_user" already exists

FATAL ERROR - The following SQL query failed: ALTER TABLE "auth_user" ADD COLUMN "gold" smallint NOT NULL DEFAULT ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-10-29 14:22:03 -0500

Evgeny gravatar image

There is a very odd typo in your askbot/migrations/0018_add___status__field_to_user_model.py, line 16:

"fields" entered as "fiedls", not sure how that might have happened.

The database migrations have not completed and as a result there are error messages of type "relation XYZ does not exist".

edit flag offensive delete link more

Comments

Yes thanks for the reply I also found the bug. Sorry forgot to update the question with an answer.

SocialQA gravatar imageSocialQA ( 2013-10-29 14:24:40 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-10-24 05:29:08 -0500

Seen: 1,581 times

Last updated: Oct 29 '13