Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

pangeo-forge-runner does not guarantee "status" fields on every log line #132

@cisaacstern

Description

@cisaacstern

I just called a recipe test here pangeo-forge/staged-recipes#183 (comment)

The resulting pangeo-forge-runner subprocess call failed with a KeyError

Details
2022-09-19T16:31:51.157842+00:00 app[web.1]: subprocess.CalledProcessError: Command '['pangeo-forge-runner', 'bake', '--repo=https://github.com/eooffshore/staged-recipes', '--ref=037542663cb7f7bc4a04777c90d85accbff01c8c', '--json', '--prune', '--Bake.recipe_id=eooffshore_ics_cmems_WIND_GLO_WIND_L3_NRT_OBSERVATIONS_012_002_MetOp_ASCAT', '-f=/tmp/tmp5_e7dib5.json', '--feedstock-subdir=recipes/eooffshore_ics_cms_WIND_GLO_WIND_L3_OBSERVATIONS_Metop_ASCAT']' returned non-zero exit status 1.
2022-09-19T16:31:51.157842+00:00 app[web.1]: 
2022-09-19T16:31:51.157842+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2022-09-19T16:31:51.157843+00:00 app[web.1]: 
2022-09-19T16:31:51.157843+00:00 app[web.1]: Traceback (most recent call last):
2022-09-19T16:31:51.157844+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
2022-09-19T16:31:51.157844+00:00 app[web.1]: result = await app(self.scope, self.receive, self.send)
2022-09-19T16:31:51.157851+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
2022-09-19T16:31:51.157851+00:00 app[web.1]: return await self.app(scope, receive, send)
2022-09-19T16:31:51.157851+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 208, in __call__
2022-09-19T16:31:51.157852+00:00 app[web.1]: await super().__call__(scope, receive, send)
2022-09-19T16:31:51.157852+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 112, in __call__
2022-09-19T16:31:51.157853+00:00 app[web.1]: await self.middleware_stack(scope, receive, send)
2022-09-19T16:31:51.157853+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 181, in __call__
2022-09-19T16:31:51.157853+00:00 app[web.1]: raise exc
2022-09-19T16:31:51.157854+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 159, in __call__
2022-09-19T16:31:51.157854+00:00 app[web.1]: await self.app(scope, receive, _send)
2022-09-19T16:31:51.157854+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/cors.py", line 84, in __call__
2022-09-19T16:31:51.157855+00:00 app[web.1]: await self.app(scope, receive, send)
2022-09-19T16:31:51.157855+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
2022-09-19T16:31:51.157855+00:00 app[web.1]: raise exc
2022-09-19T16:31:51.157856+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 71, in __call__
2022-09-19T16:31:51.157856+00:00 app[web.1]: await self.app(scope, receive, sender)
2022-09-19T16:31:51.157856+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 656, in __call__
2022-09-19T16:31:51.157856+00:00 app[web.1]: await route.handle(scope, receive, send)
2022-09-19T16:31:51.157857+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 259, in handle
2022-09-19T16:31:51.157857+00:00 app[web.1]: await self.app(scope, receive, send)
2022-09-19T16:31:51.157857+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 64, in app
2022-09-19T16:31:51.157858+00:00 app[web.1]: await response(scope, receive, send)
2022-09-19T16:31:51.157858+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/responses.py", line 159, in __call__
2022-09-19T16:31:51.157858+00:00 app[web.1]: await self.background()
2022-09-19T16:31:51.157859+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/background.py", line 35, in __call__
2022-09-19T16:31:51.157859+00:00 app[web.1]: await task()
2022-09-19T16:31:51.157859+00:00 app[web.1]: File "/usr/local/lib/python3.9/dist-packages/starlette/background.py", line 18, in __call__
2022-09-19T16:31:51.157859+00:00 app[web.1]: await self.func(*self.args, **self.kwargs)
2022-09-19T16:31:51.157860+00:00 app[web.1]: File "/opt/app/pangeo_forge_orchestrator/routers/github_app.py", line 838, in run_recipe_test
2022-09-19T16:31:51.157860+00:00 app[web.1]: await run(*args, **kws, gh=gh, db_session=db_session)
2022-09-19T16:31:51.157860+00:00 app[web.1]: File "/opt/app/pangeo_forge_orchestrator/routers/github_app.py", line 618, in run
2022-09-19T16:31:51.157860+00:00 app[web.1]: if p["status"] == "failed":
2022-09-19T16:31:51.157861+00:00 app[web.1]: KeyError: 'status'

which indicates that the assumption that failed pangeo-forge-runner calls will always provide a log line with a "status" field

except subprocess.CalledProcessError as e:
for line in e.output.splitlines():
p = json.loads(line)
if p["status"] == "failed":

is faulty.

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