heroku python管理py syncdb无法正常工作

时间:2012-11-20 13:40:46

标签: ruby django heroku

我已经浏览了开发中心提到的heroku教程。 该应用程序显示并正常工作。 当我尝试heroku日志时,我会看到如下所示的日志:

2012-11-20T12:40:13+00:00 heroku[run.1]: Awaiting client
2012-11-20T12:40:13+00:00 heroku[run.1]: Starting process with command `python manage.py syncdb`
2012-11-20T12:40:13+00:00 heroku[run.1]: State changed from starting to up
2012-11-20T12:40:43+00:00 heroku[run.1]: Error R13 (Attach error) -> Failed to attach to process
2012-11-20T12:40:44+00:00 heroku[run.1]: Process exited with status 128
2012-11-20T12:40:44+00:00 heroku[run.1]: State changed from up to complete
2012-11-20T13:28:00+00:00 heroku[api]: Starting process with command `python manage.py syncdb` by emailaddress@gmail.com
2012-11-20T13:28:04+00:00 heroku[run.1]: State changed from starting to up
2012-11-20T13:28:04+00:00 heroku[run.1]: Awaiting client
2012-11-20T13:28:04+00:00 heroku[run.1]: Starting process with command `python manage.py syncdb`
2012-11-20T13:28:34+00:00 heroku[run.1]: Error R13 (Attach error) -> Failed to attach to process
2012-11-20T13:28:35+00:00 heroku[run.1]: Process exited with status 128
2012-11-20T13:28:35+00:00 heroku[run.1]: State changed from up to complete

这意味着它正在运行,但是当我尝试时:

heroku run python manage.py syncdb

它没有运行,堆栈跟踪就在这里:

$ heroku run python manage.py syncdb
/Users/myusername/.heroku/client/lib/heroku/helpers.rb:103: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Running `python manage.py syncdb` attached to terminal... up, run.1
 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       Operation timed out - connect(2) (Errno::ETIMEDOUT)
    Backtrace:   /Users/myusername/.heroku/client/lib/heroku/client/rendezvous.rb:39:in `initialize'
                 /Users/myusername/.heroku/client/lib/heroku/client/rendezvous.rb:39:in `open'
                 /Users/myusername/.heroku/client/lib/heroku/client/rendezvous.rb:39:in `block in start'
                 /usr/local/heroku/ruby/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
                 /Users/myusername/.heroku/client/lib/heroku/client/rendezvous.rb:31:in `start'
                 /Users/myusername/.heroku/client/lib/heroku/command/run.rb:125:in `rendezvous_session'
                 /Users/myusername/.heroku/client/lib/heroku/command/run.rb:112:in `run_attached'
                 /Users/myusername/.heroku/client/lib/heroku/command/run.rb:21:in `index'
                 /Users/myusername/.heroku/client/lib/heroku/command.rb:206:in `run'
                 /Users/myusername/.heroku/client/lib/heroku/cli.rb:28:in `start'
                 /usr/local/heroku/bin/heroku:24:in `<main>'

    Command:     heroku run python manage.py syncdb
    Version:     heroku-toolbelt/2.33.1 (x86_64-darwin10.8.0) ruby/1.9.3

可能有什么问题?

1 个答案:

答案 0 :(得分:0)

我刚遇到这个问题并设法找到解决方案。我将首先使用以下命令检查heroku日志:

heroku logs

这应该提供更多的见解。 syncdb无法正常工作的一个常见问题是您尚未更新您的requirements.txt

为此,将管道冻结冻结为requirements.txt

pip freeze > requirements.txt

这可能不是你遇到的确切问题,但是heroku日志应该是一个好的开始。