質問するログイン新規登録

質問編集履歴

3

最新のlogの追加

2020/12/27 05:51

投稿

K.K4
K.K4

スコア0

title CHANGED
File without changes
body CHANGED
@@ -11,42 +11,110 @@
11
11
  アプリをheroku openで起動しようとしたときこの画面が出てきてアプリが動きませんでした
12
12
 
13
13
  ※追加情報
14
- エラーに表記されているheroku logs --tailを実行した結果を追加します。
14
+ 最新のheroku logs --tailを追加します。
15
+
15
16
  ```
16
- 2020-12-26T02:34:04.067653+00:00 heroku[web.1]: State changed from crashed to starting
17
- 2020-12-26T02:34:07.614510+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file-`
18
- 2020-12-26T02:34:10.891718+00:00 app[web.1]: usage: gunicorn [OPTIONS] [APP_MODULE]
19
- 2020-12-26T02:34:10.891896+00:00 app[web.1]: gunicorn: error: unrecognized arguments: --log-file-
20
- 2020-12-26T02:34:10.956349+00:00 heroku[web.1]: Process exited with status 2
21
- 2020-12-26T02:34:10.993342+00:00 heroku[web.1]: State changed from starting to crashed
22
- 2020-12-26T08:17:56.820320+00:00 heroku[web.1]: State changed from crashed to starting
23
- 2020-12-26T08:18:01.775007+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file-`
24
- 2020-12-26T08:18:05.660571+00:00 app[web.1]: usage: gunicorn [OPTIONS] [APP_MODULE]
25
- 2020-12-26T08:18:05.660843+00:00 app[web.1]: gunicorn: error: unrecognized arguments: --log-file-
26
- 2020-12-26T08:18:05.777067+00:00 heroku[web.1]: Process exited with status 2
27
- 2020-12-26T08:18:05.822263+00:00 heroku[web.1]: State changed from starting to crashed
28
- 2020-12-26T09:37:35.000000+00:00 app[api]: Build started by user e1917034@oit.ac.jp
29
- 2020-12-26T09:38:06.251510+00:00 app[api]: Deploy af3bf7bd by user e1917034@oit.ac.jp
30
- 2020-12-26T09:38:06.251510+00:00 app[api]: Release v24 created by user e1917034@oit.ac.jp
31
- 2020-12-26T09:38:06.503829+00:00 heroku[web.1]: State changed from crashed to starting
32
- 2020-12-26T09:38:09.624324+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file-`
33
- 2020-12-26T09:38:11.632570+00:00 app[web.1]: usage: gunicorn [OPTIONS] [APP_MODULE]
34
- 2020-12-26T09:38:11.632747+00:00 app[web.1]: gunicorn: error: unrecognized arguments: --log-file-
35
- 2020-12-26T09:38:11.700673+00:00 heroku[web.1]: Process exited with status 2
36
- 2020-12-26T09:38:11.733354+00:00 heroku[web.1]: State changed from starting to crashed
37
- 2020-12-26T09:38:11.736809+00:00 heroku[web.1]: State changed from crashed to starting
38
- 2020-12-26T09:38:14.000000+00:00 app[api]: Build succeeded
39
- 2020-12-26T09:38:16.990374+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file-`
40
- 2020-12-26T09:38:20.322423+00:00 app[web.1]: usage: gunicorn [OPTIONS] [APP_MODULE]
41
- 2020-12-26T09:38:20.322617+00:00 app[web.1]: gunicorn: error: unrecognized arguments: --log-file-
42
- 2020-12-26T09:38:20.440422+00:00 heroku[web.1]: Process exited with status 2
43
- 2020-12-26T09:38:20.511801+00:00 heroku[web.1]: State changed from starting to crashed
44
- 2020-12-26T09:38:37.829571+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=kyunai2.herokuapp.com request_id=2cca9370-7b92-4b34-a666-582cb8d5e2c7 fwd="113.153.101.89" dyno= connect= service= status=503 bytes= protocol=https
45
- 2020-12-26T09:39:03.096795+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=kyunai2.herokuapp.com request_id=275f7716-8e67-42f4-a344-fbe27483c9b1 fwd="113.153.101.89" dyno= connect= service= status=503 bytes= protocol=https
17
+ 2020-12-27T05:22:29.122077+00:00 app[web.1]: [2020-12-27 05:22:29 +0000] [8] [INFO] Booting worker with pid: 8
18
+ : [2020-12-27 05:22:29 +0000] [8] [ERROR] Exception in worker process
19
+ : Traceback (most recent call last):
20
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
21
+ : worker.init_process()
22
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 119, in init_process
23
+ : self.load_wsgi()
24
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
25
+ : self.wsgi = self.app.wsgi()
26
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
27
+ : self.callable = self.load()
28
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
29
+ : return self.load_wsgiapp()
30
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
31
+ : return util.import_app(self.app_uri)
32
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 358, in import_app
33
+ : mod = importlib.import_module(module)
34
+ : File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
35
+ : return _bootstrap._gcd_import(name[level:], package, level)
36
+ : File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
37
+ : File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
38
+ : File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
39
+ : File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
40
+ : File "<frozen importlib._bootstrap_external>", line 786, in exec_module
41
+ : File "<frozen importlib._bootstrap_external>", line 923, in get_code
42
+ : File "<frozen importlib._bootstrap_external>", line 853, in source_to_code
43
+ : File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
44
+ : File "/app/app.py", line 13
45
+ : app.run(debug=False, host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))
46
+ : ^
47
+ : IndentationError: expected an indented block
48
+ : [2020-12-27 05:22:29 +0000] [8] [INFO] Worker exiting (pid: 8)
49
+ : [2020-12-27 05:22:29 +0000] [9] [INFO] Booting worker with pid: 9
50
+ : [2020-12-27 05:22:29 +0000] [9] [ERROR] Exception in worker process
51
+ : Traceback (most recent call last):
52
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
53
+ : worker.init_process()
54
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 119, in init_process
55
+ : self.load_wsgi()
56
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
57
+ : self.wsgi = self.app.wsgi()
58
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
59
+ : self.callable = self.load()
60
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
61
+ : return self.load_wsgiapp()
62
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
63
+ : return util.import_app(self.app_uri)
64
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 358, in import_app
65
+ : mod = importlib.import_module(module)
66
+ : File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
67
+ : return _bootstrap._gcd_import(name[level:], package, level)
68
+ : File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
69
+ : File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
70
+ : File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
71
+ : File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
72
+ : File "<frozen importlib._bootstrap_external>", line 786, in exec_module
73
+ : File "<frozen importlib._bootstrap_external>", line 923, in get_code
74
+ : File "<frozen importlib._bootstrap_external>", line 853, in source_to_code
75
+ : File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
76
+ : File "/app/app.py", line 13
77
+ : app.run(debug=False, host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))
78
+ : ^
79
+ : IndentationError: expected an indented block
80
+ : [2020-12-27 05:22:29 +0000] [9] [INFO] Worker exiting (pid: 9)
81
+ : Traceback (most recent call last):
82
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 209, in run
83
+ : self.sleep()
84
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 357, in sleep
85
+ : ready = select.select([self.PIPE[0]], [], [], 1.0)
86
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
87
+ : self.reap_workers()
88
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
89
+ : raise HaltServer(reason, self.WORKER_BOOT_ERROR)
90
+ : gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
91
+ :
92
+ : During handling of the above exception, another exception occurred:
93
+ :
94
+ : Traceback (most recent call last):
95
+ : File "/app/.heroku/python/bin/gunicorn", line 8, in <module>
96
+ : sys.exit(run())
97
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
98
+ : WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
99
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 228, in run
100
+ : super().run()
101
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 72, in run
102
+ : Arbiter(self).run()
103
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 229, in run
104
+ : self.halt(reason=inst.reason, exit_status=inst.exit_status)
105
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 342, in halt
106
+ : self.stop()
107
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 393, in stop
108
+ : time.sleep(0.1)
109
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
110
+ : self.reap_workers()
111
+ : File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
112
+ : raise HaltServer(reason, self.WORKER_BOOT_ERROR)
113
+ 2020-12-27T05:22:29.206571+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
114
+ 2020-12-27T05:22:29.307883+00:00 heroku[web.1]: Process exited with status 1
115
+ 2020-12-27T05:22:29.357867+00:00 heroku[web.1]: State changed from starting to crashed
116
+ 2020-12-27T05:22:41.286778+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=kyunai2.herokuapp.com request_id=cc7a5864-553c-4a66-885f-ce92e04c93a1 fwd="113.153.101.89" dyno= connect= service= status=503 bytes= protocol=https
46
117
  ```
47
-
48
-
49
-
50
118
  ### 該当のソースコード
51
119
  コードを新しくしたので新しく編集します
52
120
  app.py
@@ -98,33 +166,4 @@
98
166
  ※追記
99
167
  Procfileに問題があることが分かったのですが元の記事のようにしてもエラーが出ます
100
168
  アプリ側のこの写真のところで何かすることがありますか?
101
- ![イメージ説明](1c6bee24a6219854c78247afd216effe.png)
169
+ ![イメージ説明](1c6bee24a6219854c78247afd216effe.png)
102
-
103
- ビルドログ
104
- ```
105
- -----> Python app detected
106
- -----> Installing python-3.6.12
107
- -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
108
- -----> Installing SQLite3
109
- -----> Installing requirements with pip
110
- Collecting click==7.1.2
111
- Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
112
- Collecting Flask==1.1.2
113
- Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
114
- Collecting itsdangerous==1.1.0
115
- Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
116
- Collecting Jinja2==2.11.2
117
- Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
118
- Collecting MarkupSafe==1.1.1
119
- Downloading MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl (27 kB)
120
- Collecting Werkzeug==1.0.1
121
- Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
122
- Installing collected packages: click, MarkupSafe, Jinja2, itsdangerous, Werkzeug, Flask
123
- Successfully installed Flask-1.1.2 Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 itsdangerous-1.1.0
124
- -----> Discovering process types
125
- Procfile declares types -> web
126
- -----> Compressing...
127
- Done: 50.8M
128
- -----> Launching...
129
- Released v3
130
- https://kyunai2.herokuapp.com/ deployed to Heroku```

