質問編集履歴

4

質問内容を修正しました。

2019/12/26 05:35

投稿

raspypy
raspypy

スコア247

test CHANGED
File without changes
test CHANGED
@@ -63,160 +63,6 @@
63
63
 
64
64
 
65
65
  ```
66
-
67
-
68
-
69
- ##LINE Developers Webhook確認テスト画面
70
-
71
- **webhookにURLを入力(コピー)して"Verify"を実行すると、次の画面になります。**
72
-
73
- ![イメージ説明](f4dee44749c43891deb8295b916a01f5.png)
74
-
75
- **次の画面の時もあります**
76
-
77
- ![イメージ説明](92b03a5547e819d287d84e39ea2730bf.png)
78
-
79
-
80
-
81
- ##エラー情報
82
-
83
- webhookによる認証の途中で、pythonプログラムを実行しているコンソール画面に次のエラーが表示されました。
84
-
85
-
86
-
87
- ```text
88
-
89
- pi@raspberrypi:~/dev/line-bot-sdk-python-master/examples/flask-kitchensink $ python app.py
90
-
91
- * Serving Flask app "app" (lazy loading)
92
-
93
- * Environment: production
94
-
95
- WARNING: Do not use the development server in a production environment.
96
-
97
- Use a production WSGI server instead.
98
-
99
- * Debug mode: off
100
-
101
- * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
102
-
103
- [2019-12-24 16:00:45,495] ERROR in app: Exception on /callback [POST]
104
-
105
- Traceback (most recent call last):
106
-
107
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app
108
-
109
- response = self.full_dispatch_request()
110
-
111
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1815, in full_dispatch_request
112
-
113
- rv = self.handle_user_exception(e)
114
-
115
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1718, in handle_user_exception
116
-
117
- reraise(exc_type, exc_value, tb)
118
-
119
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1813, in full_dispatch_request
120
-
121
- rv = self.dispatch_request()
122
-
123
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1799, in dispatch_request
124
-
125
- return self.view_functions[rule.endpoint](**req.view_args)
126
-
127
- File "app.py", line 35, in callback
128
-
129
- handler.handle(body, signature)
130
-
131
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/webhook.py", line 260, in handle
132
-
133
- func(event)
134
-
135
- File "app.py", line 46, in handle_message
136
-
137
- TextSendMessage(text=event.message.text))
138
-
139
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 107, in reply_message
140
-
141
- '/v2/bot/message/reply', data=json.dumps(data), timeout=timeout
142
-
143
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 996, in _post
144
-
145
- self.__check_error(response)
146
-
147
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 1022, in __check_error
148
-
149
- error=Error.new_from_json_dict(response.json)
150
-
151
- LineBotApiError: LineBotApiError: status_code=400, request_id=abcca822-4552-4036-a160-56ca9af6f6c8, error_response={"details": [], "message": "Invalid reply token"}, headers={'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'Transfer-Encoding': 'chunked', 'expires': '0', 'x-line-request-id': 'abcca822-4552-4036-a160-56ca9af6f6c8', 'Server': 'nginx', 'Connection': 'keep-alive', 'pragma': 'no-cache', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', 'Date': 'Tue, 24 Dec 2019 07:02:46 GMT', 'x-frame-options': 'DENY', 'Content-Type': 'application/json;charset=UTF-8'}
152
-
153
- 127.0.0.1 - - [24/Dec/2019 16:00:45] "POST /callback HTTP/1.1" 500 -
154
-
155
- [2019-12-24 16:00:52,083] ERROR in app: Exception on /callback [POST]
156
-
157
- Traceback (most recent call last):
158
-
159
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app
160
-
161
- response = self.full_dispatch_request()
162
-
163
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1815, in full_dispatch_request
164
-
165
- rv = self.handle_user_exception(e)
166
-
167
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1718, in handle_user_exception
168
-
169
- reraise(exc_type, exc_value, tb)
170
-
171
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1813, in full_dispatch_request
172
-
173
- rv = self.dispatch_request()
174
-
175
- File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1799, in dispatch_request
176
-
177
- return self.view_functions[rule.endpoint](**req.view_args)
178
-
179
- File "app.py", line 35, in callback
180
-
181
- handler.handle(body, signature)
182
-
183
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/webhook.py", line 260, in handle
184
-
185
- func(event)
186
-
187
- File "app.py", line 46, in handle_message
188
-
189
- TextSendMessage(text=event.message.text))
190
-
191
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 107, in reply_message
192
-
193
- '/v2/bot/message/reply', data=json.dumps(data), timeout=timeout
194
-
195
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 996, in _post
196
-
197
- self.__check_error(response)
198
-
199
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 1022, in __check_error
200
-
201
- error=Error.new_from_json_dict(response.json)
202
-
203
- LineBotApiError: LineBotApiError: status_code=400, request_id=3f6150a6-1b90-417a-ada9-45f7f2edb33b, error_response={"details": [], "message": "Invalid reply token"}, headers={'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'Transfer-Encoding': 'chunked', 'expires': '0', 'x-line-request-id': '3f6150a6-1b90-417a-ada9-45f7f2edb33b', 'Server': 'nginx', 'Connection': 'keep-alive', 'pragma': 'no-cache', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', 'Date': 'Tue, 24 Dec 2019 07:02:53 GMT', 'x-frame-options': 'DENY', 'Content-Type': 'application/json;charset=UTF-8'}
204
-
205
- 127.0.0.1 - - [24/Dec/2019 16:00:52] "POST /callback HTTP/1.1" 500 -
206
-
207
- ```
208
-
209
-
210
-
211
- ##NW環境
212
-
213
- Mobile WiFiルータに接続しています。
214
-
215
- Windows PCから、Raspberry PiにSSH接続して、開発しています。
216
-
217
- Windows PCも同じMobile WiFiルータに接続しています。
218
-
219
-
220
66
 
221
67
 
222
68
 

3

2019/12/26 05:35

投稿

raspypy
raspypy

スコア247

test CHANGED
File without changes
test CHANGED
File without changes

2

エラー情報を追加しました。

2019/12/24 10:07

投稿

raspypy
raspypy

スコア247

test CHANGED
File without changes
test CHANGED
@@ -82,14 +82,6 @@
82
82
 
83
83
  webhookによる認証の途中で、pythonプログラムを実行しているコンソール画面に次のエラーが表示されました。
84
84
 
85
- 最後の行に** 172.xx.xx.1**というアドレスが書かれているのですが、このアドレスは、Mobile WiFiルータ以前に接続していたネットワーク環境のプロキシサーバのアドレスです。
86
-
87
- プロキシの値はすべて無効にしているはずですが、どこかに漏れがあるのでしょうか?
88
-
89
- 無効にした個所は、/etc/apt/apt.conf と export(環境変数)です。
90
-
91
-
92
-
93
85
 
94
86
 
95
87
  ```text
@@ -108,7 +100,7 @@
108
100
 
109
101
  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
110
102
 
111
- [2019-12-24 15:50:55,769] ERROR in app: Exception on /callback [POST]
103
+ [2019-12-24 16:00:45,495] ERROR in app: Exception on /callback [POST]
112
104
 
113
105
  Traceback (most recent call last):
114
106
 
@@ -148,37 +140,69 @@
148
140
 
149
141
  '/v2/bot/message/reply', data=json.dumps(data), timeout=timeout
150
142
 
151
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 993, in _post
152
-
153
- url, headers=headers, data=data, timeout=timeout
154
-
155
- File "/home/pi/.local/lib/python2.7/site-packages/linebot/http_client.py", line 152, in post
156
-
157
- url, headers=headers, data=data, timeout=timeout
158
-
159
- File "/usr/lib/python2.7/dist-packages/requests/api.py", line 116, in post
160
-
161
- return request('post', url, data=data, json=json, **kwargs)
162
-
163
- File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in request
164
-
165
- return session.request(method=method, url=url, **kwargs)
166
-
167
- File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 533, in request
168
-
169
- resp = self.send(prep, **send_kwargs)
170
-
171
- File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 646, in send
172
-
173
- r = adapter.send(request, **kwargs)
174
-
175
- File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 504, in send
176
-
177
- raise ConnectTimeout(e, request=request)
178
-
179
- ConnectTimeout: HTTPSConnectionPool(host='api.line.me', port=443): Max retries exceeded with url: /v2/bot/message/reply (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x754b33b0>, 'Connection to 172.xx.xx.1 timed out. (connect timeout=5)'))
180
-
181
- 127.0.0.1 - - [24/Dec/2019 15:50:55] "POST /callback HTTP/1.1" 500 -
143
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 996, in _post
144
+
145
+ self.__check_error(response)
146
+
147
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 1022, in __check_error
148
+
149
+ error=Error.new_from_json_dict(response.json)
150
+
151
+ LineBotApiError: LineBotApiError: status_code=400, request_id=abcca822-4552-4036-a160-56ca9af6f6c8, error_response={"details": [], "message": "Invalid reply token"}, headers={'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'Transfer-Encoding': 'chunked', 'expires': '0', 'x-line-request-id': 'abcca822-4552-4036-a160-56ca9af6f6c8', 'Server': 'nginx', 'Connection': 'keep-alive', 'pragma': 'no-cache', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', 'Date': 'Tue, 24 Dec 2019 07:02:46 GMT', 'x-frame-options': 'DENY', 'Content-Type': 'application/json;charset=UTF-8'}
152
+
153
+ 127.0.0.1 - - [24/Dec/2019 16:00:45] "POST /callback HTTP/1.1" 500 -
154
+
155
+ [2019-12-24 16:00:52,083] ERROR in app: Exception on /callback [POST]
156
+
157
+ Traceback (most recent call last):
158
+
159
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app
160
+
161
+ response = self.full_dispatch_request()
162
+
163
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1815, in full_dispatch_request
164
+
165
+ rv = self.handle_user_exception(e)
166
+
167
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1718, in handle_user_exception
168
+
169
+ reraise(exc_type, exc_value, tb)
170
+
171
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1813, in full_dispatch_request
172
+
173
+ rv = self.dispatch_request()
174
+
175
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1799, in dispatch_request
176
+
177
+ return self.view_functions[rule.endpoint](**req.view_args)
178
+
179
+ File "app.py", line 35, in callback
180
+
181
+ handler.handle(body, signature)
182
+
183
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/webhook.py", line 260, in handle
184
+
185
+ func(event)
186
+
187
+ File "app.py", line 46, in handle_message
188
+
189
+ TextSendMessage(text=event.message.text))
190
+
191
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 107, in reply_message
192
+
193
+ '/v2/bot/message/reply', data=json.dumps(data), timeout=timeout
194
+
195
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 996, in _post
196
+
197
+ self.__check_error(response)
198
+
199
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 1022, in __check_error
200
+
201
+ error=Error.new_from_json_dict(response.json)
202
+
203
+ LineBotApiError: LineBotApiError: status_code=400, request_id=3f6150a6-1b90-417a-ada9-45f7f2edb33b, error_response={"details": [], "message": "Invalid reply token"}, headers={'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'Transfer-Encoding': 'chunked', 'expires': '0', 'x-line-request-id': '3f6150a6-1b90-417a-ada9-45f7f2edb33b', 'Server': 'nginx', 'Connection': 'keep-alive', 'pragma': 'no-cache', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', 'Date': 'Tue, 24 Dec 2019 07:02:53 GMT', 'x-frame-options': 'DENY', 'Content-Type': 'application/json;charset=UTF-8'}
204
+
205
+ 127.0.0.1 - - [24/Dec/2019 16:00:52] "POST /callback HTTP/1.1" 500 -
182
206
 
