MIT-LCP / physionet-build

The new PhysioNet platform.
https://physionet.org/
BSD 3-Clause "New" or "Revised" License
55 stars 20 forks source link

Transient "StopIteration"/"JSONDecodeError" error from poetry #1997

Open bemoody opened 1 year ago

bemoody commented 1 year ago

A workflow run for one of Lama's pull requests failed for no obvious reason. Re-running the workflow magically made it work. The error clearly had nothing to do with the pull request in question.

The error message was:


  StopIteration

  0

  at /usr/lib/python3.9/json/decoder.py:353 in raw_decode
      349│         have extraneous data at the end.
      350│ 
      351│         """
      352│         try:
    → 353│             obj, end = self.scan_once(s, idx)
      354│         except StopIteration as err:
      355│             raise JSONDecodeError("Expecting value", s, err.value) from None
      356│         return obj, end
      357│ 

The following error occurred when trying to handle this error:

  JSONDecodeError

  Expecting value: line 1 column 1 (char 0)

  at /usr/lib/python3.9/json/decoder.py:355 in raw_decode
      351│         """
      352│         try:
      353│             obj, end = self.scan_once(s, idx)
      354│         except StopIteration as err:
    → 355│             raise JSONDecodeError("Expecting value", s, err.value) from None
      356│         return obj, end
      357│ 

I have no idea what this means. This message was apparently produced by either the command poetry config virtualenvs.create false or poetry install --no-root (guessing it was the latter? it's not apparent from the log.)

As far as I can see, the first workflow run (which failed) and the second (which passed) used exactly the same container and exactly the same set of Python packages, as well as using exactly the same Git commit (ddea7b56243292cba23040939cb0e3918e4785ba).

Complete logs are here:

https://challenge.physionet.org/benjamin/pnstuff/4917997795-fail.zip

https://challenge.physionet.org/benjamin/pnstuff/4917997795-pass.zip

tompollard commented 1 year ago

It looks like it happens during the installation of Pillow:

2023-05-08T17:48:34.8617003Z   • Installing google-api-python-client (1.12.8)
2023-05-08T17:48:34.9939452Z   • Installing hdn-research-environment (1.4.0)
2023-05-08T17:48:35.0242514Z   • Installing html2text (2018.1.9)
2023-05-08T17:48:35.0413399Z   • Installing pdfminer-six (20211012)
2023-05-08T17:48:35.1899480Z   • Installing pillow (9.3.0)
2023-05-08T17:48:36.8358673Z 
2023-05-08T17:48:36.8361018Z   StopIteration
2023-05-08T17:48:36.8361294Z 
2023-05-08T17:48:36.8361384Z   0
2023-05-08T17:48:36.8361523Z 
2023-05-08T17:48:36.8362140Z   at /usr/lib/python3.9/json/decoder.py:353 in raw_decode
2023-05-08T17:48:36.8639834Z       349│         have extraneous data at the end.
2023-05-08T17:48:36.8659823Z       350│ 
2023-05-08T17:48:36.8668539Z       351│         """
2023-05-08T17:48:36.8674349Z       352│         try:
2023-05-08T17:48:36.8683760Z     → 353│             obj, end = self.scan_once(s, idx)
2023-05-08T17:48:36.8691703Z       354│         except StopIteration as err:
2023-05-08T17:48:36.8736057Z       355│             raise JSONDecodeError("Expecting value", s, err.value) from None
2023-05-08T17:48:36.8746621Z       356│         return obj, end
2023-05-08T17:48:36.8752092Z       357│ 
2023-05-08T17:48:36.8768756Z 
2023-05-08T17:48:36.8772511Z The following error occurred when trying to handle this error:
2023-05-08T17:48:36.8776204Z 
2023-05-08T17:48:36.8780044Z 
2023-05-08T17:48:36.8784186Z   JSONDecodeError
2023-05-08T17:48:36.8791300Z 
2023-05-08T17:48:36.8817220Z   Expecting value: line 1 column 1 (char 0)
2023-05-08T17:48:36.8833013Z 
2023-05-08T17:48:36.8833288Z   at /usr/lib/python3.9/json/decoder.py:355 in raw_decode
2023-05-08T17:48:36.9011745Z       351│         """
2023-05-08T17:48:36.9026209Z       352│         try:
2023-05-08T17:48:36.9032211Z       353│             obj, end = self.scan_once(s, idx)
2023-05-08T17:48:36.9086272Z       354│         except StopIteration as err:
2023-05-08T17:48:36.9094255Z     → 355│             raise JSONDecodeError("Expecting value", s, err.value) from None
2023-05-08T17:48:36.9109332Z       356│         return obj, end
2023-05-08T17:48:36.9110057Z       357│ 
2023-05-08T17:48:36.9110209Z 
2023-05-08T17:48:36.9117211Z   • Installing psycopg2 (2.9.5)
2023-05-08T17:48:36.9172428Z   • Installing pyopenssl (23.1.1)
2023-05-08T17:48:37.0958564Z   • Installing python-decouple (3.4)
2023-05-08T17:48:37.2476221Z   • Installing python-json-logger (2.0.2)
2023-05-08T17:48:37.3648740Z   • Installing requests-mock (1.9.3)
2023-05-08T17:48:37.3746305Z   • Installing requests-oauthlib (1.3.0)
2023-05-08T17:48:37.5382945Z   • Installing selenium (3.141.0)
2023-05-08T17:48:37.5994547Z   • Installing sentry-sdk (1.14.0)
2023-05-08T17:48:37.7382340Z   • Installing uwsgi (2.0.21)
2023-05-08T17:48:38.0564982Z   • Installing zxcvbn (4.4.28)
2023-05-08T17:49:01.5442107Z ##[error]Process completed with exit code 1.

For me it is reasonably common for a PR to fail when installing packages (across all repos, not just this repo, maybe 1/100 PRs?). I'd always put this down to a network problem.

bemoody commented 11 months ago

Another transient error (this one happened in pull #2113):

2023-10-17T15:46:55.1948647Z 
2023-10-17T15:46:55.1949022Z   ChefBuildError
2023-10-17T15:46:55.1949240Z 
2023-10-17T15:46:55.1949813Z   Backend 'setuptools.build_meta:__legacy__' is not available.
2023-10-17T15:46:55.1952728Z 
2023-10-17T15:46:55.1953571Z   at /env3/lib/python3.11/site-packages/poetry/installation/chef.py:147 in _prepare
2023-10-17T15:46:55.2011685Z       143│ 
2023-10-17T15:46:55.2014891Z       144│                 error = ChefBuildError("\n\n".join(message_parts))
2023-10-17T15:46:55.2018449Z       145│ 
2023-10-17T15:46:55.2019266Z       146│             if error is not None:
2023-10-17T15:46:55.2023009Z     → 147│                 raise error from None
2023-10-17T15:46:55.2023711Z       148│ 
2023-10-17T15:46:55.2026362Z       149│             return path
2023-10-17T15:46:55.2027047Z       150│ 
2023-10-17T15:46:55.2030606Z       151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
2023-10-17T15:46:55.2034533Z 
2023-10-17T15:46:55.2036848Z Note: This error originates from the build backend, and is likely not a problem with poetry but with jwcrypto (1.4.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "jwcrypto (==1.4.2)"'.
2023-10-17T15:46:55.2040154Z 
2023-10-17T15:46:55.5138771Z ##[error]Process completed with exit code 1.