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

質問編集履歴

16

2019/05/19 13:01

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
File without changes

15

2019/05/19 13:01

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -161,9 +161,10 @@
161
161
  コマンドラインでmain.pyを実行すると以下のように構文エラーが出ました。
162
162
  ```
163
163
  File "main.py", line 1
164
- Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20
165
- ^
166
- 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
167
164
 
165
+ Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
166
+
167
+ ^
168
+
168
169
  SyntaxError: invalid syntax
169
170
  ```

14

2019/05/19 12:56

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -153,4 +153,17 @@
153
153
  https://qiita.com/krocks96/items/67f7510b36945eb9689b
154
154
 
155
155
  ・作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。
156
- 解決しておうむ返しできるようにしたいです。よろしくお願いします。
156
+ 解決しておうむ返しできるようにしたいです。よろしくお願いします。
157
+
158
+
159
+
160
+ ### 追記
161
+ コマンドラインでmain.pyを実行すると以下のように構文エラーが出ました。
162
+ ```
163
+ File "main.py", line 1
164
+ Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20
165
+ ^
166
+ 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
167
+
168
+ SyntaxError: invalid syntax
169
+ ```

13

2019/05/19 12:55

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -149,10 +149,8 @@
149
149
 
150
150
 
151
151
  ### 補足情報(FW/ツールのバージョンなど)
152
- ・コードは下記サイトのSynopsisに掲載されているードをそのまま使用しています。
152
+ ・コードは下記サイトのmain.pyからピペしています。
153
+ https://qiita.com/krocks96/items/67f7510b36945eb9689b
153
154
 
154
- https://github.com/line/line-bot-sdk-python/blob/master/README.rst
155
-
156
-
157
155
  ・作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。
158
156
  解決しておうむ返しできるようにしたいです。よろしくお願いします。

12

2019/05/14 11:43

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -11,42 +11,140 @@
11
11
  エラーメッセージ
12
12
  Webhookが無効なHTTPステータスコードを返しました(期待されるステータスコードは200です)
13
13
  ```
14
+ ###使用コード
15
+ ```
16
+ from flask import Flask, request, abort
14
17
 
18
+ from linebot import (
19
+ LineBotApi, WebhookHandler
20
+ )
21
+ from linebot.exceptions import (
22
+ InvalidSignatureError
23
+ )
24
+ from linebot.models import (
25
+ MessageEvent, TextMessage, TextSendMessage,
26
+ )
27
+ import os
15
28
 
29
+ app = Flask(__name__)
30
+
31
+ #環境変数取得
32
+ YOUR_CHANNEL_ACCESS_TOKEN = os.environ["YOUR_CHANNEL_ACCESS_TOKEN"]
33
+ YOUR_CHANNEL_SECRET = os.environ["YOUR_CHANNEL_SECRET"]
34
+
35
+ line_bot_api = LineBotApi(YOUR_CHANNEL_ACCESS_TOKEN)
36
+ handler = WebhookHandler(YOUR_CHANNEL_SECRET)
37
+
38
+ @app.route("/callback", methods=['POST'])
39
+ def callback():
40
+ # get X-Line-Signature header value
41
+ signature = request.headers['X-Line-Signature']
42
+
43
+ # get request body as text
44
+ body = request.get_data(as_text=True)
45
+ app.logger.info("Request body: " + body)
46
+
47
+ # handle webhook body
48
+ try:
49
+ handler.handle(body, signature)
50
+ except InvalidSignatureError:
51
+ abort(400)
52
+
53
+ return 'OK'
54
+
55
+
56
+ @handler.add(MessageEvent, message=TextMessage)
57
+ def handle_message(event):
58
+ line_bot_api.reply_message(
59
+ event.reply_token,
60
+ TextSendMessage(text=event.message.text))
61
+
62
+
63
+ if __name__ == "__main__":
64
+ # app.run()
65
+ port = int(os.getenv("PORT", 5000))
66
+ app.run(host="0.0.0.0", port=port)
67
+
68
+ ```
16
69
  ### 最新のログ
17
70
  ```
18
- 2019-05-09T03:59:28.263448+00:00 heroku[web.1]: State changed from crashed to starting
19
- 2019-05-09T03:59:32.398475+00:00 heroku[web.1]: Starting process with command `python main.py`
20
- 2019-05-09T03:59:34.366107+00:00 heroku[web.1]: State changed from starting to crashed
21
- 2019-05-09T03:59:34.347847+00:00 heroku[web.1]: Process exited with status 2
22
- 2019-05-09T03:59:34.284405+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
23
- 2019-05-09T09:51:34.773662+00:00 heroku[web.1]: State changed from crashed to starting
24
- 2019-05-09T09:51:37.866588+00:00 heroku[web.1]: Starting process with command `python main.py`
25
- 2019-05-09T09:51:40.429885+00:00 heroku[web.1]: State changed from starting to crashed
26
- 2019-05-09T09:51:40.290618+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
27
- 2019-05-09T09:51:40.412743+00:00 heroku[web.1]: Process exited with status 2
28
- 2019-05-09T11:56:52.000000+00:00 app[api]: Build started by user アドレス
29
- 2019-05-09T11:57:13.362690+00:00 heroku[web.1]: State changed from crashed to starting
30
- 2019-05-09T11:57:13.018631+00:00 app[api]: Deploy 614befc5 by user アドレス
31
- 2019-05-09T11:57:13.018631+00:00 app[api]: Release v8 created by user アドレス
32
- 2019-05-09T11:57:16.223938+00:00 heroku[web.1]: Starting process with command `python main.py`
33
- 2019-05-09T11:57:18.868743+00:00 heroku[web.1]: State changed from starting to crashed
34
- 2019-05-09T11:57:18.876798+00:00 heroku[web.1]: State changed from crashed to starting
35
- 2019-05-09T11:57:18.748559+00:00 app[web.1]: File "main.py", line 1
36
- 2019-05-09T11:57:18.748594+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
37
- 2019-05-09T11:57:18.748608+00:00 app[web.1]: ^
38
- 2019-05-09T11:57:18.748610+00:00 app[web.1]: SyntaxError: invalid syntax
39
- 2019-05-09T11:57:18.851904+00:00 heroku[web.1]: Process exited with status 1
40
- 2019-05-09T11:57:23.373397+00:00 heroku[web.1]: Starting process with command `python main.py`
41
- 2019-05-09T11:57:21.000000+00:00 app[api]: Build succeeded
42
- 2019-05-09T11:57:25.683991+00:00 heroku[web.1]: State changed from starting to crashed
43
- 2019-05-09T11:57:25.662887+00:00 heroku[web.1]: Process exited with status 1
44
- 2019-05-09T11:57:25.590167+00:00 app[web.1]: File "main.py", line 1
45
- 2019-05-09T11:57:25.590255+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
46
- 2019-05-09T11:57:25.590507+00:00 app[web.1]: ^
47
- 2019-05-09T11:57:25.590696+00:00 app[web.1]: SyntaxError: invalid syntax
48
- 2019-05-09T11:59:49.242818+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=7e3244e0-d3d8-4bac-b8ab-9810b8f65843 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
49
- 2019-05-09T12:07:11.687622+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=4627f0d6-288e-4645-a86f-06ace892c32f fwd="203.104.156.73" dyno= connect= service= status=503 bytes= protocol=https
71
+ 2019-05-14T01:04:30.070058+00:00 heroku[web.1]: State changed from crashed to starting
72
+
73
+ 2019-05-14T01:04:33.567318+00:00 heroku[web.1]: Starting process with command `python main.py`
74
+
75
+ 2019-05-14T01:04:35.732639+00:00 heroku[web.1]: State changed from starting to crashed
76
+
77
+ 2019-05-14T01:04:35.717935+00:00 heroku[web.1]: Process exited with status 1
78
+
79
+ 2019-05-14T01:04:35.634125+00:00 app[web.1]: File "main.py", line 1
80
+
81
+ 2019-05-14T01:04:35.634167+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
82
+
83
+ 2019-05-14T01:04:35.634173+00:00 app[web.1]: ^
84
+
85
+ 2019-05-14T01:04:35.634226+00:00 app[web.1]: SyntaxError: invalid syntax
86
+
87
+ 2019-05-14T06:45:54.457762+00:00 heroku[web.1]: State changed from crashed to starting
88
+
89
+ 2019-05-14T06:45:58.905314+00:00 heroku[web.1]: Starting process with command `python main.py`
90
+
91
+ 2019-05-14T06:46:01.255307+00:00 heroku[web.1]: State changed from starting to crashed
92
+
93
+ 2019-05-14T06:46:01.239201+00:00 heroku[web.1]: Process exited with status 1
94
+
95
+ 2019-05-14T06:46:01.151287+00:00 app[web.1]: File "main.py", line 1
96
+
97
+ 2019-05-14T06:46:01.151319+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
98
+
99
+ 2019-05-14T06:46:01.151321+00:00 app[web.1]: ^
100
+
101
+ 2019-05-14T06:46:01.151323+00:00 app[web.1]: SyntaxError: invalid syntax
102
+
103
+ 2019-05-14T11:25:31.000000+00:00 app[api]: Build started by user アドレス
104
+
105
+ 2019-05-14T11:25:53.952041+00:00 heroku[web.1]: State changed from crashed to starting
106
+
107
+ 2019-05-14T11:25:53.739231+00:00 app[api]: Deploy cbdbee86 by user アドレス
108
+
109
+ 2019-05-14T11:25:53.739231+00:00 app[api]: Release v15 created by user アドレス
110
+
111
+ 2019-05-14T11:25:58.079912+00:00 heroku[web.1]: Starting process with command `python main.py`
112
+
113
+ 2019-05-14T11:26:00.176928+00:00 heroku[web.1]: State changed from starting to crashed
114
+
115
+ 2019-05-14T11:26:00.203005+00:00 heroku[web.1]: State changed from crashed to starting
116
+
117
+ 2019-05-14T11:26:00.077691+00:00 app[web.1]: File "main.py", line 1
118
+
119
+ 2019-05-14T11:26:00.077716+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
120
+
121
+ 2019-05-14T11:26:00.077718+00:00 app[web.1]: ^
122
+
123
+ 2019-05-14T11:26:00.077744+00:00 app[web.1]: SyntaxError: invalid syntax
124
+
125
+ 2019-05-14T11:26:00.129501+00:00 heroku[web.1]: Process exited with status 1
126
+
127
+ 2019-05-14T11:26:02.000000+00:00 app[api]: Build succeeded
128
+
129
+ 2019-05-14T11:26:03.449684+00:00 heroku[web.1]: Starting process with command `python main.py`
130
+
131
+ 2019-05-14T11:26:05.367169+00:00 heroku[web.1]: State changed from starting to crashed
132
+
133
+ 2019-05-14T11:26:05.350272+00:00 heroku[web.1]: Process exited with status 1
134
+
135
+ 2019-05-14T11:26:05.295818+00:00 app[web.1]: File "main.py", line 1
136
+
137
+ 2019-05-14T11:26:05.295864+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
138
+
139
+ 2019-05-14T11:26:05.295869+00:00 app[web.1]: ^
140
+
141
+ 2019-05-14T11:26:05.295873+00:00 app[web.1]: SyntaxError: invalid syntax
142
+
143
+ 2019-05-14T11:27:03.227451+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=a79d7fa3-4622-496a-9980-2ac9bb6ffab8 fwd="203.104.156.76" dyno= connect= service= status=503 bytes= protocol=https
144
+
145
+ 2019-05-14T11:27:29.111776+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名
146
+ request_id=83591001-2da1-4c47-a7ce-a15ee6ec1a22 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
147
+
50
148
  ```
51
149
 
52
150
 

11

2019/05/14 11:39

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -15,34 +15,38 @@
15
15
 
16
16
  ### 最新のログ
17
17
  ```
18
- 2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
19
- 2019-05-06T05:26:14.757275+00:00 heroku[web.1]: Starting process with command `python main.py`
20
- 2019-05-06T05:26:17.390835+00:00 heroku[web.1]: State changed from starting to crashed
21
- 2019-05-06T05:26:17.369287+00:00 heroku[web.1]: Process exited with status 1
22
- 2019-05-06T05:26:17.293490+00:00 app[web.1]: File "main.py", line 1
23
- 2019-05-06T05:26:17.293526+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
24
- 2019-05-06T05:26:17.293528+00:00 app[web.1]: ^
25
- 2019-05-06T05:26:17.293530+00:00 app[web.1]: SyntaxError: invalid syntax
26
- 2019-05-06T07:24:39.314374+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名request_id=85a40895-6a3b-447e-8b6e-2371c5ba2403 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
27
- 2019-05-06T07:26:12.058179+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=18493051-fcb6-4f62-85b0-8e20477b0376 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
28
- 2019-05-06T07:48:10.000000+00:00 app[api]: Build started by user メールアドレス
29
- 2019-05-06T07:48:26.143313+00:00 heroku[web.1]: State changed from crashed to starting
30
- 2019-05-06T07:48:25.985747+00:00 app[api]: Release v7 created by user メールアドレス
31
- 2019-05-06T07:48:25.985747+00:00 app[api]: Deploy 9c8828f0 by user メールアドレス
32
- 2019-05-06T07:48:29.146014+00:00 heroku[web.1]: Starting process with command `python main.py`
33
- 2019-05-06T07:48:30.825256+00:00 heroku[web.1]: State changed from starting to crashed
34
- 2019-05-06T07:48:30.830516+00:00 heroku[web.1]: State changed from crashed to starting
35
- 2019-05-06T07:48:30.805940+00:00 heroku[web.1]: Process exited with status 2
36
- 2019-05-06T07:48:30.744833+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
37
- 2019-05-06T07:48:34.855605+00:00 heroku[web.1]: Starting process with command `python main.py`
38
- 2019-05-06T07:48:34.000000+00:00 app[api]: Build succeeded
39
- 2019-05-06T07:48:37.248157+00:00 heroku[web.1]: State changed from starting to crashed
40
- 2019-05-06T07:48:37.229926+00:00 heroku[web.1]: Process exited with status 2
41
- 2019-05-06T07:48:37.167367+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
42
- 2019-05-06T07:53:21.173902+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名request_id=3303226c-3e9c-4109-bc59-88676f2d1bcd fwd="203.104.156.76" dyno= connect= service= status=503 bytes= protocol=https
43
- 2019-05-06T07:53:28.999181+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名request_id=340b369b-cfa0-48db-8469-856f2a51c79e fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
44
- 2019-05-06T08:07:05.139226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=1dd52879-db57-4a87-8854-d121de098251 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
45
-
18
+ 2019-05-09T03:59:28.263448+00:00 heroku[web.1]: State changed from crashed to starting
19
+ 2019-05-09T03:59:32.398475+00:00 heroku[web.1]: Starting process with command `python main.py`
20
+ 2019-05-09T03:59:34.366107+00:00 heroku[web.1]: State changed from starting to crashed
21
+ 2019-05-09T03:59:34.347847+00:00 heroku[web.1]: Process exited with status 2
22
+ 2019-05-09T03:59:34.284405+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
23
+ 2019-05-09T09:51:34.773662+00:00 heroku[web.1]: State changed from crashed to starting
24
+ 2019-05-09T09:51:37.866588+00:00 heroku[web.1]: Starting process with command `python main.py`
25
+ 2019-05-09T09:51:40.429885+00:00 heroku[web.1]: State changed from starting to crashed
26
+ 2019-05-09T09:51:40.290618+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
27
+ 2019-05-09T09:51:40.412743+00:00 heroku[web.1]: Process exited with status 2
28
+ 2019-05-09T11:56:52.000000+00:00 app[api]: Build started by user アドレス
29
+ 2019-05-09T11:57:13.362690+00:00 heroku[web.1]: State changed from crashed to starting
30
+ 2019-05-09T11:57:13.018631+00:00 app[api]: Deploy 614befc5 by user アドレス
31
+ 2019-05-09T11:57:13.018631+00:00 app[api]: Release v8 created by user アドレス
32
+ 2019-05-09T11:57:16.223938+00:00 heroku[web.1]: Starting process with command `python main.py`
33
+ 2019-05-09T11:57:18.868743+00:00 heroku[web.1]: State changed from starting to crashed
34
+ 2019-05-09T11:57:18.876798+00:00 heroku[web.1]: State changed from crashed to starting
35
+ 2019-05-09T11:57:18.748559+00:00 app[web.1]: File "main.py", line 1
36
+ 2019-05-09T11:57:18.748594+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
37
+ 2019-05-09T11:57:18.748608+00:00 app[web.1]: ^
38
+ 2019-05-09T11:57:18.748610+00:00 app[web.1]: SyntaxError: invalid syntax
39
+ 2019-05-09T11:57:18.851904+00:00 heroku[web.1]: Process exited with status 1
40
+ 2019-05-09T11:57:23.373397+00:00 heroku[web.1]: Starting process with command `python main.py`
41
+ 2019-05-09T11:57:21.000000+00:00 app[api]: Build succeeded
42
+ 2019-05-09T11:57:25.683991+00:00 heroku[web.1]: State changed from starting to crashed
43
+ 2019-05-09T11:57:25.662887+00:00 heroku[web.1]: Process exited with status 1
44
+ 2019-05-09T11:57:25.590167+00:00 app[web.1]: File "main.py", line 1
45
+ 2019-05-09T11:57:25.590255+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
46
+ 2019-05-09T11:57:25.590507+00:00 app[web.1]: ^
47
+ 2019-05-09T11:57:25.590696+00:00 app[web.1]: SyntaxError: invalid syntax
48
+ 2019-05-09T11:59:49.242818+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=7e3244e0-d3d8-4bac-b8ab-9810b8f65843 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
49
+ 2019-05-09T12:07:11.687622+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=4627f0d6-288e-4645-a86f-06ace892c32f fwd="203.104.156.73" dyno= connect= service= status=503 bytes= protocol=https
46
50
  ```
47
51
 
48
52
 

10

2019/05/11 06:21

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -23,12 +23,12 @@
23
23
  2019-05-06T05:26:17.293526+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
24
24
  2019-05-06T05:26:17.293528+00:00 app[web.1]: ^
25
25
  2019-05-06T05:26:17.293530+00:00 app[web.1]: SyntaxError: invalid syntax
26
- 2019-05-06T07:24:39.314374+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=85a40895-6a3b-447e-8b6e-2371c5ba2403 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
27
- 2019-05-06T07:26:12.058179+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=18493051-fcb6-4f62-85b0-8e20477b0376 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
28
- 2019-05-06T07:48:10.000000+00:00 app[api]: Build started by user meokhrk1109@icloud.com
26
+ 2019-05-06T07:24:39.314374+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名request_id=85a40895-6a3b-447e-8b6e-2371c5ba2403 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
27
+ 2019-05-06T07:26:12.058179+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=18493051-fcb6-4f62-85b0-8e20477b0376 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
28
+ 2019-05-06T07:48:10.000000+00:00 app[api]: Build started by user メールアドレス
29
29
  2019-05-06T07:48:26.143313+00:00 heroku[web.1]: State changed from crashed to starting
30
- 2019-05-06T07:48:25.985747+00:00 app[api]: Release v7 created by user meokhrk1109@icloud.com
30
+ 2019-05-06T07:48:25.985747+00:00 app[api]: Release v7 created by user メールアドレス
31
- 2019-05-06T07:48:25.985747+00:00 app[api]: Deploy 9c8828f0 by user meokhrk1109@icloud.com
31
+ 2019-05-06T07:48:25.985747+00:00 app[api]: Deploy 9c8828f0 by user メールアドレス
32
32
  2019-05-06T07:48:29.146014+00:00 heroku[web.1]: Starting process with command `python main.py`
33
33
  2019-05-06T07:48:30.825256+00:00 heroku[web.1]: State changed from starting to crashed
34
34
  2019-05-06T07:48:30.830516+00:00 heroku[web.1]: State changed from crashed to starting
@@ -39,9 +39,9 @@
39
39
  2019-05-06T07:48:37.248157+00:00 heroku[web.1]: State changed from starting to crashed
40
40
  2019-05-06T07:48:37.229926+00:00 heroku[web.1]: Process exited with status 2
41
41
  2019-05-06T07:48:37.167367+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
42
- 2019-05-06T07:53:21.173902+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=3303226c-3e9c-4109-bc59-88676f2d1bcd fwd="203.104.156.76" dyno= connect= service= status=503 bytes= protocol=https
43
- 2019-05-06T07:53:28.999181+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=340b369b-cfa0-48db-8469-856f2a51c79e fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
44
- 2019-05-06T08:07:05.139226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=1dd52879-db57-4a87-8854-d121de098251 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
42
+ 2019-05-06T07:53:21.173902+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名request_id=3303226c-3e9c-4109-bc59-88676f2d1bcd fwd="203.104.156.76" dyno= connect= service= status=503 bytes= protocol=https
43
+ 2019-05-06T07:53:28.999181+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名request_id=340b369b-cfa0-48db-8469-856f2a51c79e fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
44
+ 2019-05-06T08:07:05.139226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名 request_id=1dd52879-db57-4a87-8854-d121de098251 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
45
45
 
46
46
  ```
47
47
 

9

2019/05/08 12:49

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
File without changes

8

2019/05/08 12:44

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -12,9 +12,9 @@
12
12
  Webhookが無効なHTTPステータスコードを返しました(期待されるステータスコードは200です)
13
13
  ```
14
14
 
15
+
16
+ ### 最新のログ
15
17
  ```
16
- ### 最新のログ
17
-
18
18
  2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
19
19
  2019-05-06T05:26:14.757275+00:00 heroku[web.1]: Starting process with command `python main.py`
20
20
  2019-05-06T05:26:17.390835+00:00 heroku[web.1]: State changed from starting to crashed

7

2019/05/08 12:43

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -13,8 +13,8 @@
13
13
  ```
14
14
 
15
15
  ```
16
- ### 該当ソースコード
16
+ ### 最新ログ
17
- ```
17
+
18
18
  2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
19
19
  2019-05-06T05:26:14.757275+00:00 heroku[web.1]: Starting process with command `python main.py`
20
20
  2019-05-06T05:26:17.390835+00:00 heroku[web.1]: State changed from starting to crashed

6

2019/05/08 12:42

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  ```
16
16
  ### 該当のソースコード
17
-
17
+ ```
18
18
  2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
19
19
  2019-05-06T05:26:14.757275+00:00 heroku[web.1]: Starting process with command `python main.py`
20
20
  2019-05-06T05:26:17.390835+00:00 heroku[web.1]: State changed from starting to crashed
@@ -43,9 +43,9 @@
43
43
  2019-05-06T07:53:28.999181+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=340b369b-cfa0-48db-8469-856f2a51c79e fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
44
44
  2019-05-06T08:07:05.139226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=1dd52879-db57-4a87-8854-d121de098251 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
45
45
 
46
+ ```
46
47
 
47
48
 
48
-
49
49
  ### 補足情報(FW/ツールのバージョンなど)
50
50
  ・コードは下記サイトのSynopsisに掲載されているコードをそのまま使用しています。
51
51
 

5

2019/05/08 12:42

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -14,12 +14,7 @@
14
14
 
15
15
  ```
16
16
  ### 該当のソースコード
17
- 下記サイトのSynopsisに掲載されているコードをそのまま使用しています。
18
17
 
19
- https://github.com/line/line-bot-sdk-python/blob/master/README.rst
20
-
21
-
22
- ### 最新のログ
23
18
  2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
24
19
  2019-05-06T05:26:14.757275+00:00 heroku[web.1]: Starting process with command `python main.py`
25
20
  2019-05-06T05:26:17.390835+00:00 heroku[web.1]: State changed from starting to crashed
@@ -48,7 +43,14 @@
48
43
  2019-05-06T07:53:28.999181+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=340b369b-cfa0-48db-8469-856f2a51c79e fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
49
44
  2019-05-06T08:07:05.139226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=1dd52879-db57-4a87-8854-d121de098251 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
50
45
 
46
+
47
+
48
+
51
49
  ### 補足情報(FW/ツールのバージョンなど)
50
+ ・コードは下記サイトのSynopsisに掲載されているコードをそのまま使用しています。
52
51
 
52
+ https://github.com/line/line-bot-sdk-python/blob/master/README.rst
53
+
54
+
53
- 作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。
55
+ 作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。
54
56
  解決しておうむ返しできるようにしたいです。よろしくお願いします。

4

2019/05/08 12:41

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -19,6 +19,35 @@
19
19
  https://github.com/line/line-bot-sdk-python/blob/master/README.rst
20
20
 
21
21
 
22
+ ### 最新のログ
23
+ 2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
24
+ 2019-05-06T05:26:14.757275+00:00 heroku[web.1]: Starting process with command `python main.py`
25
+ 2019-05-06T05:26:17.390835+00:00 heroku[web.1]: State changed from starting to crashed
26
+ 2019-05-06T05:26:17.369287+00:00 heroku[web.1]: Process exited with status 1
27
+ 2019-05-06T05:26:17.293490+00:00 app[web.1]: File "main.py", line 1
28
+ 2019-05-06T05:26:17.293526+00:00 app[web.1]: Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
29
+ 2019-05-06T05:26:17.293528+00:00 app[web.1]: ^
30
+ 2019-05-06T05:26:17.293530+00:00 app[web.1]: SyntaxError: invalid syntax
31
+ 2019-05-06T07:24:39.314374+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=85a40895-6a3b-447e-8b6e-2371c5ba2403 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
32
+ 2019-05-06T07:26:12.058179+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=18493051-fcb6-4f62-85b0-8e20477b0376 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
33
+ 2019-05-06T07:48:10.000000+00:00 app[api]: Build started by user meokhrk1109@icloud.com
34
+ 2019-05-06T07:48:26.143313+00:00 heroku[web.1]: State changed from crashed to starting
35
+ 2019-05-06T07:48:25.985747+00:00 app[api]: Release v7 created by user meokhrk1109@icloud.com
36
+ 2019-05-06T07:48:25.985747+00:00 app[api]: Deploy 9c8828f0 by user meokhrk1109@icloud.com
37
+ 2019-05-06T07:48:29.146014+00:00 heroku[web.1]: Starting process with command `python main.py`
38
+ 2019-05-06T07:48:30.825256+00:00 heroku[web.1]: State changed from starting to crashed
39
+ 2019-05-06T07:48:30.830516+00:00 heroku[web.1]: State changed from crashed to starting
40
+ 2019-05-06T07:48:30.805940+00:00 heroku[web.1]: Process exited with status 2
41
+ 2019-05-06T07:48:30.744833+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
42
+ 2019-05-06T07:48:34.855605+00:00 heroku[web.1]: Starting process with command `python main.py`
43
+ 2019-05-06T07:48:34.000000+00:00 app[api]: Build succeeded
44
+ 2019-05-06T07:48:37.248157+00:00 heroku[web.1]: State changed from starting to crashed
45
+ 2019-05-06T07:48:37.229926+00:00 heroku[web.1]: Process exited with status 2
46
+ 2019-05-06T07:48:37.167367+00:00 app[web.1]: python: can't open file 'main.py': [Errno 2] No such file or directory
47
+ 2019-05-06T07:53:21.173902+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=3303226c-3e9c-4109-bc59-88676f2d1bcd fwd="203.104.156.76" dyno= connect= service= status=503 bytes= protocol=https
48
+ 2019-05-06T07:53:28.999181+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=340b369b-cfa0-48db-8469-856f2a51c79e fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
49
+ 2019-05-06T08:07:05.139226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=bodhisattva.herokuapp.com request_id=1dd52879-db57-4a87-8854-d121de098251 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
50
+
22
51
  ### 補足情報(FW/ツールのバージョンなど)
23
52
 
24
53
  作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。

3

2019/05/08 12:39

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -14,57 +14,11 @@
14
14
 
15
15
  ```
16
16
  ### 該当のソースコード
17
- from flask import Flask, request, abort
17
+ 下記サイトのSynopsisに掲載されているコードをそのまま使用しています。
18
18
 
19
- from linebot import (
20
- LineBotApi, WebhookHandler
21
- )
22
- from linebot.exceptions import (
23
- InvalidSignatureError
24
- )
25
- from linebot.models import (
26
- MessageEvent, TextMessage, TextSendMessage,
19
+ https://github.com/line/line-bot-sdk-python/blob/master/README.rst
27
- )
28
- import os
29
20
 
30
- app = Flask(__name__)
31
21
 
32
- YOUR_CHANNEL_ACCESS_TOKEN = os.environ["YOUR_CHANNEL_ACCESS_TOKEN"]
33
- YOUR_CHANNEL_SECRET = os.environ["YOUR_CHANNEL_SECRET"]
34
-
35
- line_bot_api = LineBotApi(YOUR_CHANNEL_ACCESS_TOKEN)
36
- handler = WebhookHandler(YOUR_CHANNEL_SECRET)
37
-
38
- @app.route("/callback", methods=['POST'])
39
- def callback():
40
- get X-Line-Signature header value
41
- signature = request.headers['X-Line-Signature']
42
-
43
- get request body as text
44
- body = request.get_data(as_text=True)
45
- app.logger.info("Request body: " + body)
46
-
47
- handle webhook body
48
- try:
49
- handler.handle(body, signature)
50
- except InvalidSignatureError:
51
- abort(400)
52
-
53
- return 'OK'
54
-
55
-
56
- @handler.add(MessageEvent, message=TextMessage)
57
- def handle_message(event):
58
- line_bot_api.reply_message(
59
- event.reply_token,
60
- TextSendMessage(text=event.message.text))
61
-
62
-
63
- if __name__ == "__main__":
64
- app.run()
65
- port = int(os.getenv("PORT", 5000))
66
- app.run(host="0.0.0.0", port=port)
67
-
68
22
  ### 補足情報(FW/ツールのバージョンなど)
69
23
 
70
24
  作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。

2

2019/05/08 12:38

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  @app.route("/callback", methods=['POST'])
39
39
  def callback():
40
- # get X-Line-Signature header value
40
+ get X-Line-Signature header value
41
41
  signature = request.headers['X-Line-Signature']
42
42
 
43
43
  get request body as text

1

2019/05/06 08:59

投稿

mavis95
mavis95

スコア13

title CHANGED
File without changes
body CHANGED
@@ -29,7 +29,6 @@
29
29
 
30
30
  app = Flask(__name__)
31
31
 
32
- #環境変数取得
33
32
  YOUR_CHANNEL_ACCESS_TOKEN = os.environ["YOUR_CHANNEL_ACCESS_TOKEN"]
34
33
  YOUR_CHANNEL_SECRET = os.environ["YOUR_CHANNEL_SECRET"]
35
34
 
@@ -41,11 +40,11 @@
41
40
  # get X-Line-Signature header value
42
41
  signature = request.headers['X-Line-Signature']
43
42
 
44
- # get request body as text
43
+ get request body as text
45
44
  body = request.get_data(as_text=True)
46
45
  app.logger.info("Request body: " + body)
47
46
 
48
- # handle webhook body
47
+ handle webhook body
49
48
  try:
50
49
  handler.handle(body, signature)
51
50
  except InvalidSignatureError:
@@ -62,7 +61,7 @@
62
61
 
63
62
 
64
63
  if __name__ == "__main__":
65
- # app.run()
64
+ app.run()
66
65
  port = int(os.getenv("PORT", 5000))
67
66
  app.run(host="0.0.0.0", port=port)
68
67