konchanxxx / menta

MENTAのタスク管理用リポジトリ
0 stars 0 forks source link

Heroku errorについて #60

Closed aoasu05 closed 5 years ago

aoasu05 commented 5 years ago

概要

現在、Ruby on Railsのチュートリアル第7章を完了させ、Herokuにデプロイさせたのですが エラーが表示され上手くアプリが起動しません。 開発環境では問題なく表示できています。

実現したいこと

Herokuのエラーを解決し、本番環境でもアプリが動くことを確認したいです。

困っていること

Herokuでのアプリ起動が上手くいかず、困っています。

困っていることがバグの場合は事象やログ、エラーメッセージをできるだけそのまま(抜粋などしない)下記に記載してください。

$ Heroku logs | grep error
 ›   Warning: heroku-cli update available from 7.0.9 to 7.22.7.
2019-03-31T05:21:56.989770+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-ocean-70322.herokuapp.com request_id=c3492918-b9e3-47b0-b46d-809972bbed93 fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:30:57.632242+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-ocean-70322.herokuapp.com request_id=2347f0fd-bdd6-41b1-9be5-b8ba234300ba fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:30:58.193318+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=serene-ocean-70322.herokuapp.com request_id=8d1f16bc-3bb6-41c5-896d-1921fb7ee890 fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:31:26.634409+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=serene-ocean-70322.herokuapp.com request_id=c8fcc3f9-32ce-410f-97a6-186c24dd1e87 fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:31:26.381099+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-ocean-70322.herokuapp.com request_id=6baea0bf-2153-4aad-b010-50f53295aedd fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:39:38.445919+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-ocean-70322.herokuapp.com request_id=2644f495-d7ec-444d-ab6c-872cd7c36a5b fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:39:38.937101+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=serene-ocean-70322.herokuapp.com request_id=0592bca9-c313-4766-ac42-53a62dc42d32 fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:43:12.003145+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-ocean-70322.herokuapp.com request_id=99b1d27b-f4d9-4ead-988d-2b6b69828469 fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:43:12.452347+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=serene-ocean-70322.herokuapp.com request_id=4c00219d-1e29-40c2-976e-884877fa280a fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:51:49.165111+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-ocean-70322.herokuapp.com request_id=0a0ad530-56be-4c73-93e7-8ebad377b61c fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https
2019-03-31T05:51:49.677901+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=serene-ocean-70322.herokuapp.com request_id=94415bf5-87d1-40d7-a589-a469303b2918 fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https

解決するために行ったこと

heroku run rails cでより詳細なエラーが確認できるとのことでしたので 実施してみましたが、エラーも出力されませんでした。 エラーを確認するためのコマンド等ありましたら、教えてください。

問題となっている箇所の予想

見当がついていません。

問題となっているアプリケーションのGitHub URL

https://bitbucket.org/asuka01/sample_app/src/master/ チュートリアルに沿っているため、GitHubではなく、Bitbucketになります。 よろしくお願いします。

soipon05 commented 5 years ago

https://reasonable-code.com/heroku-update/ 先頭の行でheroku-cliのアップデートしてくださいってとりあえず書いてあるので試してみたらどうでしょう? あと自分は手順無視して適当にやってたら bundlerのバージョンが2系でHerokuが対応してなくてつんでたことあったのでcliをUpdateした後も駄目だった場合はbundle -vでバージョン確認してみてください!

aoasu05 commented 5 years ago

回答ありがとうございます! heroku cliをupdateしてみましたが、変わらずでした。。。 今まで問題なくherokuにデプロイできてアプリ確認できていたのですが ユーザ登録の機能を追加して、デプロイしたところ上手く表示できなくなってしまったので 今回追加したコードやファイルのせいではないかと考えているのですが、原因が掴めていません。

soipon05 commented 5 years ago

新しいエラーメッセージ先頭と末尾とかだけでも貼れますか? 見てみたいです!

soipon05 commented 5 years ago

https://qiita.com/masarusan24/items/77d064147a32169b5449 これも参考にしてみたらいいかもです!

konchanxxx commented 5 years ago

こちら確認します:bow:

konchanxxx commented 5 years ago
$ Heroku logs | grep error

これerrorという文言が入っている行だけに絞られているのですが単純にデプロイエラーが発生した時のログを

$ Heroku logs

で取得することできますか?

konchanxxx commented 5 years ago

@asuka001

aoasu05 commented 5 years ago

返信遅くなり、すみません。 新しいログを取得しました。

2019-04-02T18:25:53.594710+00:00 app[web.1]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma) 2019-04-02T18:25:53.594751+00:00 app[web.1]: Errno::EADDRINUSE: Address already in use - bind(2) for "0.0.0.0" port 33959 2019-04-02T18:25:53.594753+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:in initialize' 2019-04-02T18:25:53.594755+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:innew' 2019-04-02T18:25:53.594757+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:in add_tcp_listener' 2019-04-02T18:25:53.594758+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:105:inblock in parse' 2019-04-02T18:25:53.594760+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:88:in each' 2019-04-02T18:25:53.594762+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:88:inparse' 2019-04-02T18:25:53.594763+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/runner.rb:144:in load_and_bind' 2019-04-02T18:25:53.594764+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:391:inrun' 2019-04-02T18:25:53.594766+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/launcher.rb:174:in run' 2019-04-02T18:25:53.594768+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cli.rb:77:inrun' 2019-04-02T18:25:53.594769+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/bin/puma:10:in <top (required)>' 2019-04-02T18:25:53.594771+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:inload' 2019-04-02T18:25:53.594773+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in <top (required)>' 2019-04-02T18:25:53.818783+00:00 heroku[web.1]: Process exited with status 1 2019-04-02T18:25:53.839670+00:00 heroku[web.1]: State changed from starting to crashed 2019-04-03T00:09:46.947303+00:00 heroku[web.1]: State changed from crashed to starting 2019-04-03T00:09:51.124513+00:00 heroku[web.1]: Starting process with commandbundle exec puma -C config/puma.rb 2019-04-03T00:09:53.059985+00:00 app[web.1]: [4] Puma starting in cluster mode... 2019-04-03T00:09:53.060015+00:00 app[web.1]: [4] * Version 3.9.1 (ruby 2.5.3-p105), codename: Private Caller 2019-04-03T00:09:53.060017+00:00 app[web.1]: [4] * Min threads: 5, max threads: 5 2019-04-03T00:09:53.060018+00:00 app[web.1]: [4] * Environment: production 2019-04-03T00:09:53.060019+00:00 app[web.1]: [4] * Process workers: 2 2019-04-03T00:09:53.060020+00:00 app[web.1]: [4] * Preloading application 2019-04-03T00:09:54.823198+00:00 app[web.1]: [4] * Listening on tcp://0.0.0.0:42183 2019-04-03T00:09:54.823372+00:00 app[web.1]: [4] * Listening on tcp://0.0.0.0:42183 2019-04-03T00:09:54.823622+00:00 app[web.1]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma) 2019-04-03T00:09:54.823683+00:00 app[web.1]: Errno::EADDRINUSE: Address already in use - bind(2) for "0.0.0.0" port 42183 2019-04-03T00:09:54.823687+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:ininitialize' 2019-04-03T00:09:54.823689+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:in new' 2019-04-03T00:09:54.823690+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:inadd_tcp_listener' 2019-04-03T00:09:54.823692+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:105:in block in parse' 2019-04-03T00:09:54.823693+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:88:ineach' 2019-04-03T00:09:54.823694+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:88:in parse' 2019-04-03T00:09:54.823695+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/runner.rb:144:inload_and_bind' 2019-04-03T00:09:54.823696+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:391:in run' 2019-04-03T00:09:54.823698+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/launcher.rb:174:inrun' 2019-04-03T00:09:54.823699+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cli.rb:77:in run' 2019-04-03T00:09:54.823700+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/bin/puma:10:in<top (required)>' 2019-04-03T00:09:54.823701+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in load' 2019-04-03T00:09:54.823702+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in<top (required)>' 2019-04-03T00:09:54.963127+00:00 heroku[web.1]: State changed from starting to crashed 2019-04-03T00:09:54.949253+00:00 heroku[web.1]: Process exited with status 1 2019-04-03T06:06:23.177605+00:00 heroku[web.1]: State changed from crashed to starting 2019-04-03T06:06:27.934361+00:00 heroku[web.1]: Starting process with command bundle exec puma -C config/puma.rb 2019-04-03T06:06:30.220426+00:00 app[web.1]: [4] Puma starting in cluster mode... 2019-04-03T06:06:30.220452+00:00 app[web.1]: [4] Version 3.9.1 (ruby 2.5.3-p105), codename: Private Caller 2019-04-03T06:06:30.220454+00:00 app[web.1]: [4] Min threads: 5, max threads: 5 2019-04-03T06:06:30.220456+00:00 app[web.1]: [4] Environment: production 2019-04-03T06:06:30.220457+00:00 app[web.1]: [4] Process workers: 2 2019-04-03T06:06:30.220459+00:00 app[web.1]: [4] Preloading application 2019-04-03T06:06:32.422033+00:00 app[web.1]: [4] Listening on tcp://0.0.0.0:18282 2019-04-03T06:06:32.422186+00:00 app[web.1]: [4] Listening on tcp://0.0.0.0:18282 2019-04-03T06:06:32.422390+00:00 app[web.1]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma) 2019-04-03T06:06:32.422416+00:00 app[web.1]: Errno::EADDRINUSE: Address already in use - bind(2) for "0.0.0.0" port 18282 2019-04-03T06:06:32.422418+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:in initialize' 2019-04-03T06:06:32.422419+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:innew' 2019-04-03T06:06:32.422421+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:in add_tcp_listener' 2019-04-03T06:06:32.422422+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:105:inblock in parse' 2019-04-03T06:06:32.422424+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:88:in each' 2019-04-03T06:06:32.422425+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:88:inparse' 2019-04-03T06:06:32.422427+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/runner.rb:144:in load_and_bind' 2019-04-03T06:06:32.422428+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:391:inrun' 2019-04-03T06:06:32.422430+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/launcher.rb:174:in run' 2019-04-03T06:06:32.422431+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cli.rb:77:inrun' 2019-04-03T06:06:32.422433+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/bin/puma:10:in <top (required)>' 2019-04-03T06:06:32.422435+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:inload' 2019-04-03T06:06:32.422436+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in <top (required)>' 2019-04-03T06:06:32.587332+00:00 heroku[web.1]: State changed from starting to crashed 2019-04-03T06:06:32.567762+00:00 heroku[web.1]: Process exited with status 1 2019-04-03T11:34:31.320931+00:00 heroku[web.1]: State changed from crashed to starting 2019-04-03T11:34:35.249412+00:00 heroku[web.1]: Starting process with commandbundle exec puma -C config/puma.rb` 2019-04-03T11:34:36.895678+00:00 app[web.1]: [4] Puma starting in cluster mode... 2019-04-03T11:34:36.895700+00:00 app[web.1]: [4] Version 3.9.1 (ruby 2.5.3-p105), codename: Private Caller 2019-04-03T11:34:36.895701+00:00 app[web.1]: [4] Min threads: 5, max threads: 5 2019-04-03T11:34:36.895738+00:00 app[web.1]: [4] Environment: production 2019-04-03T11:34:36.895741+00:00 app[web.1]: [4] Process workers: 2 2019-04-03T11:34:36.895747+00:00 app[web.1]: [4] Preloading application 2019-04-03T11:34:38.469682+00:00 app[web.1]: [4] Listening on tcp://0.0.0.0:48891 2019-04-03T11:34:38.469869+00:00 app[web.1]: [4] Listening on tcp://0.0.0.0:48891 2019-04-03T11:34:38.470067+00:00 app[web.1]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma) 2019-04-03T11:34:38.470094+00:00 app[web.1]: Errno::EADDRINUSE: Address already in use - bind(2) for "0.0.0.0" port 48891 2019-04-03T11:34:38.470095+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:in initialize' 2019-04-03T11:34:38.470097+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:innew' 2019-04-03T11:34:38.470098+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:269:in add_tcp_listener' 2019-04-03T11:34:38.470100+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:105:inblock in parse' 2019-04-03T11:34:38.470101+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:88:in each' 2019-04-03T11:34:38.470102+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/binder.rb:88:inparse' 2019-04-03T11:34:38.470103+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/runner.rb:144:in load_and_bind' 2019-04-03T11:34:38.470104+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:391:inrun' 2019-04-03T11:34:38.470105+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/launcher.rb:174:in run' 2019-04-03T11:34:38.470106+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cli.rb:77:inrun' 2019-04-03T11:34:38.470107+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/bin/puma:10:in <top (required)>' 2019-04-03T11:34:38.470109+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:inload' 2019-04-03T11:34:38.470110+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in `<top (required)>' 2019-04-03T11:34:38.580960+00:00 heroku[web.1]: Process exited with status 1 2019-04-03T11:34:38.600276+00:00 heroku[web.1]: State changed from starting to crashed 2019-04-03T11:55:32.541349+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-ocean-70322.herokuapp.com request_id=0b784680-ce01-4721-a1a6-3b2eb0bbd02d fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https 2019-04-03T11:55:33.019924+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=serene-ocean-70322.herokuapp.com request_id=36d4d9b0-724b-42bf-ba01-63370abd5e0e fwd="210.2.231.228" dyno= connect= service= status=503 bytes= protocol=https

aoasu05 commented 5 years ago

ログの上部でpumaに関する失敗が記載してあったので 再度チュートリアルを確認しながらpuma関連の設定を変更したら herokuで問題なくアプリを起動することができました!! お騒がせしました。。。 ありがとうございます。

※具体的には「config/puma.rb」内の設定が反映できてなかったためでした。

konchanxxx commented 5 years ago

おお!!良かったです!:smile: 解決したらスッキリしますよね:bow: こちらはcloseしておきます!:bow: