Hi all, I was trying to run a Prefect agent on my local machine with a deployment using a docker container for the infrastructure block. I am able to build the docker image with my dockerfile set up and deploy a flow using the infrastructure block, along with a storage block.
However, after deploying, when I try to run the flow with the agent running on my machine, it is giving this error saying: 'charmap' codec can't encode characters in position 5-44: character maps to <undefined>
Based on the error text, it sounds like there might be something with one of the variables it is pulling in (like it is trying to read a special character and not able to or something). However, I can't tell where the issue is occurring based on the error message.
Does anyone have more insight on how this error might occur? See screenshots for the error and deployment code that I have.
Let me know if you need any more details. Was working on this with @Joseph Loss
One other thing to note is that, once I hit ctrl-C, it appears to execute the entrypoint.sh file. So it looks like it has something to do with getting the container or code before it even runs.
See below, the output at the bottom is a part of some logging in the entrypoint.sh file:
04/27/2023, 10:25 PM
When I've run into this error using in the past when using Python on Windows, permanently setting the environment variable
solved the problem.
04/27/2023, 10:26 PM
Would that be the environment variable on my computer or the container?
04/27/2023, 10:29 PM
On your computer since that's where the agent is running and that's where the error is happening.
It looks like the error is happening when the agent watches the container's output. I'm guessing the container outputs a UTF-8 character that causes issues when mapped to UTF-16 (which Windows uses by default).
05/01/2023, 9:19 PM
Got it. That got rid of the error, but I am seeing this error now, after the container runs. I don't think it is getting into the entry point for the project, I have echos in it that aren't being outputted. What I see now is that it is trying to run pip install adlfs (I think twice) and then outputting errors that the requirement is already satisfied
I think I needed this at the end: