Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History export download multiple ConnectionResetError and proxyError #309

Open
Colorstorm opened this issue Dec 12, 2019 · 0 comments
Open

Comments

@Colorstorm
Copy link

Colorstorm commented Dec 12, 2019

Hi everyone,

I'm trying to export and download (for backup reasons) multiple histories.
With some histories I get an ConnectionRestError and proxyError(see below), other histories just work fine.

My code:

from bioblend.galaxy import GalaxyInstance

ip = '172.XXX.XXX.XXX.XXX'
api_key = 'XXXXXXXX'

gi = GalaxyInstance(url=ip, key=api_key)
histories_list = gi.histories.get_histories(deleted=False)
for history in histories_list:
    jeha_id = gi.histories.export_history(history['id'], gzip=True, include_hidden=False, include_deleted=False,
                                          wait=True, maxwait=None)
    f = open("test/" + history['id'] + '.tar.gz', 'wb')
    gi.histories.download_history(history_id=history['id'], jeha_id=jeha_id, outf=f)
    f.close()

The exception

Traceback (most recent call last):
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.5/http/client.py", line 1213, in getresponse
    response.begin()
  File "/usr/lib/python3.5/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.5/http/client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.5/socket.py", line 575, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='XXXXXX', port=XXXX): Max retries exceeded with url: http://XXXipXXX/api/histories/XXXXhistoryIDXXX/exports?key=XXXXXX (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/pythonProjects/bioblend/exportBugTest.py", line 10, in <module>
    wait=True, maxwait=None)
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/bioblend/galaxy/histories/__init__.py", line 617, in export_history
    r = self._put(payload={}, url=url, params=params)
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/bioblend/galaxy/client.py", line 165, in _put
    return self.gi.make_put_request(url, payload=payload, params=params)
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/bioblend/galaxyclient.py", line 205, in make_put_request
    verify=self.verify, timeout=self.timeout)
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/requests/api.py", line 131, in put
    return request('put', url, data=data, **kwargs)
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/pythonProjects/bioblend/venv/lib/python3.5/site-packages/requests/adapters.py", line 510, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPConnectionPool(host='XXXX' port=XXXX): Max retries exceeded with url: http://XXXipXXX/api/histories/XXXXhistoryIDXXX/exports?key=XXXXXX(Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer')))

I hope that anyone has an idea how to fix these.
Thanks a lot in advance and best regards
Fabian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant