Hi everyone! I’ve just installed Prefect 3.1.0 and...
# ask-community
g
Hi everyone! I’ve just installed Prefect 3.1.0 and I’m getting this error:
Copy code
prefect.exceptions.ScriptError: Script at '<>' encountered an exception: PydanticUserError('The `__modify_schema__` method is not supported in Pydantic v2. Use `__get_pydantic_json_schema__` instead in class `SecretStr`.')
any idea how to fix it? Full stacktrace in thread
the full stacktrace:
Copy code
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]: Traceback (most recent call last):
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/engine.py", line 37, in <module>
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     flow_run, flow = load_flow_and_flow_run(flow_run_id=flow_run_id)
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/flow_engine.py", line 104, in load_flow_and_flow_run
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     flow = run_coro_as_sync(
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 243, in run_coro_as_sync
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     return call.result()
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 312, in result
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     return self.future.result(timeout=timeout)
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 182, in result
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     return self.__get_result()
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     raise self._exception
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 383, in _run_async
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     result = await coro
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 225, in coroutine_wrapper
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     return await task
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/client/utilities.py", line 75, in wrapper
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     return await func(client, *args, **kwargs)
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/flows.py", line 1949, in load_flow_from_flow_run
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     flow = await run_sync_in_worker_thread(
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 269, in run_sync_in_worker_thread
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     result = await anyio.to_thread.run_sync(
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     return await get_async_backend().run_sync_in_worker_thread(
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     return await future
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     result = context.run(func, *args)
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 279, in call_with_mark
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     return call()
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/flows.py", line 1742, in load_flow_from_entrypoint
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     flow = import_object(entrypoint)
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/utilities/importtools.py", line 205, in import_object
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     module = load_script_as_module(script_path)
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:   File "/home/prefect/prefect_venv/lib/python3.10/site-packages/prefect/utilities/importtools.py", line 168, in load_script_as_module
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]:     raise ScriptError(user_exc=exc, path=path) from exc
Jan 14 12:17:02 ip-172-30-1-49 start_agent.sh[3475]: prefect.exceptions.ScriptError: Script at '<>' encountered an exception: PydanticUserError('The `__modify_schema__` method is not supported in Pydantic v2. Use `__get_pydantic_json_schema__` instead in class `SecretStr`.')
c
this is almost always due to having an out-of-date integration library (like
prefect-aws
); see our GitHub issues for more details
g
@Chris White thank you for your answer. I’ve created a brand new python environment with an update prefect-aws version when I got that error
c
hmm interesting - the best next step then would be to open up a github issue for us to investigate that includes a reproducible example; we don't use `__modify_schema__` anywhere so I still believe this is something off with your environment, I'm just not sure what it could be