2

写真の追加

2020/12/27 05:51

投稿

K.K4
K.K4

スコア0

title CHANGED
File without changes
body CHANGED
@@ -67,7 +67,7 @@
67
67
  ```
68
68
  Procfile
69
69
  ```ここに言語を入力
70
- web: gunicorn app:app --log-file--
70
+ web: gunicorn app:app --log-file=-
71
71
  ```
72
72
  requirements.txt
73
73
  ```
@@ -95,6 +95,10 @@
95
95
 
96
96
  ### 補足情報(FW/ツールのバージョンなど)
97
97
  VSCode : 1.52.1
98
+ ※追記
99
+ Procfileに問題があることが分かったのですが元の記事のようにしてもエラーが出ます
100
+ アプリ側のこの写真のところで何かすることがありますか?
101
+ ![イメージ説明](1c6bee24a6219854c78247afd216effe.png)
98
102
 
99
103
  ビルドログ
100
104
  ```

1

logの追加、コードを編集

2020/12/26 14:15

投稿

K.K4
K.K4

スコア0

title CHANGED
File without changes
body CHANGED
@@ -10,14 +10,50 @@
10
10
  ![イメージ説明](575041dc2d0c7243c0106cd77f92084e.png)
11
11
  アプリをheroku openで起動しようとしたときこの画面が出てきてアプリが動きませんでした
12
12
 
13
+ ※追加情報
14
+ エラーに表記されているheroku logs --tailを実行した結果を追加します。
15
+ ```
16
+ 2020-12-26T02:34:04.067653+00:00 heroku[web.1]: State changed from crashed to starting
17
+ 2020-12-26T02:34:07.614510+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file-`
18
+ 2020-12-26T02:34:10.891718+00:00 app[web.1]: usage: gunicorn [OPTIONS] [APP_MODULE]
19
+ 2020-12-26T02:34:10.891896+00:00 app[web.1]: gunicorn: error: unrecognized arguments: --log-file-
20
+ 2020-12-26T02:34:10.956349+00:00 heroku[web.1]: Process exited with status 2
21
+ 2020-12-26T02:34:10.993342+00:00 heroku[web.1]: State changed from starting to crashed
22
+ 2020-12-26T08:17:56.820320+00:00 heroku[web.1]: State changed from crashed to starting
23
+ 2020-12-26T08:18:01.775007+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file-`
24
+ 2020-12-26T08:18:05.660571+00:00 app[web.1]: usage: gunicorn [OPTIONS] [APP_MODULE]
25
+ 2020-12-26T08:18:05.660843+00:00 app[web.1]: gunicorn: error: unrecognized arguments: --log-file-
26
+ 2020-12-26T08:18:05.777067+00:00 heroku[web.1]: Process exited with status 2
27
+ 2020-12-26T08:18:05.822263+00:00 heroku[web.1]: State changed from starting to crashed
28
+ 2020-12-26T09:37:35.000000+00:00 app[api]: Build started by user e1917034@oit.ac.jp
29
+ 2020-12-26T09:38:06.251510+00:00 app[api]: Deploy af3bf7bd by user e1917034@oit.ac.jp
30
+ 2020-12-26T09:38:06.251510+00:00 app[api]: Release v24 created by user e1917034@oit.ac.jp
31
+ 2020-12-26T09:38:06.503829+00:00 heroku[web.1]: State changed from crashed to starting
32
+ 2020-12-26T09:38:09.624324+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file-`
33
+ 2020-12-26T09:38:11.632570+00:00 app[web.1]: usage: gunicorn [OPTIONS] [APP_MODULE]
34
+ 2020-12-26T09:38:11.632747+00:00 app[web.1]: gunicorn: error: unrecognized arguments: --log-file-
35
+ 2020-12-26T09:38:11.700673+00:00 heroku[web.1]: Process exited with status 2
36
+ 2020-12-26T09:38:11.733354+00:00 heroku[web.1]: State changed from starting to crashed
37
+ 2020-12-26T09:38:11.736809+00:00 heroku[web.1]: State changed from crashed to starting
38
+ 2020-12-26T09:38:14.000000+00:00 app[api]: Build succeeded
39
+ 2020-12-26T09:38:16.990374+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file-`
40
+ 2020-12-26T09:38:20.322423+00:00 app[web.1]: usage: gunicorn [OPTIONS] [APP_MODULE]
41
+ 2020-12-26T09:38:20.322617+00:00 app[web.1]: gunicorn: error: unrecognized arguments: --log-file-
42
+ 2020-12-26T09:38:20.440422+00:00 heroku[web.1]: Process exited with status 2
43
+ 2020-12-26T09:38:20.511801+00:00 heroku[web.1]: State changed from starting to crashed
44
+ 2020-12-26T09:38:37.829571+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=kyunai2.herokuapp.com request_id=2cca9370-7b92-4b34-a666-582cb8d5e2c7 fwd="113.153.101.89" dyno= connect= service= status=503 bytes= protocol=https
45
+ 2020-12-26T09:39:03.096795+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=kyunai2.herokuapp.com request_id=275f7716-8e67-42f4-a344-fbe27483c9b1 fwd="113.153.101.89" dyno= connect= service= status=503 bytes= protocol=https
46
+ ```
13
47
 
14
48
 
49
+
15
50
  ### 該当のソースコード
51
+ コードを新しくしたので新しく編集します
16
52
  app.py
17
53
 
18
54
  ```ここに言語を入力
