Fix exception handling in case of ReadTimeout errors#1606
Merged
nsoranzo merged 1 commit intogalaxyproject:masterfrom Feb 2, 2026
Merged
Fix exception handling in case of ReadTimeout errors#1606nsoranzo merged 1 commit intogalaxyproject:masterfrom
nsoranzo merged 1 commit intogalaxyproject:masterfrom
Conversation
Fix the following error:
```
2026-02-02T10:27:00.5657779Z response.begin()
2026-02-02T10:27:00.5658742Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/http/client.py", line 325, in begin
2026-02-02T10:27:00.5659658Z version, status, reason = self._read_status()
2026-02-02T10:27:00.5660460Z ^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.5661585Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/http/client.py", line 286, in _read_status
2026-02-02T10:27:00.5662794Z line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
2026-02-02T10:27:00.5663724Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.5664727Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/socket.py", line 718, in readinto
2026-02-02T10:27:00.5876155Z return self._sock.recv_into(b)
2026-02-02T10:27:00.5876736Z ^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.5877737Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/ssl.py", line 1314, in recv_into
2026-02-02T10:27:00.6097803Z return self.read(nbytes, buffer)
2026-02-02T10:27:00.6098402Z ^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6099359Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/ssl.py", line 1166, in read
2026-02-02T10:27:00.6100285Z return self._sslobj.read(len, buffer)
2026-02-02T10:27:00.6100830Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6101265Z TimeoutError: The read operation timed out
2026-02-02T10:27:00.6101587Z
2026-02-02T10:27:00.6101888Z The above exception was the direct cause of the following exception:
2026-02-02T10:27:00.6102370Z
2026-02-02T10:27:00.6102528Z Traceback (most recent call last):
2026-02-02T10:27:00.6103609Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/adapters.py", line 644, in send
2026-02-02T10:27:00.6104484Z resp = conn.urlopen(
2026-02-02T10:27:00.6104829Z ^^^^^^^^^^^^^
2026-02-02T10:27:00.6105708Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/urllib3/connectionpool.py", line 841, in urlopen
2026-02-02T10:27:00.6106669Z retries = retries.increment(
2026-02-02T10:27:00.6107051Z ^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6107941Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/urllib3/util/retry.py", line 490, in increment
2026-02-02T10:27:00.6108957Z raise reraise(type(error), error, _stacktrace)
2026-02-02T10:27:00.6109441Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6110344Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/urllib3/util/util.py", line 39, in reraise
2026-02-02T10:27:00.6111535Z raise value
2026-02-02T10:27:00.6112409Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/urllib3/connectionpool.py", line 787, in urlopen
2026-02-02T10:27:00.6113537Z response = self._make_request(
2026-02-02T10:27:00.6113930Z ^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6115091Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/urllib3/connectionpool.py", line 536, in _make_request
2026-02-02T10:27:00.6116214Z self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
2026-02-02T10:27:00.6117407Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/urllib3/connectionpool.py", line 367, in _raise_timeout
2026-02-02T10:27:00.6118423Z raise ReadTimeoutError(
2026-02-02T10:27:00.6119367Z urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='useast.ensembl.org', port=443): Read timed out. (read timeout=5)
2026-02-02T10:27:00.6120268Z
2026-02-02T10:27:00.6120568Z During handling of the above exception, another exception occurred:
2026-02-02T10:27:00.6121043Z
2026-02-02T10:27:00.6121193Z Traceback (most recent call last):
2026-02-02T10:27:00.6122139Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/lint.py", line 147, in _validate_http_url
2026-02-02T10:27:00.6123398Z r = requests.get(url, headers=headers, stream=True, timeout=REQUEST_TIMEOUT)
2026-02-02T10:27:00.6124086Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6125001Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/api.py", line 73, in get
2026-02-02T10:27:00.6125912Z return request("get", url, params=params, **kwargs)
2026-02-02T10:27:00.6126414Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6127290Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/api.py", line 59, in request
2026-02-02T10:27:00.6128269Z return session.request(method=method, url=url, **kwargs)
2026-02-02T10:27:00.6128813Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6129736Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
2026-02-02T10:27:00.6130642Z resp = self.send(prep, **send_kwargs)
2026-02-02T10:27:00.6131074Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6131935Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/sessions.py", line 724, in send
2026-02-02T10:27:00.6132817Z history = [resp for resp in gen]
2026-02-02T10:27:00.6133343Z ^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6134241Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/sessions.py", line 724, in <listcomp>
2026-02-02T10:27:00.6135154Z history = [resp for resp in gen]
2026-02-02T10:27:00.6135553Z ^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6136489Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/sessions.py", line 265, in resolve_redirects
2026-02-02T10:27:00.6137438Z resp = self.send(
2026-02-02T10:27:00.6137754Z ^^^^^^^^^^
2026-02-02T10:27:00.6138535Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
2026-02-02T10:27:00.6139413Z r = adapter.send(request, **kwargs)
2026-02-02T10:27:00.6139826Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6140674Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/requests/adapters.py", line 690, in send
2026-02-02T10:27:00.6141590Z raise ReadTimeout(e, request=request)
2026-02-02T10:27:00.6142543Z requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='useast.ensembl.org', port=443): Read timed out. (read timeout=5)
2026-02-02T10:27:00.6143508Z
2026-02-02T10:27:00.6143973Z During handling of the above exception, another exception occurred:
2026-02-02T10:27:00.6144442Z
2026-02-02T10:27:00.6144588Z Traceback (most recent call last):
2026-02-02T10:27:00.6145255Z File "/opt/hostedtoolcache/Python/3.11.14/x64/bin/planemo", line 7, in <module>
2026-02-02T10:27:00.6145917Z sys.exit(planemo())
2026-02-02T10:27:00.6146241Z ^^^^^^^^^
2026-02-02T10:27:00.6147173Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/click/core.py", line 1485, in __call__
2026-02-02T10:27:00.6148043Z return self.main(*args, **kwargs)
2026-02-02T10:27:00.6148442Z ^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6149245Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/click/core.py", line 1406, in main
2026-02-02T10:27:00.6150091Z rv = self.invoke(ctx)
2026-02-02T10:27:00.6150429Z ^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6151203Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/click/core.py", line 1873, in invoke
2026-02-02T10:27:00.6152154Z return _process_result(sub_ctx.command.invoke(sub_ctx))
2026-02-02T10:27:00.6152699Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6153709Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/click/core.py", line 1269, in invoke
2026-02-02T10:27:00.6154616Z return ctx.invoke(self.callback, **ctx.params)
2026-02-02T10:27:00.6155100Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6155978Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/click/core.py", line 824, in invoke
2026-02-02T10:27:00.6156563Z return callback(*args, **kwargs)
2026-02-02T10:27:00.6156799Z ^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6157309Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/click/decorators.py", line 93, in new_func
2026-02-02T10:27:00.6157845Z return ctx.invoke(f, obj, *args, **kwargs)
2026-02-02T10:27:00.6158115Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6158594Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/click/core.py", line 824, in invoke
2026-02-02T10:27:00.6159066Z return callback(*args, **kwargs)
2026-02-02T10:27:00.6159297Z ^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6159825Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/cli.py", line 146, in handle_blended_options
2026-02-02T10:27:00.6160353Z return f(*args, **kwds)
2026-02-02T10:27:00.6160556Z ^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6161052Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/commands/cmd_shed_lint.py", line 65, in cli
2026-02-02T10:27:00.6161685Z exit_code = shed.for_each_repository(ctx, lint, paths, **kwds)
2026-02-02T10:27:00.6162024Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6162612Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/shed/__init__.py", line 769, in for_each_repository
2026-02-02T10:27:00.6163370Z ret_codes.append(function(realized_repository))
2026-02-02T10:27:00.6163657Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6164191Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/commands/cmd_shed_lint.py", line 62, in lint
2026-02-02T10:27:00.6164811Z return shed_lint.lint_repository(ctx, realized_repository, **kwds)
2026-02-02T10:27:00.6165164Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6165724Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/shed_lint.py", line 120, in lint_repository
2026-02-02T10:27:00.6166372Z tools_failed = lint_repository_tools(ctx, realized_repository, lint_ctx, lint_args)
2026-02-02T10:27:00.6166798Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6167553Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/shed_lint.py", line 141, in lint_repository_tools
2026-02-02T10:27:00.6168234Z lint_tool_source_with(lint_ctx, tool_source, extra_modules=lint_args["extra_modules"])
2026-02-02T10:27:00.6168979Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/galaxy/tool_util/lint.py", line 367, in lint_tool_source_with
2026-02-02T10:27:00.6169760Z return lint_tool_source_with_modules(lint_context, tool_source, linter_modules)
2026-02-02T10:27:00.6170165Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6170808Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/galaxy/tool_util/lint.py", line 393, in lint_tool_source_with_modules
2026-02-02T10:27:00.6171402Z lint_context.lint(name, value, tool_source)
2026-02-02T10:27:00.6171931Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/galaxy/tool_util/lint.py", line 248, in lint
2026-02-02T10:27:00.6172438Z lint_func(lint_target, self)
2026-02-02T10:27:00.6172959Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/linters/urls.py", line 7, in lint_tool_urls
2026-02-02T10:27:00.6173641Z planemo.lint.lint_urls(tool_source.root, lint_ctx)
2026-02-02T10:27:00.6174186Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/lint.py", line 196, in lint_urls
2026-02-02T10:27:00.6174709Z validate_url(url, lint_ctx, BROWSER_USER_AGENT)
2026-02-02T10:27:00.6175247Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/lint.py", line 186, in validate_url
2026-02-02T10:27:00.6175793Z is_valid = _validate_http_url(url, lint_ctx, user_agent)
2026-02-02T10:27:00.6176097Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-02-02T10:27:00.6176651Z File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/planemo/lint.py", line 159, in _validate_http_url
2026-02-02T10:27:00.6177257Z lint_ctx.error(f"Error '{e}' accessing {url} response was {r.text}")
2026-02-02T10:27:00.6177613Z ^^^^^^
2026-02-02T10:27:00.6177939Z AttributeError: 'NoneType' object has no attribute 'text'
```
mvdbeek
approved these changes
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the following error: