Page MenuHomePhabricator

Connection timeout errors generate massive traceback from underlying python libraries
Open, Needs TriagePublic

Description

I am using site.upload() and received some massive tracebacks being printed to the terminal when there was a connection timeout. I believe this was caused by a large file not using chunked upload, but here I want to report the error handling in Pywikibot, rather than the error itself. This printout just increases in length as the response to the error is to wait and retry. For example, in one recent case, it retried 20 times, generating over 600 lines of traceback, before I manually killed it. I think all of the lines of error messaging from urllib3 and requests could be condensed into a single line, such as "ERROR: The read operation timed out." (or whatever the best summary is).

Example traceback:

1ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
2ERROR: Traceback (most recent call last):
3 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
4 six.raise_from(e, None)
5 File "<string>", line 2, in raise_from
6 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
7 httplib_response = conn.getresponse()
8 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
9 response.begin()
10 File "/usr/lib/python3.6/http/client.py", line 297, in begin
11 version, status, reason = self._read_status()
12 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
13 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
14 File "/usr/lib/python3.6/socket.py", line 586, in readinto
15 return self._sock.recv_into(b)
16 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
17 return self.read(nbytes, buffer)
18 File "/usr/lib/python3.6/ssl.py", line 874, in read
19 return self._sslobj.read(len, buffer)
20 File "/usr/lib/python3.6/ssl.py", line 631, in read
21 v = self._sslobj.read(len, buffer)
22socket.timeout: The read operation timed out
23
24During handling of the above exception, another exception occurred:
25
26Traceback (most recent call last):
27 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
28 timeout=timeout
29 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
30 _stacktrace=sys.exc_info()[2])
31 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
32 raise six.reraise(type(error), error, _stacktrace)
33 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
34 raise value
35 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
36 chunked=chunked)
37 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
38 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
39 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
40 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
41urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
42
43During handling of the above exception, another exception occurred:
44
45Traceback (most recent call last):
46 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
47 body=body, headers=headers)
48 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
49 return obj(*__args, **__kw)
50 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
51 r = fetch(baseuri, method, params, body, headers, **kwargs)
52 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
53 error_handling_callback(request)
54 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
55 raise request.data
56 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
57 **http_request.kwargs)
58 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
59 resp = self.send(prep, **send_kwargs)
60 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
61 r = adapter.send(request, **kwargs)
62 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
63 raise ReadTimeout(e, request=request)
64requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
65
66WARNING: Waiting 5 seconds before retrying.
67ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
68ERROR: Traceback (most recent call last):
69 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
70 six.raise_from(e, None)
71 File "<string>", line 2, in raise_from
72 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
73 httplib_response = conn.getresponse()
74 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
75 response.begin()
76 File "/usr/lib/python3.6/http/client.py", line 297, in begin
77 version, status, reason = self._read_status()
78 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
79 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
80 File "/usr/lib/python3.6/socket.py", line 586, in readinto
81 return self._sock.recv_into(b)
82 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
83 return self.read(nbytes, buffer)
84 File "/usr/lib/python3.6/ssl.py", line 874, in read
85 return self._sslobj.read(len, buffer)
86 File "/usr/lib/python3.6/ssl.py", line 631, in read
87 v = self._sslobj.read(len, buffer)
88socket.timeout: The read operation timed out
89
90During handling of the above exception, another exception occurred:
91
92Traceback (most recent call last):
93 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
94 timeout=timeout
95 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
96 _stacktrace=sys.exc_info()[2])
97 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
98 raise six.reraise(type(error), error, _stacktrace)
99 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
100 raise value
101 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
102 chunked=chunked)
103 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
104 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
105 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
106 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
107urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
108
109During handling of the above exception, another exception occurred:
110
111Traceback (most recent call last):
112 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
113 body=body, headers=headers)
114 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
115 return obj(*__args, **__kw)
116 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
117 r = fetch(baseuri, method, params, body, headers, **kwargs)
118 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
119 error_handling_callback(request)
120 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
121 raise request.data
122 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
123 **http_request.kwargs)
124 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
125 resp = self.send(prep, **send_kwargs)
126 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
127 r = adapter.send(request, **kwargs)
128 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
129 raise ReadTimeout(e, request=request)
130requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
131
132WARNING: Waiting 10 seconds before retrying.
133ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
134ERROR: Traceback (most recent call last):
135 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
136 six.raise_from(e, None)
137 File "<string>", line 2, in raise_from
138 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
139 httplib_response = conn.getresponse()
140 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
141 response.begin()
142 File "/usr/lib/python3.6/http/client.py", line 297, in begin
143 version, status, reason = self._read_status()
144 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
145 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
146 File "/usr/lib/python3.6/socket.py", line 586, in readinto
147 return self._sock.recv_into(b)
148 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
149 return self.read(nbytes, buffer)
150 File "/usr/lib/python3.6/ssl.py", line 874, in read
151 return self._sslobj.read(len, buffer)
152 File "/usr/lib/python3.6/ssl.py", line 631, in read
153 v = self._sslobj.read(len, buffer)
154socket.timeout: The read operation timed out
155
156During handling of the above exception, another exception occurred:
157
158Traceback (most recent call last):
159 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
160 timeout=timeout
161 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
162 _stacktrace=sys.exc_info()[2])
163 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
164 raise six.reraise(type(error), error, _stacktrace)
165 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
166 raise value
167 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
168 chunked=chunked)
169 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
170 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
171 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
172 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
173urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
174
175During handling of the above exception, another exception occurred:
176
177Traceback (most recent call last):
178 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
179 body=body, headers=headers)
180 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
181 return obj(*__args, **__kw)
182 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
183 r = fetch(baseuri, method, params, body, headers, **kwargs)
184 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
185 error_handling_callback(request)
186 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
187 raise request.data
188 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
189 **http_request.kwargs)
190 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
191 resp = self.send(prep, **send_kwargs)
192 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
193 r = adapter.send(request, **kwargs)
194 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
195 raise ReadTimeout(e, request=request)
196requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
197
198WARNING: Waiting 20 seconds before retrying.
199ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
200ERROR: Traceback (most recent call last):
201 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
202 six.raise_from(e, None)
203 File "<string>", line 2, in raise_from
204 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
205 httplib_response = conn.getresponse()
206 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
207 response.begin()
208 File "/usr/lib/python3.6/http/client.py", line 297, in begin
209 version, status, reason = self._read_status()
210 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
211 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
212 File "/usr/lib/python3.6/socket.py", line 586, in readinto
213 return self._sock.recv_into(b)
214 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
215 return self.read(nbytes, buffer)
216 File "/usr/lib/python3.6/ssl.py", line 874, in read
217 return self._sslobj.read(len, buffer)
218 File "/usr/lib/python3.6/ssl.py", line 631, in read
219 v = self._sslobj.read(len, buffer)
220socket.timeout: The read operation timed out
221
222During handling of the above exception, another exception occurred:
223
224Traceback (most recent call last):
225 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
226 timeout=timeout
227 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
228 _stacktrace=sys.exc_info()[2])
229 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
230 raise six.reraise(type(error), error, _stacktrace)
231 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
232 raise value
233 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
234 chunked=chunked)
235 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
236 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
237 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
238 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
239urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
240
241During handling of the above exception, another exception occurred:
242
243Traceback (most recent call last):
244 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
245 body=body, headers=headers)
246 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
247 return obj(*__args, **__kw)
248 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
249 r = fetch(baseuri, method, params, body, headers, **kwargs)
250 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
251 error_handling_callback(request)
252 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
253 raise request.data
254 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
255 **http_request.kwargs)
256 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
257 resp = self.send(prep, **send_kwargs)
258 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
259 r = adapter.send(request, **kwargs)
260 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
261 raise ReadTimeout(e, request=request)
262requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
263
264WARNING: Waiting 40 seconds before retrying.
265ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
266ERROR: Traceback (most recent call last):
267 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
268 six.raise_from(e, None)
269 File "<string>", line 2, in raise_from
270 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
271 httplib_response = conn.getresponse()
272 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
273 response.begin()
274 File "/usr/lib/python3.6/http/client.py", line 297, in begin
275 version, status, reason = self._read_status()
276 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
277 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
278 File "/usr/lib/python3.6/socket.py", line 586, in readinto
279 return self._sock.recv_into(b)
280 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
281 return self.read(nbytes, buffer)
282 File "/usr/lib/python3.6/ssl.py", line 874, in read
283 return self._sslobj.read(len, buffer)
284 File "/usr/lib/python3.6/ssl.py", line 631, in read
285 v = self._sslobj.read(len, buffer)
286socket.timeout: The read operation timed out
287
288During handling of the above exception, another exception occurred:
289
290Traceback (most recent call last):
291 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
292 timeout=timeout
293 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
294 _stacktrace=sys.exc_info()[2])
295 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
296 raise six.reraise(type(error), error, _stacktrace)
297 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
298 raise value
299 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
300 chunked=chunked)
301 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
302 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
303 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
304 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
305urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
306
307During handling of the above exception, another exception occurred:
308
309Traceback (most recent call last):
310 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
311 body=body, headers=headers)
312 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
313 return obj(*__args, **__kw)
314 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
315 r = fetch(baseuri, method, params, body, headers, **kwargs)
316 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
317 error_handling_callback(request)
318 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
319 raise request.data
320 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
321 **http_request.kwargs)
322 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
323 resp = self.send(prep, **send_kwargs)
324 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
325 r = adapter.send(request, **kwargs)
326 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
327 raise ReadTimeout(e, request=request)
328requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
329
330WARNING: Waiting 80 seconds before retrying.
331ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
332ERROR: Traceback (most recent call last):
333 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
334 six.raise_from(e, None)
335 File "<string>", line 2, in raise_from
336 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
337 httplib_response = conn.getresponse()
338 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
339 response.begin()
340 File "/usr/lib/python3.6/http/client.py", line 297, in begin
341 version, status, reason = self._read_status()
342 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
343 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
344 File "/usr/lib/python3.6/socket.py", line 586, in readinto
345 return self._sock.recv_into(b)
346 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
347 return self.read(nbytes, buffer)
348 File "/usr/lib/python3.6/ssl.py", line 874, in read
349 return self._sslobj.read(len, buffer)
350 File "/usr/lib/python3.6/ssl.py", line 631, in read
351 v = self._sslobj.read(len, buffer)
352socket.timeout: The read operation timed out
353
354During handling of the above exception, another exception occurred:
355
356Traceback (most recent call last):
357 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
358 timeout=timeout
359 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
360 _stacktrace=sys.exc_info()[2])
361 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
362 raise six.reraise(type(error), error, _stacktrace)
363 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
364 raise value
365 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
366 chunked=chunked)
367 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
368 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
369 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
370 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
371urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
372
373During handling of the above exception, another exception occurred:
374
375Traceback (most recent call last):
376 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
377 body=body, headers=headers)
378 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
379 return obj(*__args, **__kw)
380 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
381 r = fetch(baseuri, method, params, body, headers, **kwargs)
382 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
383 error_handling_callback(request)
384 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
385 raise request.data
386 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
387 **http_request.kwargs)
388 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
389 resp = self.send(prep, **send_kwargs)
390 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
391 r = adapter.send(request, **kwargs)
392 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
393 raise ReadTimeout(e, request=request)
394requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
395
396WARNING: Waiting 120 seconds before retrying.
397ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
398ERROR: Traceback (most recent call last):
399 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
400 six.raise_from(e, None)
401 File "<string>", line 2, in raise_from
402 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
403 httplib_response = conn.getresponse()
404 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
405 response.begin()
406 File "/usr/lib/python3.6/http/client.py", line 297, in begin
407 version, status, reason = self._read_status()
408 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
409 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
410 File "/usr/lib/python3.6/socket.py", line 586, in readinto
411 return self._sock.recv_into(b)
412 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
413 return self.read(nbytes, buffer)
414 File "/usr/lib/python3.6/ssl.py", line 874, in read
415 return self._sslobj.read(len, buffer)
416 File "/usr/lib/python3.6/ssl.py", line 631, in read
417 v = self._sslobj.read(len, buffer)
418socket.timeout: The read operation timed out
419
420During handling of the above exception, another exception occurred:
421
422Traceback (most recent call last):
423 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
424 timeout=timeout
425 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
426 _stacktrace=sys.exc_info()[2])
427 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
428 raise six.reraise(type(error), error, _stacktrace)
429 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
430 raise value
431 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
432 chunked=chunked)
433 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
434 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
435 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
436 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
437urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
438
439During handling of the above exception, another exception occurred:
440
441Traceback (most recent call last):
442 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
443 body=body, headers=headers)
444 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
445 return obj(*__args, **__kw)
446 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
447 r = fetch(baseuri, method, params, body, headers, **kwargs)
448 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
449 error_handling_callback(request)
450 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
451 raise request.data
452 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
453 **http_request.kwargs)
454 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
455 resp = self.send(prep, **send_kwargs)
456 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
457 r = adapter.send(request, **kwargs)
458 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
459 raise ReadTimeout(e, request=request)
460requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
461
462WARNING: Waiting 120 seconds before retrying.
463ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
464ERROR: Traceback (most recent call last):
465 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
466 six.raise_from(e, None)
467 File "<string>", line 2, in raise_from
468 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
469 httplib_response = conn.getresponse()
470 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
471 response.begin()
472 File "/usr/lib/python3.6/http/client.py", line 297, in begin
473 version, status, reason = self._read_status()
474 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
475 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
476 File "/usr/lib/python3.6/socket.py", line 586, in readinto
477 return self._sock.recv_into(b)
478 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
479 return self.read(nbytes, buffer)
480 File "/usr/lib/python3.6/ssl.py", line 874, in read
481 return self._sslobj.read(len, buffer)
482 File "/usr/lib/python3.6/ssl.py", line 631, in read
483 v = self._sslobj.read(len, buffer)
484socket.timeout: The read operation timed out
485
486During handling of the above exception, another exception occurred:
487
488Traceback (most recent call last):
489 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
490 timeout=timeout
491 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
492 _stacktrace=sys.exc_info()[2])
493 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
494 raise six.reraise(type(error), error, _stacktrace)
495 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
496 raise value
497 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
498 chunked=chunked)
499 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
500 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
501 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
502 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
503urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
504
505During handling of the above exception, another exception occurred:
506
507Traceback (most recent call last):
508 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
509 body=body, headers=headers)
510 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
511 return obj(*__args, **__kw)
512 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
513 r = fetch(baseuri, method, params, body, headers, **kwargs)
514 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
515 error_handling_callback(request)
516 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
517 raise request.data
518 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
519 **http_request.kwargs)
520 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
521 resp = self.send(prep, **send_kwargs)
522 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
523 r = adapter.send(request, **kwargs)
524 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
525 raise ReadTimeout(e, request=request)
526requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
527
528WARNING: Waiting 120 seconds before retrying.
529ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
530ERROR: Traceback (most recent call last):
531 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
532 six.raise_from(e, None)
533 File "<string>", line 2, in raise_from
534 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
535 httplib_response = conn.getresponse()
536 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
537 response.begin()
538 File "/usr/lib/python3.6/http/client.py", line 297, in begin
539 version, status, reason = self._read_status()
540 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
541 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
542 File "/usr/lib/python3.6/socket.py", line 586, in readinto
543 return self._sock.recv_into(b)
544 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
545 return self.read(nbytes, buffer)
546 File "/usr/lib/python3.6/ssl.py", line 874, in read
547 return self._sslobj.read(len, buffer)
548 File "/usr/lib/python3.6/ssl.py", line 631, in read
549 v = self._sslobj.read(len, buffer)
550socket.timeout: The read operation timed out
551
552During handling of the above exception, another exception occurred:
553
554Traceback (most recent call last):
555 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
556 timeout=timeout
557 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
558 _stacktrace=sys.exc_info()[2])
559 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
560 raise six.reraise(type(error), error, _stacktrace)
561 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
562 raise value
563 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
564 chunked=chunked)
565 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
566 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
567 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
568 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
569urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
570
571During handling of the above exception, another exception occurred:
572
573Traceback (most recent call last):
574 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
575 body=body, headers=headers)
576 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
577 return obj(*__args, **__kw)
578 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
579 r = fetch(baseuri, method, params, body, headers, **kwargs)
580 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
581 error_handling_callback(request)
582 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
583 raise request.data
584 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
585 **http_request.kwargs)
586 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
587 resp = self.send(prep, **send_kwargs)
588 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
589 r = adapter.send(request, **kwargs)
590 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
591 raise ReadTimeout(e, request=request)
592requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
593
594WARNING: Waiting 120 seconds before retrying.
595ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
596ERROR: Traceback (most recent call last):
597 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
598 six.raise_from(e, None)
599 File "<string>", line 2, in raise_from
600 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
601 httplib_response = conn.getresponse()
602 File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
603 response.begin()
604 File "/usr/lib/python3.6/http/client.py", line 297, in begin
605 version, status, reason = self._read_status()
606 File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
607 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
608 File "/usr/lib/python3.6/socket.py", line 586, in readinto
609 return self._sock.recv_into(b)
610 File "/usr/lib/python3.6/ssl.py", line 1012, in recv_into
611 return self.read(nbytes, buffer)
612 File "/usr/lib/python3.6/ssl.py", line 874, in read
613 return self._sslobj.read(len, buffer)
614 File "/usr/lib/python3.6/ssl.py", line 631, in read
615 v = self._sslobj.read(len, buffer)
616socket.timeout: The read operation timed out
617
618During handling of the above exception, another exception occurred:
619
620Traceback (most recent call last):
621 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
622 timeout=timeout
623 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
624 _stacktrace=sys.exc_info()[2])
625 File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
626 raise six.reraise(type(error), error, _stacktrace)
627 File "/srv/paws/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
628 raise value
629 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
630 chunked=chunked)
631 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
632 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
633 File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
634 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
635urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
636
637During handling of the above exception, another exception occurred:
638
639Traceback (most recent call last):
640 File "/srv/paws/pwb/pywikibot/data/api.py", line 1732, in _http_request
641 body=body, headers=headers)
642 File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1797, in wrapper
643 return obj(*__args, **__kw)
644 File "/srv/paws/pwb/pywikibot/comms/http.py", line 315, in request
645 r = fetch(baseuri, method, params, body, headers, **kwargs)
646 File "/srv/paws/pwb/pywikibot/comms/http.py", line 519, in fetch
647 error_handling_callback(request)
648 File "/srv/paws/pwb/pywikibot/comms/http.py", line 404, in error_handling_callback
649 raise request.data
650 File "/srv/paws/pwb/pywikibot/comms/http.py", line 382, in _http_process
651 **http_request.kwargs)
652 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
653 resp = self.send(prep, **send_kwargs)
654 File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
655 r = adapter.send(request, **kwargs)
656 File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
657 raise ReadTimeout(e, request=request)
658requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='commons.wikimedia.org', port=443): Read timed out. (read timeout=45)
659
660WARNING: Waiting 120 seconds before retrying.

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMay 20 2020, 3:33 PM
Dvorapa updated the task description. (Show Details)
Xqt added a subscriber: Xqt.May 21 2020, 6:20 AM

As I can see there is only one pywikibot related line raising the exception in http.py line 440.

Xqt added a subscriber: valhallasw.May 25 2020, 5:19 PM
Xqt added a comment.May 25 2020, 5:27 PM

I think this is a Python 3 error chain which cannot be shortened due to Python 2 compatibility support. Let's have Python 2 dropped.

Change 598510 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Check for request.status first

https://gerrit.wikimedia.org/r/598510

Change 598510 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Check for request.status first

https://gerrit.wikimedia.org/r/598510