0

我已经完成了开发中心中提到的 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

什么可能是错的?

4

1 回答 1

0

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

heroku logs

这应该提供更多的洞察力。syncdb 不工作的一个常见问题是你没有更新你的 requirements.txt

为此,管道 pip freeze 进入 requirements.txt

pip freeze > requirements.txt

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

于 2013-03-01T20:51:15.980 回答