gbybk945 / tutorial

0 stars 0 forks source link

heroku デプロイエラー #13

Open technicakidz opened 2 years ago

technicakidz commented 2 years ago

何度挑戦してもアプリケーションエラーとなってしまいます。。。 上記参考記事を参考にトライしておりますが解決できません。 tutotial内に「testapp」ディレクトリを作成し、「app.py」「Procfile」「requirements.txt」を作成しました。 その後試したこと↓

hosokawadaisuke@hosokawadaisukenoMacBook-Pro tutorial % cd testapp
hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
Initialized empty Git repository in /Users/hosokawadaisuke/github/tutorial/testapp/.git/
hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % git add *
hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
    new file:   Procfile
    new file:   app.py
    new file:   requirements.txt

hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % git commit -m "testapp"
[master (root-commit) 98a0794] testapp
 3 files changed, 19 insertions(+)
 create mode 100644 Procfile
 create mode 100644 app.py
 create mode 100644 requirements.txt
hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % heroku create
Creating app... done, ⬢ shrouded-harbor-95617
https://shrouded-harbor-95617.herokuapp.com/ | https://git.heroku.com/shrouded-harbor-95617.git
hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % git remote
heroku
hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % git remote -v
heroku  https://git.heroku.com/shrouded-harbor-95617.git (fetch)
heroku  https://git.heroku.com/shrouded-harbor-95617.git (push)
hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % git push heroku master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 541 bytes | 541.00 KiB/s, done.
Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the buildpack default: python-3.9.7
remote:        To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.9.7
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting Click==7.0
remote:          Downloading Click-7.0-py2.py3-none-any.whl (81 kB)
remote:        Collecting Flask==1.1.1
remote:          Downloading Flask-1.1.1-py2.py3-none-any.whl (94 kB)
remote:        Collecting gunicorn==20.0.4
remote:          Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
remote:        Collecting itsdangerous==1.1.0
remote:          Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
remote:        Collecting Jinja2==2.10.3
remote:          Downloading Jinja2-2.10.3-py2.py3-none-any.whl (125 kB)
remote:        Collecting MarkupSafe==1.1.1
remote:          Downloading MarkupSafe-1.1.1-cp39-cp39-manylinux2010_x86_64.whl (32 kB)
remote:        Collecting Werkzeug==0.16.0
remote:          Downloading Werkzeug-0.16.0-py2.py3-none-any.whl (327 kB)
remote:        Installing collected packages: Click, itsdangerous, MarkupSafe, Jinja2, Werkzeug, Flask, gunicorn
remote:        Successfully installed Click-7.0 Flask-1.1.1 Jinja2-2.10.3 MarkupSafe-1.1.1 Werkzeug-0.16.0 gunicorn-20.0.4 itsdangerous-1.1.0
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 52.7M
remote: -----> Launching...
remote:        Released v3
remote:        https://shrouded-harbor-95617.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/shrouded-harbor-95617.git
 * [new branch]      master -> master
hosokawadaisuke@hosokawadaisukenoMacBook-Pro testapp % heroku open

Originally posted by @gbybk945 in https://github.com/gbybk945/tutorial/issues/3#issuecomment-920406134

technicakidz commented 2 years ago
remote: Verifying deploy... done.

とメッセージにでているため成功しているように見えます。

デプロイ自体ではなく、画面の描画(レンダリング) がなされない問題についてでしょうか? それでしたら heroku ダッシュボードの様子などを共有いただきつつ状態の確認を進めるイメージです。

デプロイ後に画面が描画できない点

  • Resources の Dynos を参照すると稼働するためのコンテナが存在していないことが原因
  • Dynos とは https://jp.heroku.com/dynos
  • 解決策: アプリ側のコードをシンプルな状態(app.py のみ)にして再デプロイと動作確認を繰り返す
  • 参考: https://yuki.world/heroku-h14-error/
gbybk945 commented 2 years ago
スクリーンショット 2021-09-17 6 40 30

<img width="1367" alt="スクリーンショット 2021-09-17 6 40 50" src="https://user-images.githubusercontent.com/79370140/133689492-36919c58-4734-45d2-878a-1b28afa23be3

スクリーンショット 2021-09-17 6 38 09

.png">

失礼しました。レンダリングがされない問題です。 herokuのダッシュボードについては添付データのとおりです。

gbybk945 commented 2 years ago
スクリーンショット 2021-09-17 6 38 09
gbybk945 commented 2 years ago
スクリーンショット 2021-09-17 6 40 50
gbybk945 commented 2 years ago

ちなみに、ダッシュボードの状況からすると、現在デプロイは2つしているという状況ですか? 上限はいくつまででしたでしょうか?

technicakidz commented 2 years ago

cf. https://note.com/mikora_work/n/n1eddeae2266a

① 使用限度時間について クレジットカードを登録すれば、1ヶ月当たり 1,000 時間まで無料で使えます。 (登録していなければ 550 時間) ずっと稼働させても1か月24時間×31日は1000時間を超えないので、無料プランでもOKということになります。 ただし、複数のアプリを動かす場合は、その合計時間になるので、1000時間を超える可能性が出てきます。 なお、限度時間を超えると、アプリは停止し利用できなくなるとのことです。