1

Heroko配置的Heroku Postgres的Django的錯誤執行syncdb

DATABASE_URL:     postgres://xxxxxxxx:[email protected]:5432/xxxxxxxxx 
HEROKU_POSTGRESQL_GOLD_URL: postgres://yyyyyyyyyyy:[email protected]:5432/yyyyyyyyyy 
HEROKU_POSTGRESQL_YELLOW_URL: postgres://zzzzzzzzzz:[email protected]:5432/zzzzzzzzz 

settings.py

DATABASES = {'default': dj_database_url.config(default='postgres://xxxxxxxx:[email protected]:5432/xxxxxxxxx'),} 

Heroku的執行python manage.py執行syncdb

Running `python manage.py syncdb` attached to terminal... up, run.4673 
Traceback (most recent call last): 
    File "manage.py", line 10, in <module> 
    execute_from_command_line(sys.argv) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line 
    utility.execute() 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv 
    self.execute(*args, **options.__dict__) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute 
    output = self.handle(*args, **options) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle 
    return self.handle_noargs(**options) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 60, in handle_noargs 
    tables = connection.introspection.table_names() 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/__init__.py", line 910, in table_names 
    return self.get_table_list(cursor) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/introspection.py", line 33, in get_table_list 
    AND pg_catalog.pg_table_is_visible(c.oid)""") 
    File "/app/.heroku/python/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 

許多不會說英語,因此不能說明。有什麼問題?

+0

請參閱本之一: http://stackoverflow.com/questions/9148915/django-and-pgsql-connection-issues-on-linux-mint [DatabaseError的 – catherine 2013-02-10 15:28:25

+0

可能重複:當前事務被中止,命令忽略,直到事務結束塊](http://stackoverflow.com/questions/2979369/databaseerror-current-transaction-is-aborted-commands-ignored-until-end-of-tra) – 2013-04-25 04:14:38

+0

在這一點上唯一的答案可以是檢查PostgreSQL日誌中是否存在進行當前事務列表中止消息的錯誤。你能提供錯誤嗎? – 2013-04-25 08:40:21

回答

0

您發佈的錯誤僅僅意味着事務中存在先前的錯誤,並且事務已經中止。排除此錯誤無法修復此問題。你必須找出你真正的問題是什麼,並嘗試解決它。

要做到這一點,請檢查您的PostgreSQL日誌,並從這個錯誤向後搜索,直到您遇到不同的錯誤。這將是終止交易的錯誤,您可以改爲修復該交易。然而,從故障排除的角度來看,這個錯誤毫無意義找到你真正的問題並修復它。