Skip to content

Upload on SSL - intermittent hang #283

Open
@c0llab0rat0r

Description

@c0llab0rat0r

When using docs/publish.py to publish to an IPFS server that is protected by SSL using Nginx as a reverse-proxy, I've noticed numerous instances of the script getting stuck waiting on

File "/usr/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)

It fails more often than it succeeds. It's not clear to me if this is an issue with the underlying SSL library (seems possible but unlikely), or Nginx (possible but also unlikely), or if there are some incorrect assumptions in the IPFS client about how it interacts with the IPFS server pushing numerous files up over a slow connection.

Example traceback, after pressing Ctrl+C to cancel it after its stuck:

Traceback (most recent call last):
File "publish.py", line 81, in
sys.exit(main(sys.argv[1:]))
File "publish.py", line 34, in main
return publish(
File "publish.py", line 55, in publish
hash_docs = client.add("build/html", recursive=True, raw_leaves=True, pin=False)[-1]["Hash"]
File "/home/c0llab0rat0r/code/github/self/py-ipfs-http-client/ipfshttpclient/client/files.py", line 373, in add
resp = self._client.request('/add', decoder='json', data=body, headers=headers, **kwargs)
File "/home/c0llab0rat0r/code/github/self/py-ipfs-http-client/ipfshttpclient/http_common.py", line 583, in request
closables, res = self._request(
File "/home/c0llab0rat0r/code/github/self/py-ipfs-http-client/ipfshttpclient/http_requests.py", line 165, in _request
res = session.request(
File "/home/c0llab0rat0r/code/github/self/py-ipfs-http-client/ipfshttpclient/requests_wrapper.py", line 230, in request
return super().request(method, url, *args, **kwargs)
File "/home/c0llab0rat0r/code/github/self/py-ipfs-http-client/venv/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/home/c0llab0rat0r/code/github/self/py-ipfs-http-client/venv/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/home/c0llab0rat0r/code/github/self/py-ipfs-http-client/venv/lib/python3.8/site-packages/requests/adapters.py", line 482, in send
r = low_conn.getresponse()
File "/usr/lib/python3.8/http/client.py", line 1347, in getresponse
response.begin()
File "/usr/lib/python3.8/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.8/http/client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions