laws-africa / peachjam

Project Peach Jam
https://agp.africanlii.org
GNU General Public License v3.0
2 stars 0 forks source link

ReadTimeout: HTTPSConnectionPool(host='services.lawsafrica.com', port=443): Read timed out. (read timeout=60) #1717

Open sentry-io[bot] opened 8 months ago

sentry-io[bot] commented 8 months ago

Sentry Issue: LII-ZS

timeout: The read operation timed out
(4 additional frame(s) were not displayed)
...
  File "<string>", line 3, in raise_from
    # Permission is hereby granted, free of charge, to any person obtaining a copy

ReadTimeoutError: HTTPSConnectionPool(host='services.lawsafrica.com', port=443): Read timed out. (read timeout=60)
(2 additional frame(s) were not displayed)
...
  File "urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "urllib3/packages/six.py", line 770, in reraise
    raise value
  File "urllib3/connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
  File "urllib3/connectionpool.py", line 469, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "urllib3/connectionpool.py", line 358, in _raise_timeout
    raise ReadTimeoutError(

ReadTimeout: HTTPSConnectionPool(host='services.lawsafrica.com', port=443): Read timed out. (read timeout=60)
(21 additional frame(s) were not displayed)
...
  File "peachjam/models/core_document_model.py", line 568, in extract_citations
    return citation_analyser.extract_citations(self)
  File "peachjam/analysis/citations.py", line 28, in extract_citations
    return self.extract_citations_from_source_file(document)
  File "peachjam/analysis/citations.py", line 44, in extract_citations_from_source_file
    matcher.extract_text_matches(document.expression_uri(), text)
  File "peachjam/analysis/citations.py", line 121, in extract_text_matches
    resp = self.call_citator(
  File "peachjam/analysis/citations.py", line 152, in call_citator
    resp = requests.post(self.citator_url, json=body, headers=headers, timeout=60)
longhotsummer commented 8 months ago

Ideally we shouldn't prevent an import just because the citator failed. However, we don't want to them never extract citations.

So we need to perhaps line up a background task to extract citations?