<@ULVA73B9P> I am getting this error for most of m...
# ask-marvin
x
@Marvin I am getting this error for most of my flows but all the flow runs marked as successfully completed.
Copy code
An error occurred while monitoring flow run 'f63aabc6-12b3-4b62-9b57-3d6e067452da'. The flow run will not be marked as failed, but an issue may have occurred.
  + Exception Group Traceback (most recent call last):
  |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/workers/base.py", line 908, in _submit_run_and_capture_errors
  |     result = await self.run(
  |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/workers/process.py", line 166, in run
  |     process = await run_process(
  |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/utilities/processutils.py", line 273, in run_process
  |     await consume_process_output(
  |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/utilities/processutils.py", line 287, in consume_process_output
  |     async with anyio.create_task_group() as tg:
  |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
  |     raise BaseExceptionGroup(
  | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/utilities/processutils.py", line 314, in stream_text
    |     await sink.write(item)
    |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/anyio/_core/_fileio.py", line 109, in write
    |     return await to_thread.run_sync(self._fp.write, b)
    |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
    |     return await get_async_backend().run_sync_in_worker_thread(
    |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    |     return await future
    |   File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    |     result = context.run(func, *args)
    | OSError: [Errno 5] Input/output error
    +------------------------------------
This error will not show up if I run the flow as python function from the command line. But it is always there if I run using prefect deployment run. For example: prefect deployment run 'hello-sync/hello_sync-test-deployment' A process work pool is used for the flow deployment. Here is the test code:
Copy code
import sys

from prefect import task, flow


@task(log_prints=True)
def say_hello_sync():
    print('Hello!')


@flow(log_prints=True)
def hello_sync():
    say_hello_sync()


def main():
    if len(sys.argv) > 1 and sys.argv[1] == 'run':
        hello_sync()
    else:
        print('Unsupported operation: ', sys.argv)
    print('completed: ', sys.argv)


if __name__ == "__main__":
    main()
Here is the prefect.yaml file content:
Copy code
name: prefect2
prefect-version: 2.20.0

build: null

push: null

pull:
- prefect.deployments.steps.set_working_directory:
    directory: /home/pentaho/prefect2

deployments:
- name: hello_sync-test-deployment
  version:
  tags: []
  entrypoint: playground/test_sync.py:hello_sync
  parameters: {}
  work_pool:
    name: id90-process-pool
    work_queue_name:
    job_variables: {}
  schedules: []
  description: 'a test'
How do I find out the root cause of it? Please let me know more details are needed.
m
Your message was too long by 704 tokens - please shorten it and try again. For reference, here's your message at the allowed limit:
I am getting this error for most of my flows but all the flow runs marked as successfully completed.
```An error occurred while monitoring flow run 'f63aabc6-12b3-4b62-9b57-3d6e067452da'. The flow run will not be marked as failed, but an issue may have occurred. + Exception Group Traceback (most recent call last): | File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/workers/base.py", line 908, in _submit_run_and_capture_errors | result = await self.run( | File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/workers/process.py", line 166, in run | process = await run_process( | File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/utilities/processutils.py", line 273, in run_process | await consume_process_output( | File "/home/pentaho/anaconda3/envs/py310/lib/python3.10/site-packages/prefect/utilities/processutils.py", line 287, in consume_process_output | async with anyio.create_task_group() as tg: | File "/home
x
@Marvin Here is the shortened error: An error occurred while monitoring flow run 'f63aabc6-12b3-4b62-9b57-3d6e067452da'. The flow run will not be marked as failed, but an issue may have occurred. + Exception Group Traceback (most recent call last): prefect/workers/base.py", line 908, in _submit_run_and_capture_errors result = await self.run( /prefect/workers/process.py", line 166, in run process = await run_process( /prefect/utilities/processutils.py", line 273, in run_process await consume_process_output( /prefect/utilities/processutils.py", line 287, in consume_process_output async with anyio.create_task_group() as tg: /anyio/_backends/_asyncio.py", line 680, in aexit raise BaseExceptionGroup( exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) Traceback (most recent call last): /prefect/utilities/processutils.py", line 314, in stream_text await sink.write(item) /anyio/_core/_fileio.py", line 109, in write return await to_thread.run_sync(self._fp.write, b) /anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( /anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future /anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) OSError: [Errno 5] Input/output error which only happens to prefect deployment run but not from running directly the entry point though python command.
m
Your message was too long by 104 tokens - please shorten it and try again. For reference, here's your message at the allowed limit:
Here is the shortened error:
An error occurred while monitoring flow run 'f63aabc6-12b3-4b62-9b57-3d6e067452da'. The flow run will not be marked as failed, but an issue may have occurred. + Exception Group Traceback (most recent call last): prefect/workers/base.py", line 908, in _submit_run_and_capture_errors result = await self.run( /prefect/workers/process.py", line 166, in run process = await run_process( /prefect/utilities/processutils.py", line 273, in run_process await consume_process_output( /prefect/utilities/processutils.py", line 287, in consume_process_output async with anyio.create_task_group() as tg: /anyio/_backends/_asyncio.py", line 680, in aexit raise BaseExceptionGroup( exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) Traceback (most recent call last): /prefect/utilities/processutils.py", line 314, in stream_text await sink.write(item) /anyio/_core/_fileio.py", line 109, in write return await to_thread.run_sync(self._fp.write, b) /anyio/to_thread.py", line 56, in run_sync
x
@Marvin Here is the shortened error: An error occurred while monitoring flow run 'f63aabc6-12b3-4b62-9b57-3d6e067452da'. The flow run will not be marked as failed, but an issue may have occurred. + Exception Group Traceback (most recent call last): ... async with anyio.create_task_group() as tg: /anyio/_backends/_asyncio.py", line 680, in aexit raise BaseExceptionGroup( exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) Traceback (most recent call last): /prefect/utilities/processutils.py", line 314, in stream_text await sink.write(item) /anyio/_core/_fileio.py", line 109, in write return await to_thread.run_sync(self._fp.write, b) /anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( /anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future /anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) OSError: [Errno 5] Input/output error which only happens to prefect deployment run but not from running directly the entry point though python command.
m
Your message was too long by 13 tokens - please shorten it and try again. For reference, here's your message at the allowed limit:
Here is the shortened error:
An error occurred while monitoring flow run 'f63aabc6-12b3-4b62-9b57-3d6e067452da'. The flow run will not be marked as failed, but an issue may have occurred. + Exception Group Traceback (most recent call last): ... async with anyio.create_task_group() as tg: /anyio/_backends/_asyncio.py", line 680, in aexit raise BaseExceptionGroup( exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) Traceback (most recent call last): /prefect/utilities/processutils.py", line 314, in stream_text await sink.write(item) /anyio/_core/_fileio.py", line 109, in write return await to_thread.run_sync(self._fp.write, b) /anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( /anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future /anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) OSError: [Errno 5] Input/output error which only happens to prefect deployment
x
@Marvin how about An error occurred while monitoring flow run 'f63aabc6-12b3-4b62-9b57-3d6e067452da'. The flow run will not be marked as failed, but an issue may have occurred. + Exception Group Traceback (most recent call last): ... async with anyio.create_task_group() as tg: /anyio/_backends/_asyncio.py", line 680, in aexit raise BaseExceptionGroup( exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) Traceback (most recent call last): /prefect/utilities/processutils.py", line 314, in stream_text ... /anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future /anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) OSError: [Errno 5] Input/output error which only happens to prefect deployment run but not from running directly the entry point though python command.
m
To troubleshoot the error you're encountering, I found some useful information: 1. Prefect Troubleshooting Guide: Reference: "HTTPX disabled redirect following by default" in 0.22.0 Example error:
PytestUnraisableExceptionWarning: Exception ignored in: <ssl.SSLSocket fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0>
This error suggests an unclosed resource, like a network socket, often seen when running tests or managing connections incorrectly. You might be encountering something similar if an underlying resource or connection is not being managed correctly in your deployment. Link: https://docs.prefect.io/latest/guides/troubleshooting/ 2. Unhandled Errors in a Task Group: Your error indicates a failure within an
anyio
task group, typically related to async task execution. Specifically, the
OSError: [Errno 5] Input/output error
might be signaling a deeper issue with resource access or network connectivity. If your deployment runs into IO issues while direct execution does not, it might indicate environment-specific problems such as: - File access permissions - Network issues - Resource limits differing between development and deployment environments Next Steps: - Review your deployment environment's access to required resources. - Ensure any network connections, files, or other IO operations have appropriate permissions and are correctly handled. - Look into async task management in your deployment script. There might be resources not being properly awaited or closed. If issues persist, more specific details about your deployment configuration and environment setup might be needed to diagnose further. If you need further guidance, let me know!