Fixes
https://sentry.galaxyproject.org/share/issue/5b8d495edd6545278d4d93d0ed69ac3a/:
```
Message
Uncaught exception in exposed API method:
Stack Trace
Newest
gaierror: [Errno -2] Name or service not known
File "urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "urllib3/util/connection.py", line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "socket.py", line 962, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f8e35406450>: Failed to establish a new connection: [Errno -2] Name or service not known
File "urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
File "urllib3/connectionpool.py", line 416, in _make_request
conn.request(method, url, **httplib_request_kw)
File "urllib3/connection.py", line 244, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "http/client.py", line 1286, in request
self._send_request(method, url, body, headers, encode_chunked)
File "http/client.py", line 1332, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "http/client.py", line 1281, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "http/client.py", line 1041, in _send_output
self.send(msg)
File "http/client.py", line 979, in send
self.connect()
File "urllib3/connection.py", line 205, in connect
conn = self._new_conn()
File "urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
MaxRetryError: HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //training.galaxyproject.org/training-material//api/ga4gh/trs/v2/tools/variant-analysis-microbial-variants/versions/microbial_variant_calling/GALAXY/descriptor (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8e35406450>: Failed to establish a new connection: [Errno -2] Name or service not known'))
File "requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "urllib3/connectionpool.py", line 799, in urlopen
retries = retries.increment(
File "urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
ConnectionError: HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //training.galaxyproject.org/training-material//api/ga4gh/trs/v2/tools/variant-analysis-microbial-variants/versions/microbial_variant_calling/GALAXY/descriptor (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8e35406450>: Failed to establish a new connection: [Errno -2] Name or service not known'))
File "galaxy/web/framework/decorators.py", line 346, in decorator
rval = func(self, trans, *args, **kwargs)
File "galaxy/webapps/galaxy/api/workflows.py", line 261, in create
archive_data = server.get_version_descriptor(trs_tool_id, trs_version_id)
File "galaxy/workflow/trs_proxy.py", line 115, in get_version_descriptor
return self._get(trs_api_url)["content"]
File "galaxy/workflow/trs_proxy.py", line 126, in _get
response = requests.get(url, params=params, timeout=DEFAULT_SOCKET_TIMEOUT)
File "galaxy/util/requests.py", line 29, in wrapper
rval = f(*args, **kwargs)
File "requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
```
which happened for https://usegalaxy.org/workflows/trs_import?run_form=true&trs_url=http%3A%2F%2Flocalhost%3A4000%2F%2Ftraining-material%2F%2Fapi%2Fga4gh%2Ftrs%2Fv2%2Ftools%2Fvariant-analysis-microbial-variants%2Fversions%2Fmicrobial_variant_calling"
There was a past jmchilton todo in the code base about it. Directives that might target particular versions of a workflow (so workflow_display and workflow_image) now can take a workflow_version attribute and when these things are auto-populated for workflow invocations - they are populated with the right version for the invocation.
Works for both files and collections. Workflow defaults override tool defaults.
TODO:
- Unit test case to ensure this only works for non-default, non-multi data parameters.
- Implement XSD once syntax is finalized.
with manual fixes to 3 files to make them compatible with black 22.12.0 .
We need to keep black pinned at `<23` until we vendorise `packaging`, since
the new version of black depends on `packaging >=22.0` which is the version
where `LegacyVersion` (which we use for tool lineages) was removed.
Trying out https://github.com/dropbox/pyannotate here.
It's still a lot of work even with pyannotate, but I think this fixes
some minor oddities, like assigning non-mapped attributes to
WorkflowInvocation instances.