Hi, I am evaluating prefect cloud 2.0 and ran into...
# prefect-ui
k
Hi, I am evaluating prefect cloud 2.0 and ran into the following
PrefectHTTPStatusError
for one of my subflow runs. The cloud UI also is in an inconsistent state since it says flow/subflow is still running. It works fine locally. Any help would be appreciated!
Copy code
Encountered exception during execution:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/prefect/engine.py", line 559, in orchestrate_flow_run
    result = await run_sync(flow_call)
  File "/usr/local/lib/python3.9/site-packages/prefect/utilities/asyncutils.py", line 56, in run_sync_in_worker_thread
    return await anyio.to_thread.run_sync(call, cancellable=True)
  File "/usr/local/lib/python3.9/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/root/deployer/pipeline.py", line 21, in run_ro
    etl.run_ro()
  File "/usr/local/lib/python3.9/site-packages/prefect/flows.py", line 367, in __call__
    return enter_flow_run_engine_from_flow_call(
  File "/usr/local/lib/python3.9/site-packages/prefect/engine.py", line 154, in enter_flow_run_engine_from_flow_call
    return run_async_from_worker_thread(begin_run)
  File "/usr/local/lib/python3.9/site-packages/prefect/utilities/asyncutils.py", line 136, in run_async_from_worker_thread
    return anyio.from_thread.run(call)
  File "/usr/local/lib/python3.9/site-packages/anyio/from_thread.py", line 49, in run
    return asynclib.run_async_from_thread(func, *args)
  File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 970, in run_async_from_thread
    return f.result()
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 445, in result
    return self.__get_result()
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.9/site-packages/prefect/client.py", line 104, in with_injected_client
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/prefect/engine.py", line 454, in create_and_begin_subflow_run
    terminal_state = await orchestrate_flow_run(
  File "/usr/local/lib/python3.9/contextlib.py", line 670, in __aexit__
    raise exc_details[1]
  File "/usr/local/lib/python3.9/contextlib.py", line 653, in __aexit__
    cb_suppress = await cb(*exc_details)
  File "/usr/local/lib/python3.9/contextlib.py", line 199, in __aexit__
    await self.gen.athrow(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/prefect/engine.py", line 1181, in report_flow_run_crashes
    await client.set_flow_run_state(
  File "/usr/local/lib/python3.9/site-packages/prefect/client.py", line 1505, in set_flow_run_state
    response = await <http://self._client.post|self._client.post>(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1842, in post
    return await self.request(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1527, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.9/site-packages/prefect/client.py", line 277, in send
    response.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/prefect/client.py", line 223, in raise_for_status
    raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Server error '503 Service Unavailable' for url '<https://api-beta.prefect.io/api/accounts/cf175afc-09c0-4bc3-bdba-2ad01653e8ea/workspaces/7eb80c34-5efe-4f01-9ee9-64715100b7e3/flow_runs/29563420-7c6f-4680-97bf-14d148d06ee7/set_state>'
For more information check: <https://httpstatuses.com/503>
02:01:18 PM
Crash detected! Execution was interrupted by an unexpected exception.
1
j
Hi @Karanveer Mohan - thanks for the question. I'm checking with the team on this one.
a
Can you upgrade Prefect to the latest version? This should fix your issue:
Copy code
pip install -U "prefect>=2.0b"
k
thank you! will report back if the issue happens again 🙏
👍 1
🙌 1
1
FYI, my pipelines failed last night on 2.0b14 with the following error:
Copy code
PrefectHTTPStatusError: Client error '400 Bad Request' for url '<https://api-beta.prefect.io/api/accounts/cf175afc-09c0-4bc3-bdba-2ad01653e8ea/workspaces/7eb80c34-5efe-4f01-9ee9-64715100b7e3/flows/>'
Response: {'detail': 'The request specified API version 0.7.0 but this serverrequires version 0.8.0 or higher.'}
I updated to 2.0b15 today and it seems to have fixed it. Just an FYI for others 🙂
🙌 2
2
102 Views