https://prefect.io logo
s

scott

08/01/2023, 5:31 PM
Anyone have experience with
NotReady
state? A flow of ours failed with a task in that state, which apparently caused the entire flow to fail. Retrying from the UI results the same problem. More details in thread.
Here’s the logs from the flow
Copy code
17:29:38.097 | INFO    | Flow run 'vivid-jaybird' - Created task run 'my task' for task 'my task'
17:29:38.098 | INFO    | Flow run 'vivid-jaybird' - Executing 'my task' immediately...
17:29:38.282 | ERROR   | Flow run 'vivid-jaybird' - Encountered exception during execution:
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/prefect/engine.py", line 833, in orchestrate_flow_run
    result = await flow_call.aresult()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 292, in aresult
    return await asyncio.wrap_future(self.future)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 316, in _run_sync
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmp0yxu607hprefect/thing.py", line 93, in person
    my_task = run.with_options(name="my task")(
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/tasks.py", line 505, in __call__
    return enter_task_run_engine(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/engine.py", line 1137, in enter_task_run_engine
    return from_sync.wait_for_call_in_loop_thread(begin_run)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/api.py", line 243, in wait_for_call_in_loop_thread
    return call.result()
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 283, in result
    return self.future.result(timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 169, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 346, in _run_async
    result = await coro
             ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/engine.py", line 1302, in get_task_call_return_value
    return await future._result()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/futures.py", line 237, in _result
    return await final_state.result(raise_on_failure=raise_on_failure, fetch=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/states.py", line 84, in _get_state_result
    raise UnfinishedRun(
prefect.exceptions.UnfinishedRun: Run is in PENDING state, its result is not available.
17:29:38.297 | DEBUG   | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/xxx>
17:29:38.396 | DEBUG   | prefect.task_runner.concurrent - Shutting down task runner...
17:29:38.396 | ERROR   | Flow run 'vivid-jaybird' - Finished in state Failed('Flow run encountered an exception. UnfinishedRun: Run is in PENDING state, its result is not available.')
n

Nate

08/01/2023, 6:19 PM
could you share the code by chance?
s

scott

08/01/2023, 6:21 PM
Could I share to you in DM?
n

Nate

08/01/2023, 6:22 PM
yep!
d

Deceivious

08/02/2023, 8:01 AM
Ive had these as well. Can you please let me know what was the cause / solution to this?
Pinging @Nate
Mine was in Running state instead.
s

scott

08/02/2023, 1:52 PM
We haven’t figured it out yet. Ran the flow again and the flow failed at the previous task. I’ve been trying to reproduce it with a minimal example without success yet