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

Thumbnail request raises "OSError: [Errno 107] Transport endpoint is not connected" #655

Closed
AetherUnbound opened this issue Feb 6, 2023 · 1 comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API 🐛 tooling: sentry Sentry issue
Projects

Comments

@AetherUnbound
Copy link
Contributor

AetherUnbound commented Feb 6, 2023

Sentry link

https://openverse.sentry.io/share/issue/1764849effe1498c85c4138a3bb105e6/

Description

This seems to be a sparse issue, we've only received 5 events over the last few days. The stack trace looks like this:

OSError: [Errno 107] Transport endpoint is not connected
  File "urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "urllib3/connection.py", line 456, in connect
    cert = self.sock.getpeercert()
  File "gevent/_ssl3.py", line 440, in getpeercert
    self._check_connected()
  File "gevent/_ssl3.py", line 365, in _check_connected
    self.getpeername()
  File "gevent/_socketcommon.py", line 560, in getpeername
    return self._sock.getpeername()

ProtocolError: ('Connection aborted.', OSError(107, 'Transport endpoint is not connected'))
  File "requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "urllib3/connection.py", line 456, in connect
    cert = self.sock.getpeercert()
  File "gevent/_ssl3.py", line 440, in getpeercert
    self._check_connected()
  File "gevent/_ssl3.py", line 365, in _check_connected
    self.getpeername()
  File "gevent/_socketcommon.py", line 560, in getpeername
    return self._sock.getpeername()

ConnectionError: ('Connection aborted.', OSError(107, 'Transport endpoint is not connected'))
  File "catalog/api/utils/photon.py", line 72, in get
    upstream_response = requests.get(
  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 587, in request
    resp = self.send(prep, **send_kwargs)
  File "requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "requests/adapters.py", line 547, in send
    raise ConnectionError(err, request=request)

For all I can tell, this is an issue deep in the bowels of the request process. I've looked for "Transport endpoint is not connected" in both urllib3 and gevents and neither gave me any results. All of the StackOverflow results for this seem to point to socket usage, which is not something we're dictating by hand when we issue this request.

Reproduction

The URLs for each event don't reproduce the issue for me.

@AetherUnbound AetherUnbound added 💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon 🐛 tooling: sentry Sentry issue labels Feb 6, 2023
@obulat obulat transferred this issue from WordPress/openverse-api Feb 22, 2023
@obulat obulat added 🧱 stack: api Related to the Django API and removed 🧱 stack: backend labels Mar 20, 2023
@sarayourfriend
Copy link
Contributor

Closing as stale. The sentry issue doesn't exist any more and we haven't seen it at all recently as far as I can tell. If it comes up again we can open a new issue and prioritise it.

@sarayourfriend sarayourfriend closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API 🐛 tooling: sentry Sentry issue
Projects
Archived in project
Openverse
  
Backlog
Development

No branches or pull requests

3 participants