質問編集履歴
16
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
15
test
CHANGED
File without changes
|
test
CHANGED
@@ -324,11 +324,13 @@
|
|
324
324
|
|
325
325
|
File "main.py", line 1
|
326
326
|
|
327
|
+
|
328
|
+
|
327
|
-
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20
|
329
|
+
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
|
328
|
-
|
330
|
+
|
331
|
+
|
332
|
+
|
329
|
-
|
333
|
+
^
|
330
|
-
|
331
|
-
2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
|
332
334
|
|
333
335
|
|
334
336
|
|
14
test
CHANGED
File without changes
|
test
CHANGED
@@ -309,3 +309,29 @@
|
|
309
309
|
・作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。
|
310
310
|
|
311
311
|
解決しておうむ返しできるようにしたいです。よろしくお願いします。
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
### 追記
|
320
|
+
|
321
|
+
コマンドラインでmain.pyを実行すると以下のように構文エラーが出ました。
|
322
|
+
|
323
|
+
```
|
324
|
+
|
325
|
+
File "main.py", line 1
|
326
|
+
|
327
|
+
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20
|
328
|
+
|
329
|
+
^
|
330
|
+
|
331
|
+
2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
SyntaxError: invalid syntax
|
336
|
+
|
337
|
+
```
|
13
test
CHANGED
File without changes
|
test
CHANGED
@@ -300,13 +300,9 @@
|
|
300
300
|
|
301
301
|
### 補足情報(FW/ツールのバージョンなど)
|
302
302
|
|
303
|
-
・コードは下記サイトの
|
303
|
+
・コードは下記サイトのmain.pyからコピペしています。
|
304
|
-
|
305
|
-
|
306
|
-
|
304
|
+
|
307
|
-
https://
|
305
|
+
https://qiita.com/krocks96/items/67f7510b36945eb9689b
|
308
|
-
|
309
|
-
|
310
306
|
|
311
307
|
|
312
308
|
|
12
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,77 +24,273 @@
|
|
24
24
|
|
25
25
|
```
|
26
26
|
|
27
|
-
|
27
|
+
###使用コード
|
28
|
+
|
28
|
-
|
29
|
+
```
|
30
|
+
|
29
|
-
|
31
|
+
from flask import Flask, request, abort
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
from linebot import (
|
36
|
+
|
37
|
+
LineBotApi, WebhookHandler
|
38
|
+
|
39
|
+
)
|
40
|
+
|
41
|
+
from linebot.exceptions import (
|
42
|
+
|
43
|
+
InvalidSignatureError
|
44
|
+
|
45
|
+
)
|
46
|
+
|
47
|
+
from linebot.models import (
|
48
|
+
|
49
|
+
MessageEvent, TextMessage, TextSendMessage,
|
50
|
+
|
51
|
+
)
|
52
|
+
|
53
|
+
import os
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
app = Flask(__name__)
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
#環境変数取得
|
62
|
+
|
63
|
+
YOUR_CHANNEL_ACCESS_TOKEN = os.environ["YOUR_CHANNEL_ACCESS_TOKEN"]
|
64
|
+
|
65
|
+
YOUR_CHANNEL_SECRET = os.environ["YOUR_CHANNEL_SECRET"]
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
line_bot_api = LineBotApi(YOUR_CHANNEL_ACCESS_TOKEN)
|
70
|
+
|
71
|
+
handler = WebhookHandler(YOUR_CHANNEL_SECRET)
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
@app.route("/callback", methods=['POST'])
|
76
|
+
|
77
|
+
def callback():
|
78
|
+
|
79
|
+
# get X-Line-Signature header value
|
80
|
+
|
81
|
+
signature = request.headers['X-Line-Signature']
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
# get request body as text
|
86
|
+
|
87
|
+
body = request.get_data(as_text=True)
|
88
|
+
|
89
|
+
app.logger.info("Request body: " + body)
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
# handle webhook body
|
94
|
+
|
95
|
+
try:
|
96
|
+
|
97
|
+
handler.handle(body, signature)
|
98
|
+
|
99
|
+
except InvalidSignatureError:
|
100
|
+
|
101
|
+
abort(400)
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
return 'OK'
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
@handler.add(MessageEvent, message=TextMessage)
|
112
|
+
|
113
|
+
def handle_message(event):
|
114
|
+
|
115
|
+
line_bot_api.reply_message(
|
116
|
+
|
117
|
+
event.reply_token,
|
118
|
+
|
119
|
+
TextSendMessage(text=event.message.text))
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
if __name__ == "__main__":
|
126
|
+
|
127
|
+
# app.run()
|
128
|
+
|
129
|
+
port = int(os.getenv("PORT", 5000))
|
130
|
+
|
131
|
+
app.run(host="0.0.0.0", port=port)
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
```
|
30
136
|
|
31
137
|
### 最新のログ
|
32
138
|
|
33
139
|
```
|
34
140
|
|
35
|
-
2019-05-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
2019-05-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
2019-05-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
2019-05-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
2019-05-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
2019-05-0
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
2019-05-0
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
2019-05-0
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
2019-05-0
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
2019-05-0
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
2019-05-0
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
2019-05-0
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
2019-05-0
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
2019-05-0
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
2019-05-0
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
2019-05-0
|
96
|
-
|
97
|
-
|
141
|
+
2019-05-14T01:04:30.070058+00:00 heroku[web.1]: State changed from crashed to starting
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
2019-05-14T01:04:33.567318+00:00 heroku[web.1]: Starting process with command `python main.py`
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
2019-05-14T01:04:35.732639+00:00 heroku[web.1]: State changed from starting to crashed
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
2019-05-14T01:04:35.717935+00:00 heroku[web.1]: Process exited with status 1
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
2019-05-14T01:04:35.634125+00:00 app[web.1]: File "main.py", line 1
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
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
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
2019-05-14T01:04:35.634173+00:00 app[web.1]: ^
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
2019-05-14T01:04:35.634226+00:00 app[web.1]: SyntaxError: invalid syntax
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
2019-05-14T06:45:54.457762+00:00 heroku[web.1]: State changed from crashed to starting
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
2019-05-14T06:45:58.905314+00:00 heroku[web.1]: Starting process with command `python main.py`
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
2019-05-14T06:46:01.255307+00:00 heroku[web.1]: State changed from starting to crashed
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
2019-05-14T06:46:01.239201+00:00 heroku[web.1]: Process exited with status 1
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
2019-05-14T06:46:01.151287+00:00 app[web.1]: File "main.py", line 1
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
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
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
2019-05-14T06:46:01.151321+00:00 app[web.1]: ^
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
2019-05-14T06:46:01.151323+00:00 app[web.1]: SyntaxError: invalid syntax
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
2019-05-14T11:25:31.000000+00:00 app[api]: Build started by user アドレス
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
2019-05-14T11:25:53.952041+00:00 heroku[web.1]: State changed from crashed to starting
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
2019-05-14T11:25:53.739231+00:00 app[api]: Deploy cbdbee86 by user アドレス
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
2019-05-14T11:25:53.739231+00:00 app[api]: Release v15 created by user アドレス
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
2019-05-14T11:25:58.079912+00:00 heroku[web.1]: Starting process with command `python main.py`
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
2019-05-14T11:26:00.176928+00:00 heroku[web.1]: State changed from starting to crashed
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
2019-05-14T11:26:00.203005+00:00 heroku[web.1]: State changed from crashed to starting
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
2019-05-14T11:26:00.077691+00:00 app[web.1]: File "main.py", line 1
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
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
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
2019-05-14T11:26:00.077718+00:00 app[web.1]: ^
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
2019-05-14T11:26:00.077744+00:00 app[web.1]: SyntaxError: invalid syntax
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
2019-05-14T11:26:00.129501+00:00 heroku[web.1]: Process exited with status 1
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
2019-05-14T11:26:02.000000+00:00 app[api]: Build succeeded
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
2019-05-14T11:26:03.449684+00:00 heroku[web.1]: Starting process with command `python main.py`
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
2019-05-14T11:26:05.367169+00:00 heroku[web.1]: State changed from starting to crashed
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
2019-05-14T11:26:05.350272+00:00 heroku[web.1]: Process exited with status 1
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
2019-05-14T11:26:05.295818+00:00 app[web.1]: File "main.py", line 1
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
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
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
2019-05-14T11:26:05.295869+00:00 app[web.1]: ^
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
2019-05-14T11:26:05.295873+00:00 app[web.1]: SyntaxError: invalid syntax
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
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
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
2019-05-14T11:27:29.111776+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=アプリ名
|
290
|
+
|
291
|
+
request_id=83591001-2da1-4c47-a7ce-a15ee6ec1a22 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
|
292
|
+
|
293
|
+
|
98
294
|
|
99
295
|
```
|
100
296
|
|
11
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,61 +32,69 @@
|
|
32
32
|
|
33
33
|
```
|
34
34
|
|
35
|
-
2019-05-0
|
35
|
+
2019-05-09T03:59:28.263448+00:00 heroku[web.1]: State changed from crashed to starting
|
36
36
|
|
37
|
-
2019-05-0
|
37
|
+
2019-05-09T03:59:32.398475+00:00 heroku[web.1]: Starting process with command `python main.py`
|
38
38
|
|
39
|
-
2019-05-0
|
39
|
+
2019-05-09T03:59:34.366107+00:00 heroku[web.1]: State changed from starting to crashed
|
40
40
|
|
41
|
-
2019-05-0
|
41
|
+
2019-05-09T03:59:34.347847+00:00 heroku[web.1]: Process exited with status 2
|
42
42
|
|
43
|
-
2019-05-0
|
43
|
+
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
|
44
44
|
|
45
|
-
2019-05-0
|
45
|
+
2019-05-09T09:51:34.773662+00:00 heroku[web.1]: State changed from crashed to starting
|
46
46
|
|
47
|
-
2019-05-0
|
47
|
+
2019-05-09T09:51:37.866588+00:00 heroku[web.1]: Starting process with command `python main.py`
|
48
48
|
|
49
|
-
2019-05-0
|
49
|
+
2019-05-09T09:51:40.429885+00:00 heroku[web.1]: State changed from starting to crashed
|
50
50
|
|
51
|
-
2019-05-0
|
51
|
+
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
|
52
52
|
|
53
|
-
2019-05-0
|
53
|
+
2019-05-09T09:51:40.412743+00:00 heroku[web.1]: Process exited with status 2
|
54
54
|
|
55
|
-
2019-05-0
|
55
|
+
2019-05-09T11:56:52.000000+00:00 app[api]: Build started by user アドレス
|
56
56
|
|
57
|
-
2019-05-0
|
57
|
+
2019-05-09T11:57:13.362690+00:00 heroku[web.1]: State changed from crashed to starting
|
58
58
|
|
59
|
-
2019-05-0
|
59
|
+
2019-05-09T11:57:13.018631+00:00 app[api]: Deploy 614befc5 by user アドレス
|
60
60
|
|
61
|
-
2019-05-0
|
61
|
+
2019-05-09T11:57:13.018631+00:00 app[api]: Release v8 created by user アドレス
|
62
62
|
|
63
|
-
2019-05-0
|
63
|
+
2019-05-09T11:57:16.223938+00:00 heroku[web.1]: Starting process with command `python main.py`
|
64
64
|
|
65
|
-
2019-05-0
|
65
|
+
2019-05-09T11:57:18.868743+00:00 heroku[web.1]: State changed from starting to crashed
|
66
66
|
|
67
|
-
2019-05-0
|
67
|
+
2019-05-09T11:57:18.876798+00:00 heroku[web.1]: State changed from crashed to starting
|
68
68
|
|
69
|
-
2019-05-0
|
69
|
+
2019-05-09T11:57:18.748559+00:00 app[web.1]: File "main.py", line 1
|
70
70
|
|
71
|
-
2019-05-0
|
71
|
+
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
|
72
72
|
|
73
|
-
2019-05-0
|
73
|
+
2019-05-09T11:57:18.748608+00:00 app[web.1]: ^
|
74
74
|
|
75
|
-
2019-05-0
|
75
|
+
2019-05-09T11:57:18.748610+00:00 app[web.1]: SyntaxError: invalid syntax
|
76
76
|
|
77
|
-
2019-05-0
|
77
|
+
2019-05-09T11:57:18.851904+00:00 heroku[web.1]: Process exited with status 1
|
78
78
|
|
79
|
-
2019-05-0
|
79
|
+
2019-05-09T11:57:23.373397+00:00 heroku[web.1]: Starting process with command `python main.py`
|
80
80
|
|
81
|
-
2019-05-0
|
81
|
+
2019-05-09T11:57:21.000000+00:00 app[api]: Build succeeded
|
82
82
|
|
83
|
-
2019-05-0
|
83
|
+
2019-05-09T11:57:25.683991+00:00 heroku[web.1]: State changed from starting to crashed
|
84
84
|
|
85
|
-
2019-05-0
|
85
|
+
2019-05-09T11:57:25.662887+00:00 heroku[web.1]: Process exited with status 1
|
86
86
|
|
87
|
-
2019-05-0
|
87
|
+
2019-05-09T11:57:25.590167+00:00 app[web.1]: File "main.py", line 1
|
88
88
|
|
89
|
+
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
|
89
90
|
|
91
|
+
2019-05-09T11:57:25.590507+00:00 app[web.1]: ^
|
92
|
+
|
93
|
+
2019-05-09T11:57:25.590696+00:00 app[web.1]: SyntaxError: invalid syntax
|
94
|
+
|
95
|
+
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
|
96
|
+
|
97
|
+
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
|
90
98
|
|
91
99
|
```
|
92
100
|
|
10
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,17 +48,17 @@
|
|
48
48
|
|
49
49
|
2019-05-06T05:26:17.293530+00:00 app[web.1]: SyntaxError: invalid syntax
|
50
50
|
|
51
|
-
2019-05-06T07:24:39.314374+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=
|
51
|
+
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
|
52
52
|
|
53
|
-
2019-05-06T07:26:12.058179+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=
|
53
|
+
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
|
54
54
|
|
55
|
-
2019-05-06T07:48:10.000000+00:00 app[api]: Build started by user
|
55
|
+
2019-05-06T07:48:10.000000+00:00 app[api]: Build started by user メールアドレス
|
56
56
|
|
57
57
|
2019-05-06T07:48:26.143313+00:00 heroku[web.1]: State changed from crashed to starting
|
58
58
|
|
59
|
-
2019-05-06T07:48:25.985747+00:00 app[api]: Release v7 created by user
|
59
|
+
2019-05-06T07:48:25.985747+00:00 app[api]: Release v7 created by user メールアドレス
|
60
60
|
|
61
|
-
2019-05-06T07:48:25.985747+00:00 app[api]: Deploy 9c8828f0 by user
|
61
|
+
2019-05-06T07:48:25.985747+00:00 app[api]: Deploy 9c8828f0 by user メールアドレス
|
62
62
|
|
63
63
|
2019-05-06T07:48:29.146014+00:00 heroku[web.1]: Starting process with command `python main.py`
|
64
64
|
|
@@ -80,11 +80,11 @@
|
|
80
80
|
|
81
81
|
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
|
82
82
|
|
83
|
-
2019-05-06T07:53:21.173902+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=
|
83
|
+
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
|
84
84
|
|
85
|
-
2019-05-06T07:53:28.999181+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=
|
85
|
+
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
|
86
86
|
|
87
|
-
2019-05-06T08:07:05.139226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/callback" host=
|
87
|
+
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
|
88
88
|
|
89
89
|
|
90
90
|
|
9
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
8
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,11 +26,11 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
|
29
|
+
|
30
30
|
|
31
31
|
### 最新のログ
|
32
32
|
|
33
|
-
|
33
|
+
```
|
34
34
|
|
35
35
|
2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
|
36
36
|
|
7
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,9 +28,9 @@
|
|
28
28
|
|
29
29
|
```
|
30
30
|
|
31
|
-
###
|
31
|
+
### 最新のログ
|
32
32
|
|
33
|
-
|
33
|
+
|
34
34
|
|
35
35
|
2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
|
36
36
|
|
6
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
### 該当のソースコード
|
32
32
|
|
33
|
-
|
33
|
+
```
|
34
34
|
|
35
35
|
2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
|
36
36
|
|
@@ -88,7 +88,7 @@
|
|
88
88
|
|
89
89
|
|
90
90
|
|
91
|
-
|
91
|
+
```
|
92
92
|
|
93
93
|
|
94
94
|
|
5
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,17 +30,7 @@
|
|
30
30
|
|
31
31
|
### 該当のソースコード
|
32
32
|
|
33
|
-
下記サイトのSynopsisに掲載されているコードをそのまま使用しています。
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
https://github.com/line/line-bot-sdk-python/blob/master/README.rst
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
### 最新のログ
|
44
34
|
|
45
35
|
2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
|
46
36
|
|
@@ -98,10 +88,24 @@
|
|
98
88
|
|
99
89
|
|
100
90
|
|
101
|
-
### 補足情報(FW/ツールのバージョンなど)
|
102
91
|
|
103
92
|
|
104
93
|
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
### 補足情報(FW/ツールのバージョンなど)
|
98
|
+
|
99
|
+
・コードは下記サイトのSynopsisに掲載されているコードをそのまま使用しています。
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
https://github.com/line/line-bot-sdk-python/blob/master/README.rst
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
105
|
-
作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。
|
109
|
+
・作成したアプリケーションのURLをブラウザで検索するとApplication errorと表示されます。
|
106
110
|
|
107
111
|
解決しておうむ返しできるようにしたいです。よろしくお願いします。
|
4
test
CHANGED
File without changes
|
test
CHANGED
@@ -40,6 +40,64 @@
|
|
40
40
|
|
41
41
|
|
42
42
|
|
43
|
+
### 最新のログ
|
44
|
+
|
45
|
+
2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
|
46
|
+
|
47
|
+
2019-05-06T05:26:14.757275+00:00 heroku[web.1]: Starting process with command `python main.py`
|
48
|
+
|
49
|
+
2019-05-06T05:26:17.390835+00:00 heroku[web.1]: State changed from starting to crashed
|
50
|
+
|
51
|
+
2019-05-06T05:26:17.369287+00:00 heroku[web.1]: Process exited with status 1
|
52
|
+
|
53
|
+
2019-05-06T05:26:17.293490+00:00 app[web.1]: File "main.py", line 1
|
54
|
+
|
55
|
+
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
|
56
|
+
|
57
|
+
2019-05-06T05:26:17.293528+00:00 app[web.1]: ^
|
58
|
+
|
59
|
+
2019-05-06T05:26:17.293530+00:00 app[web.1]: SyntaxError: invalid syntax
|
60
|
+
|
61
|
+
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
|
62
|
+
|
63
|
+
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
|
64
|
+
|
65
|
+
2019-05-06T07:48:10.000000+00:00 app[api]: Build started by user meokhrk1109@icloud.com
|
66
|
+
|
67
|
+
2019-05-06T07:48:26.143313+00:00 heroku[web.1]: State changed from crashed to starting
|
68
|
+
|
69
|
+
2019-05-06T07:48:25.985747+00:00 app[api]: Release v7 created by user meokhrk1109@icloud.com
|
70
|
+
|
71
|
+
2019-05-06T07:48:25.985747+00:00 app[api]: Deploy 9c8828f0 by user meokhrk1109@icloud.com
|
72
|
+
|
73
|
+
2019-05-06T07:48:29.146014+00:00 heroku[web.1]: Starting process with command `python main.py`
|
74
|
+
|
75
|
+
2019-05-06T07:48:30.825256+00:00 heroku[web.1]: State changed from starting to crashed
|
76
|
+
|
77
|
+
2019-05-06T07:48:30.830516+00:00 heroku[web.1]: State changed from crashed to starting
|
78
|
+
|
79
|
+
2019-05-06T07:48:30.805940+00:00 heroku[web.1]: Process exited with status 2
|
80
|
+
|
81
|
+
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
|
82
|
+
|
83
|
+
2019-05-06T07:48:34.855605+00:00 heroku[web.1]: Starting process with command `python main.py`
|
84
|
+
|
85
|
+
2019-05-06T07:48:34.000000+00:00 app[api]: Build succeeded
|
86
|
+
|
87
|
+
2019-05-06T07:48:37.248157+00:00 heroku[web.1]: State changed from starting to crashed
|
88
|
+
|
89
|
+
2019-05-06T07:48:37.229926+00:00 heroku[web.1]: Process exited with status 2
|
90
|
+
|
91
|
+
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
|
92
|
+
|
93
|
+
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
|
94
|
+
|
95
|
+
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
|
96
|
+
|
97
|
+
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
|
98
|
+
|
99
|
+
|
100
|
+
|
43
101
|
### 補足情報(FW/ツールのバージョンなど)
|
44
102
|
|
45
103
|
|
3
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,105 +30,13 @@
|
|
30
30
|
|
31
31
|
### 該当のソースコード
|
32
32
|
|
33
|
-
|
33
|
+
下記サイトのSynopsisに掲載されているコードをそのまま使用しています。
|
34
34
|
|
35
35
|
|
36
36
|
|
37
|
-
from linebot import (
|
38
|
-
|
39
|
-
LineBotApi, WebhookHandler
|
40
|
-
|
41
|
-
)
|
42
|
-
|
43
|
-
from linebot.exceptions import (
|
44
|
-
|
45
|
-
InvalidSignatureError
|
46
|
-
|
47
|
-
)
|
48
|
-
|
49
|
-
from linebot.models import (
|
50
|
-
|
51
|
-
|
37
|
+
https://github.com/line/line-bot-sdk-python/blob/master/README.rst
|
52
|
-
|
53
|
-
)
|
54
|
-
|
55
|
-
import os
|
56
38
|
|
57
39
|
|
58
|
-
|
59
|
-
app = Flask(__name__)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
YOUR_CHANNEL_ACCESS_TOKEN = os.environ["YOUR_CHANNEL_ACCESS_TOKEN"]
|
64
|
-
|
65
|
-
YOUR_CHANNEL_SECRET = os.environ["YOUR_CHANNEL_SECRET"]
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
line_bot_api = LineBotApi(YOUR_CHANNEL_ACCESS_TOKEN)
|
70
|
-
|
71
|
-
handler = WebhookHandler(YOUR_CHANNEL_SECRET)
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
@app.route("/callback", methods=['POST'])
|
76
|
-
|
77
|
-
def callback():
|
78
|
-
|
79
|
-
get X-Line-Signature header value
|
80
|
-
|
81
|
-
signature = request.headers['X-Line-Signature']
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
get request body as text
|
86
|
-
|
87
|
-
body = request.get_data(as_text=True)
|
88
|
-
|
89
|
-
app.logger.info("Request body: " + body)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
handle webhook body
|
94
|
-
|
95
|
-
try:
|
96
|
-
|
97
|
-
handler.handle(body, signature)
|
98
|
-
|
99
|
-
except InvalidSignatureError:
|
100
|
-
|
101
|
-
abort(400)
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
return 'OK'
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
@handler.add(MessageEvent, message=TextMessage)
|
112
|
-
|
113
|
-
def handle_message(event):
|
114
|
-
|
115
|
-
line_bot_api.reply_message(
|
116
|
-
|
117
|
-
event.reply_token,
|
118
|
-
|
119
|
-
TextSendMessage(text=event.message.text))
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
if __name__ == "__main__":
|
126
|
-
|
127
|
-
app.run()
|
128
|
-
|
129
|
-
port = int(os.getenv("PORT", 5000))
|
130
|
-
|
131
|
-
app.run(host="0.0.0.0", port=port)
|
132
40
|
|
133
41
|
|
134
42
|
|
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -76,7 +76,7 @@
|
|
76
76
|
|
77
77
|
def callback():
|
78
78
|
|
79
|
-
|
79
|
+
get X-Line-Signature header value
|
80
80
|
|
81
81
|
signature = request.headers['X-Line-Signature']
|
82
82
|
|
1
test
CHANGED
File without changes
|
test
CHANGED
@@ -60,8 +60,6 @@
|
|
60
60
|
|
61
61
|
|
62
62
|
|
63
|
-
#環境変数取得
|
64
|
-
|
65
63
|
YOUR_CHANNEL_ACCESS_TOKEN = os.environ["YOUR_CHANNEL_ACCESS_TOKEN"]
|
66
64
|
|
67
65
|
YOUR_CHANNEL_SECRET = os.environ["YOUR_CHANNEL_SECRET"]
|
@@ -84,7 +82,7 @@
|
|
84
82
|
|
85
83
|
|
86
84
|
|
87
|
-
|
85
|
+
get request body as text
|
88
86
|
|
89
87
|
body = request.get_data(as_text=True)
|
90
88
|
|
@@ -92,7 +90,7 @@
|
|
92
90
|
|
93
91
|
|
94
92
|
|
95
|
-
|
93
|
+
handle webhook body
|
96
94
|
|
97
95
|
try:
|
98
96
|
|
@@ -126,7 +124,7 @@
|
|
126
124
|
|
127
125
|
if __name__ == "__main__":
|
128
126
|
|
129
|
-
|
127
|
+
app.run()
|
130
128
|
|
131
129
|
port = int(os.getenv("PORT", 5000))
|
132
130
|
|