LoginSignup
14
7

More than 5 years have passed since last update.

heroku runでETIMEDOUTなときの対処法と原因

Last updated at Posted at 2018-03-01

たとえばherokuにデータベースをセットアップするとき

heroku run python manage.py migrate

に対して接続エラー

ETIMEDOUT: connect ETIMEDOUT 50.19.103.36:5000

が返ってくる場合、たとえばホストのファイアーウォールが原因で、5000番ポートが使えずheroku側のコンソールからこちら側のローカルコンソールに接続できていない可能性がある(詳細な原因はheroku logsで確認できる)。そのような場合

heroku run:detached python manage.py migrate

でエラーを回避できる。ただしこの方法では、herokuのコンソールからの標準出力(stdout)を受け取らない(detached)ことによってエラーを回避しているので、
実際にmigrateできたかどうかは

heroku logs

で確かめる必要がある。

参考

Heroku rake db:migrate results in Error R13 (Attach error) -> Failed to attach to process

14
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
7