19
- # -*- coding: utf-8 -*-
20
55
  from flask import Flask
56
+ import os
21
57
 
22
58
  app = Flask(__name__)
23
59
 
@@ -26,21 +62,27 @@
26
62
  return 'hello, world'
27
63
 
28
64
  if __name__ == '__main__':
65
+
29
- app.run()
66
+ app.run(debug=False, host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))
30
67
  ```
68
+ Procfile
69
+ ```ここに言語を入力
70
+ web: gunicorn app:app --log-file--
71
+ ```
31
72
  requirements.txt
32
- ```ここに言語を入力
73
+ ```
33
74
  click==7.1.2
34
75
  Flask==1.1.2
76
+ gunicorn==20.0.4
35
77
  itsdangerous==1.1.0
36
78
  Jinja2==2.11.2
37
79
  MarkupSafe==1.1.1
38
80
  Werkzeug==1.0.1
39
81
  ```
40
- Procfile
82
+ runtime.txt
41
- ```ここに言語を入力
42
- web: gunicorn app:app --log-file=-
43
83
  ```
84
+ python-3.9.0
85
+ ```
44
86
  ### 試したこと
45
87
  gitに正しくアップロードされているか確認するためにgit cloneを行い、ファイルの比較を行った結果、正しくアップロードできていることが確認できました。
46
88
  また、herokuのアプリ管理画面でBuild succeededとなっていることは確認できました