質問編集履歴

16

2019/05/19 13:01

投稿

mavis95
mavis95

スコア13

test CHANGED
File without changes
test CHANGED
File without changes

15

2019/05/19 13:01

投稿

mavis95
mavis95

スコア13

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

2019/05/19 12:56

投稿

mavis95
mavis95

スコア13

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

2019/05/19 12:55

投稿

mavis95
mavis95

スコア13

test CHANGED
File without changes
test CHANGED
@@ -300,13 +300,9 @@
300
300
 
301
301
  ### 補足情報(FW/ツールのバージョンなど)
302
302
 
303
- ・コードは下記サイトのSynopsisに掲載されているードをそのまま使用しています。
303
+ ・コードは下記サイトのmain.pyからピペしています。
304
-
305
-
306
-
304
+
307
- https://github.com/line/line-bot-sdk-python/blob/master/README.rst
305
+ https://qiita.com/krocks96/items/67f7510b36945eb9689b
308
-
309
-
310
306
 
311
307
 
312
308
 

12

2019/05/14 11:43

投稿

mavis95
mavis95

スコア13

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-09T03:59:28.263448+00:00 heroku[web.1]: State changed from crashed to starting
36
-
37
- 2019-05-09T03:59:32.398475+00:00 heroku[web.1]: Starting process with command `python main.py`
38
-
39
- 2019-05-09T03:59:34.366107+00:00 heroku[web.1]: State changed from starting to crashed
40
-
41
- 2019-05-09T03:59:34.347847+00:00 heroku[web.1]: Process exited with status 2
42
-
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
-
45
- 2019-05-09T09:51:34.773662+00:00 heroku[web.1]: State changed from crashed to starting
46
-
47
- 2019-05-09T09:51:37.866588+00:00 heroku[web.1]: Starting process with command `python main.py`
48
-
49
- 2019-05-09T09:51:40.429885+00:00 heroku[web.1]: State changed from starting to crashed
50
-
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
-
53
- 2019-05-09T09:51:40.412743+00:00 heroku[web.1]: Process exited with status 2
54
-
55
- 2019-05-09T11:56:52.000000+00:00 app[api]: Build started by user アドレス
56
-
57
- 2019-05-09T11:57:13.362690+00:00 heroku[web.1]: State changed from crashed to starting
58
-
59
- 2019-05-09T11:57:13.018631+00:00 app[api]: Deploy 614befc5 by user アドレス
60
-
61
- 2019-05-09T11:57:13.018631+00:00 app[api]: Release v8 created by user アドレス
62
-
63
- 2019-05-09T11:57:16.223938+00:00 heroku[web.1]: Starting process with command `python main.py`
64
-
65
- 2019-05-09T11:57:18.868743+00:00 heroku[web.1]: State changed from starting to crashed
66
-
67
- 2019-05-09T11:57:18.876798+00:00 heroku[web.1]: State changed from crashed to starting
68
-
69
- 2019-05-09T11:57:18.748559+00:00 app[web.1]: File "main.py", line 1
70
-
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
-
73
- 2019-05-09T11:57:18.748608+00:00 app[web.1]: ^
74
-
75
- 2019-05-09T11:57:18.748610+00:00 app[web.1]: SyntaxError: invalid syntax
76
-
77
- 2019-05-09T11:57:18.851904+00:00 heroku[web.1]: Process exited with status 1
78
-
79
- 2019-05-09T11:57:23.373397+00:00 heroku[web.1]: Starting process with command `python main.py`
80
-
81
- 2019-05-09T11:57:21.000000+00:00 app[api]: Build succeeded
82
-
83
- 2019-05-09T11:57:25.683991+00:00 heroku[web.1]: State changed from starting to crashed
84
-
85
- 2019-05-09T11:57:25.662887+00:00 heroku[web.1]: Process exited with status 1
86
-
87
- 2019-05-09T11:57:25.590167+00:00 app[web.1]: File "main.py", line 1
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
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
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

2019/05/14 11:39

投稿

mavis95
mavis95

スコア13

test CHANGED
File without changes
test CHANGED
@@ -32,61 +32,69 @@
32
32
 
33
33
  ```
34
34
 
35
- 2019-05-06T05:26:10.450616+00:00 heroku[web.1]: State changed from crashed to starting
35
+ 2019-05-09T03:59:28.263448+00:00 heroku[web.1]: State changed from crashed to starting
36
36
 
37
- 2019-05-06T05:26:14.757275+00:00 heroku[web.1]: Starting process with command `python main.py`
37
+ 2019-05-09T03:59:32.398475+00:00 heroku[web.1]: Starting process with command `python main.py`
38
38
 
39
- 2019-05-06T05:26:17.390835+00:00 heroku[web.1]: State changed from starting to crashed
39
+ 2019-05-09T03:59:34.366107+00:00 heroku[web.1]: State changed from starting to crashed
40
40
 
41
- 2019-05-06T05:26:17.369287+00:00 heroku[web.1]: Process exited with status 1
41
+ 2019-05-09T03:59:34.347847+00:00 heroku[web.1]: Process exited with status 2
42
42
 
43
- 2019-05-06T05:26:17.293490+00:00 app[web.1]: File "main.py", line 1
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-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
45
+ 2019-05-09T09:51:34.773662+00:00 heroku[web.1]: State changed from crashed to starting
46
46
 
47
- 2019-05-06T05:26:17.293528+00:00 app[web.1]: ^
47
+ 2019-05-09T09:51:37.866588+00:00 heroku[web.1]: Starting process with command `python main.py`
48
48
 
49
- 2019-05-06T05:26:17.293530+00:00 app[web.1]: SyntaxError: invalid syntax
49
+ 2019-05-09T09:51:40.429885+00:00 heroku[web.1]: State changed from starting to crashed
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=アプリ名request_id=85a40895-6a3b-447e-8b6e-2371c5ba2403 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
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-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
53
+ 2019-05-09T09:51:40.412743+00:00 heroku[web.1]: Process exited with status 2
54
54
 
55
- 2019-05-06T07:48:10.000000+00:00 app[api]: Build started by user メールアドレス
55
+ 2019-05-09T11:56:52.000000+00:00 app[api]: Build started by user アドレス
56
56
 
57
- 2019-05-06T07:48:26.143313+00:00 heroku[web.1]: State changed from crashed to starting
57
+ 2019-05-09T11:57:13.362690+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-09T11:57:13.018631+00:00 app[api]: Deploy 614befc5 by user アドレス
60
60
 
61
- 2019-05-06T07:48:25.985747+00:00 app[api]: Deploy 9c8828f0 by user メールアドレス
61
+ 2019-05-09T11:57:13.018631+00:00 app[api]: Release v8 created by user アドレス
62
62
 
63
- 2019-05-06T07:48:29.146014+00:00 heroku[web.1]: Starting process with command `python main.py`
63
+ 2019-05-09T11:57:16.223938+00:00 heroku[web.1]: Starting process with command `python main.py`
64
64
 
65
- 2019-05-06T07:48:30.825256+00:00 heroku[web.1]: State changed from starting to crashed
65
+ 2019-05-09T11:57:18.868743+00:00 heroku[web.1]: State changed from starting to crashed
66
66
 
67
- 2019-05-06T07:48:30.830516+00:00 heroku[web.1]: State changed from crashed to starting
67
+ 2019-05-09T11:57:18.876798+00:00 heroku[web.1]: State changed from crashed to starting
68
68
 
69
- 2019-05-06T07:48:30.805940+00:00 heroku[web.1]: Process exited with status 2
69
+ 2019-05-09T11:57:18.748559+00:00 app[web.1]: File "main.py", line 1
70
70
 
71
- 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
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-06T07:48:34.855605+00:00 heroku[web.1]: Starting process with command `python main.py`
73
+ 2019-05-09T11:57:18.748608+00:00 app[web.1]: ^
74
74
 
75
- 2019-05-06T07:48:34.000000+00:00 app[api]: Build succeeded
75
+ 2019-05-09T11:57:18.748610+00:00 app[web.1]: SyntaxError: invalid syntax
76
76
 
77
- 2019-05-06T07:48:37.248157+00:00 heroku[web.1]: State changed from starting to crashed
77
+ 2019-05-09T11:57:18.851904+00:00 heroku[web.1]: Process exited with status 1
78
78
 
79
- 2019-05-06T07:48:37.229926+00:00 heroku[web.1]: Process exited with status 2
79
+ 2019-05-09T11:57:23.373397+00:00 heroku[web.1]: Starting process with command `python main.py`
80
80
 
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
81
+ 2019-05-09T11:57:21.000000+00:00 app[api]: Build succeeded
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=アプリ名request_id=3303226c-3e9c-4109-bc59-88676f2d1bcd fwd="203.104.156.76" dyno= connect= service= status=503 bytes= protocol=https
83
+ 2019-05-09T11:57:25.683991+00:00 heroku[web.1]: State changed from starting to crashed
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=アプリ名request_id=340b369b-cfa0-48db-8469-856f2a51c79e fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
85
+ 2019-05-09T11:57:25.662887+00:00 heroku[web.1]: Process exited with status 1
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=アプリ名 request_id=1dd52879-db57-4a87-8854-d121de098251 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
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

2019/05/11 06:21

投稿

mavis95
mavis95

スコア13

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=bodhisattva.herokuapp.com request_id=85a40895-6a3b-447e-8b6e-2371c5ba2403 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
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=bodhisattva.herokuapp.com request_id=18493051-fcb6-4f62-85b0-8e20477b0376 fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
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 meokhrk1109@icloud.com
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 meokhrk1109@icloud.com
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 meokhrk1109@icloud.com
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=bodhisattva.herokuapp.com request_id=3303226c-3e9c-4109-bc59-88676f2d1bcd fwd="203.104.156.76" dyno= connect= service= status=503 bytes= protocol=https
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=bodhisattva.herokuapp.com request_id=340b369b-cfa0-48db-8469-856f2a51c79e fwd="147.92.149.166" dyno= connect= service= status=503 bytes= protocol=https
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=bodhisattva.herokuapp.com request_id=1dd52879-db57-4a87-8854-d121de098251 fwd="203.104.156.75" dyno= connect= service= status=503 bytes= protocol=https
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

2019/05/08 12:49

投稿

mavis95
mavis95

スコア13

test CHANGED
File without changes
test CHANGED
File without changes

8

2019/05/08 12:44

投稿

mavis95
mavis95

スコア13

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

2019/05/08 12:43

投稿

mavis95
mavis95

スコア13

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

2019/05/08 12:42

投稿

mavis95
mavis95

スコア13

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

2019/05/08 12:42

投稿

mavis95
mavis95

スコア13

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

2019/05/08 12:41

投稿

mavis95
mavis95

スコア13

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

2019/05/08 12:39

投稿

mavis95
mavis95

スコア13

test CHANGED
File without changes
test CHANGED
@@ -30,105 +30,13 @@
30
30
 
31
31
  ### 該当のソースコード
32
32
 
33
- from flask import Flask, request, abort
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
- MessageEvent, TextMessage, TextSendMessage,
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

2019/05/08 12:38

投稿

mavis95
mavis95

スコア13

test CHANGED
File without changes
test CHANGED
@@ -76,7 +76,7 @@
76
76
 
77
77
  def callback():
78
78
 
79
- # get X-Line-Signature header value
79
+ get X-Line-Signature header value
80
80
 
81
81
  signature = request.headers['X-Line-Signature']
82
82
 

1

2019/05/06 08:59

投稿

mavis95
mavis95

スコア13

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
- # get request body as text
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
- # handle webhook body
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
- # app.run()
127
+ app.run()
130
128
 
131
129
  port = int(os.getenv("PORT", 5000))
132
130