When I run flow or tasks everything works well. The problem is when I try to create a deployment.
Using Windows 11 the error occurred even when running locally or in the cloud
The following error happen:
import sys
import prefect
from prefect import flow, task, get_run_logger
import os
os.environ["PYTHONUTF8"] = "1"
@task
def log_task(name):
logger = get_run_logger()
logger.info("Hello %s!", name)
logger.info("Prefect Version = %s 🚀", prefect.
version)
logger.debug("Testing")
@flow()
def log_flow(name: str):
log_task(name)
if
name == "__main__":
log_flow.serve(
name="my-first-deployment",
cron="*/1 * * * *",
tags=["my-deployment-tag"]
)
Your flow 'log-flow' is being served and polling for scheduled runs!
To trigger a run for this flow, use the following command:
$ prefect deployment run 'log-flow/my-first-deployment 12345'
You can also run your flow via the Prefect UI:
https://app.prefect.cloud/account/41dc1f1c-e34f-4c91-a2cf-59020e8e9a7e/workspace/8f4009ea-d877-4c2c-b471-9298f549b392/deployments/deployment/b52425c6-303c-4408-a38c-7cfc26339a35
03
1150.547 | INFO | prefect.flow_runs.runner - Runner 'my-first-deployment 12345' submitting flow run '64be0491-7fca-4025-bd57-29a36054aee0'
03
1150.849 | INFO | prefect.flow_runs.runner - Opening process...
03
1150.857 | INFO | prefect.flow_runs.runner - Completed submission of flow run '64be0491-7fca-4025-bd57-29a36054aee0'
03
1150.865 | ERROR | prefect.flow_runs.runner - An error occurred while monitoring flow run '64be0491-7fca-4025-bd57-29a36054aee0'. The flow run will not be marked as failed, but an issue may have occurred.
Traceback (most recent call last):
File "d:\Douglas\Profissional\Trabalhos Pessoais\20231223_Value_Investing_System\repositorio\vis-workflow\venv\Lib\site-packages\prefect\runner\runner.py", line 966, in _submit_run_and_capture_errors
status_code = await self._run_process(
^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Douglas\Profissional\Trabalhos Pessoais\20231223_Value_Investing_System\repositorio\vis-workflow\venv\Lib\site-packages\prefect\runner\runner.py", line 580, in _run_process
process = await run_process(
^^^^^^^^^^^^^^^^^^
File "d:\Douglas\Profissional\Trabalhos Pessoais\20231223_Value_Investing_System\repositorio\vis-workflow\venv\Lib\site-packages\prefect\utilities\processutils.py", line 273, in run_process
await consume_process_output(
File "d:\Douglas\Profissional\Trabalhos Pessoais\20231223_Value_Investing_System\repositorio\vis-workflow\venv\Lib\site-packages\anyio\_backends\_asyncio.py", line 597, in
aexit
raise exceptions[0]
File "d:\Douglas\Profissional\Trabalhos Pessoais\20231223_Value_Investing_System\repositorio\vis-workflow\venv\Lib\site-packages\prefect\utilities\processutils.py", line 309, in stream_text
async for item in source:
File "d:\Douglas\Profissional\Trabalhos Pessoais\20231223_Value_Investing_System\repositorio\vis-workflow\venv\Lib\site-packages\anyio\abc\_streams.py", line 34, in
anext
return await self.receive()
^^^^^^^^^^^^^^^^^^^^
File "d:\Douglas\Profissional\Trabalhos Pessoais\20231223_Value_Investing_System\repositorio\vis-workflow\venv\Lib\site-packages\anyio\streams\text.py", line 46, in receive
decoded = self._decoder.decode(chunk)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
frozen codecs", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc6 in position 37: invalid continuation byte