183
207
  ```
184
208
 

1

エラー情報を追加しました。

2019/12/24 07:03

投稿

raspypy
raspypy

スコア247

test CHANGED
File without changes
test CHANGED
@@ -78,6 +78,110 @@
78
78
 
79
79
 
80
80
 
81
+ ##エラー情報
82
+
83
+ webhookによる認証の途中で、pythonプログラムを実行しているコンソール画面に次のエラーが表示されました。
84
+
85
+ 最後の行に** 172.xx.xx.1**というアドレスが書かれているのですが、このアドレスは、Mobile WiFiルータ以前に接続していたネットワーク環境のプロキシサーバのアドレスです。
86
+
87
+ プロキシの値はすべて無効にしているはずですが、どこかに漏れがあるのでしょうか?
88
+
89
+ 無効にした個所は、/etc/apt/apt.conf と export(環境変数)です。
90
+
91
+
92
+
93
+
94
+
95
+ ```text
96
+
97
+ pi@raspberrypi:~/dev/line-bot-sdk-python-master/examples/flask-kitchensink $ python app.py
98
+
99
+ * Serving Flask app "app" (lazy loading)
100
+
101
+ * Environment: production
102
+
103
+ WARNING: Do not use the development server in a production environment.
104
+
105
+ Use a production WSGI server instead.
106
+
107
+ * Debug mode: off
108
+
109
+ * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
110
+
111
+ [2019-12-24 15:50:55,769] ERROR in app: Exception on /callback [POST]
112
+
113
+ Traceback (most recent call last):
114
+
115
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app
116
+
117
+ response = self.full_dispatch_request()
118
+
119
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1815, in full_dispatch_request
120
+
121
+ rv = self.handle_user_exception(e)
122
+
123
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1718, in handle_user_exception
124
+
125
+ reraise(exc_type, exc_value, tb)
126
+
127
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1813, in full_dispatch_request
128
+
129
+ rv = self.dispatch_request()
130
+
131
+ File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1799, in dispatch_request
132
+
133
+ return self.view_functions[rule.endpoint](**req.view_args)
134
+
135
+ File "app.py", line 35, in callback
136
+
137
+ handler.handle(body, signature)
138
+
139
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/webhook.py", line 260, in handle
140
+
141
+ func(event)
142
+
143
+ File "app.py", line 46, in handle_message
144
+
145
+ TextSendMessage(text=event.message.text))
146
+
147
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 107, in reply_message
148
+
149
+ '/v2/bot/message/reply', data=json.dumps(data), timeout=timeout
150
+
151
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/api.py", line 993, in _post
152
+
153
+ url, headers=headers, data=data, timeout=timeout
154
+
155
+ File "/home/pi/.local/lib/python2.7/site-packages/linebot/http_client.py", line 152, in post
156
+
157
+ url, headers=headers, data=data, timeout=timeout
158
+
159
+ File "/usr/lib/python2.7/dist-packages/requests/api.py", line 116, in post
160
+
161
+ return request('post', url, data=data, json=json, **kwargs)
162
+
163
+ File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in request
164
+
165
+ return session.request(method=method, url=url, **kwargs)
166
+
167
+ File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 533, in request
168
+
169
+ resp = self.send(prep, **send_kwargs)
170
+
171
+ File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 646, in send
172
+
173
+ r = adapter.send(request, **kwargs)
174
+
175
+ File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 504, in send
176
+
177
+ raise ConnectTimeout(e, request=request)
178
+
179
+ ConnectTimeout: HTTPSConnectionPool(host='api.line.me', port=443): Max retries exceeded with url: /v2/bot/message/reply (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x754b33b0>, 'Connection to 172.xx.xx.1 timed out. (connect timeout=5)'))
180
+
181
+ 127.0.0.1 - - [24/Dec/2019 15:50:55] "POST /callback HTTP/1.1" 500 -
182
+
183
+ ```
184
+
81
185
 
82
186
 
83
187
  ##NW環境