Revision history [back]
Problem running askbot migrations on postgresql DB.
Hi,
I am using ASKBOT 0.7.48 and Django 1.4. DB is postgres
I am unable to run migrations successfully. The process exits in middle of migration raising an unexpected error.
There was a related issue question - 10912 but i am not sure if this has been fixed for postgres backend too. Please help me resolve the issue.
Stacktrace:
adding new badge Guru adding new badge Necromancer adding new badge Taxonomist
askbot:0006_add_subscription_setting_for_comments_and_mentions
Adding subscription on comment responses and name mentions for each user. frequency will be automatically set to the most frequent selection that user made for any other types of subscriptions
added '' subscription for admin (1)
askbot:0007_install_mentions_model askbot:0008_add_html_field_to_comments askbot:0009_calculate_html_field_for_comments askbot:0010_add_receiving_user_to_activity_model askbot:0011_merge_mentions_into_activity askbot:0012_delete_some_unused_models askbot:0013_add_response_count__to_user FATAL ERROR - The following SQL query failed: ALTER TABLE "auth_user" ADD COLUMN "response_count" integer NOT NULL DEFAULT 0; The error was: column "response_count" of relation "auth_user" already exists
probably already have column User.response_count Error in migration: askbot:0013_add_response_count__to_user
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_manager(settings)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 232, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 307, in migrate_many
result = self.migrate(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 132, in migrate
result = self.run(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 116, in run
return self.run_migration(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 91, in run_migration
self.record(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 267, in record
record = MigrationHistory.for_migration(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/models.py", line 21, in for_migration
migration=migration.name(),
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block
Not only this but the further migrations also fails : ( In case i pass this migration somehow )
FATAL ERROR - The following SQL query failed: ALTER TABLE "forum_anonymousanswer" RENAME TO "askbot_anonymousanswer";
The error was: relation "forum_anonymousanswer" does not exist
Error in migration: askbot:0014_rename_schema_from_forum_to_askbot
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_manager(settings)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 232, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 307, in migrate_many
result = self.migrate(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 132, in migrate
result = self.run(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 116, in run
return self.run_migration(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 91, in run_migration
self.record(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 267, in record
record = MigrationHistory.for_migration(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/models.py", line 21, in for_migration
migration=migration.name(),
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block
Problem running askbot migrations on postgresql DB.
Hi,
I am using ASKBOT 0.7.48 and Django 1.4. DB is postgres
I am unable to run migrations successfully. The process exits in middle of migration raising an unexpected error.
There was a related issue question - 10912 but i am not sure if this has been fixed for postgres backend too. Please help me resolve the issue.
Stacktrace:
adding new badge Guru adding new badge Necromancer adding new badge Taxonomist
askbot:0006_add_subscription_setting_for_comments_and_mentions
Adding subscription on comment responses and name mentions for each user. frequency will be automatically set to the most frequent selection that user made for any other types of subscriptions
added '' subscription for admin (1)
askbot:0007_install_mentions_model askbot:0008_add_html_field_to_comments askbot:0009_calculate_html_field_for_comments askbot:0010_add_receiving_user_to_activity_model askbot:0011_merge_mentions_into_activity askbot:0012_delete_some_unused_models askbot:0013_add_response_count__to_user FATAL ERROR - The following SQL query failed: ALTER TABLE "auth_user" ADD COLUMN "response_count" integer NOT NULL DEFAULT 0; The error was: column "response_count" of relation "auth_user" already exists
probably already have column User.response_count Error in migration: askbot:0013_add_response_count__to_user
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_manager(settings)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 232, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 307, in migrate_many
result = self.migrate(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 132, in migrate
result = self.run(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 116, in run
return self.run_migration(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 91, in run_migration
self.record(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 267, in record
record = MigrationHistory.for_migration(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/models.py", line 21, in for_migration
migration=migration.name(),
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block
Not only this but the further migrations also fails : ( In case i pass this migration somehow )
FATAL ERROR - The following SQL query failed: ALTER TABLE "forum_anonymousanswer" RENAME TO "askbot_anonymousanswer";
The error was: relation "forum_anonymousanswer" does not exist
Error in migration: askbot:0014_rename_schema_from_forum_to_askbot
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_manager(settings)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 232, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 307, in migrate_many
result = self.migrate(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 132, in migrate
result = self.run(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 116, in run
return self.run_migration(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 91, in run_migration
self.record(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/migration/migrators.py", line 267, in record
record = MigrationHistory.for_migration(migration, database)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/south/models.py", line 21, in for_migration
migration=migration.name(),
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/home/ubuntu/.virtualenvs/forums/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block