Help: When executing chatflow on the CODE, there is an Error: 'ascii' codec can't encode character '\ufffd' #23184
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.We install dify in the eks(1.33), when we run the on the CODE with chatflow, there will failed. We try to add some lang env for api, sanbox, worker, but it also failed. the error: the variables which we tried to add:
2. Additional context or commentsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
|
Hi @xiayinhai-pacvue! I'm Dosu and I’m helping the dify team. The error is caused by the sandbox container's environment defaulting to ASCII encoding, not by Dify's code. To fix this, set the following environment variables in your sandbox container (and any related API/worker containers): If you're using a Debian/Ubuntu-based image, make sure to install and generate the locale inside the container: ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV PYTHONIOENCODING=utf-8
RUN apt-get update && apt-get install -y locales && locale-gen en_US.UTF-8For Alpine-based images: ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV PYTHONIOENCODING=utf-8
RUN apk add --no-cache libc6-compatAfter updating, rebuild and redeploy your containers. Then, exec into the running sandbox container and run If the issue persists, upgrade to Dify v1.0.1 or later, as recent releases include fixes for Unicode handling in code execution nodes reference. If you still see errors, enable debug logs and check for encoding-related warnings. Let me know if you need more details on updating your deployment! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
We used the images from docker hub, tried these 2 version images; and now we use the version 1.7.1, it has been add those env in docker images. this is the from 1.7.1 these are from version 1.6.0 |
Beta Was this translation helpful? Give feedback.
-
|
rebuild which images? sandbox or all images? |
Beta Was this translation helpful? Give feedback.
-
|
Build with Dockerfile And upgrade the sanbox, the same errors: firstly we use this version, migration execute in api there is this error: tried to upgrade to this verison, migration execute in api |
Beta Was this translation helpful? Give feedback.
-
|
And we tried to stop sanbox with setting replica to 0, it always show the error: |
Beta Was this translation helpful? Give feedback.
-
|
the locale/encoding sanbox which re-build image as suggestion: |
Beta Was this translation helpful? Give feedback.

X-Api-Key is error, change this variable and re deploy, it works.