【问题标题】:heroku python manage py syncdb not workingheroku python管理py syncdb不工作
【发布时间】:2012-11-20 13:40:46
【问题描述】:

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

可能有什么问题?

【问题讨论】:

    标签: ruby django heroku


    【解决方案1】:

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

    heroku logs

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

    为此,将 pip freeze 输入到 requirements.txt 中

    pip freeze &gt; requirements.txt

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

    【讨论】:

      猜你喜欢
      • 2014-05-17
      • 2015-07-31
      • 2011-02-13
      • 2015-02-26
      • 2012-09-22
      • 2013-03-19
      • 2015-01-29
      • 2013-07-21
      • 2014-02-04
      相关资源
      最近更新 更多