-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
az acr build throws UnicodeEncodeError: 'ascii' codec can't encode character #6408
Comments
I had this as well: UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 38: ordinal not in range(128) Has the fix been released yet? |
i created a fix upstream, but unfortunately this isn't merged yet: tartley/colorama#167 - meanwhile we ended up patching the library in our own deployments - which works so far. |
Is there a work around we can do? We have an angular app that is failing to build because of this |
Use option |
aah thanks I see, it was released in 2.0.46 |
You're welcome. |
* suppress ACR builds logs due to Azure/azure-cli#6408 * update aks client image, use --no-format in ACR build
Using az v2.0.47 with --no-format didn't solve this for me |
@DaveKlassen if this isn't fixing the specific case then might be worth considering reopening the issue. |
Its a really simple Dockerfile. However there is a line where I run pipenv like: RUN pipenv clean It seems to be failing when we run pipenv to prepare the container. docker build doesn't cause this error... but I would prefer to use az acr build to have a tighter integration with the registry. Also it seems that the error isn't always consistent. I have seen the error in three different forms: UnicodeEncodeError: 'ascii' codec can't encode character u'\\u2026' in position 38: ordinal not in range(128) |
@DaveKlassen what is the base image used your Dockerfile? |
The base image contains the following:
|
@DaveKlassen, so far I am unable to repro the issue in python 2.7.15 (alpine3.7). |
I have a specific Dev environment that cannot be changed, and cannot be disclosed (ie. v3.5 is not an option). When I have time I will reproduce the errata for you. One hint here, did you place anything in the PipFile? I would try a bunch of random packages, since I am fairly sure this issue occurs during pipenv install/sync |
@DaveKlassen I did try a bunch of packages in PipFile. The ellipsis character just worked fine on my machine. I noticed you reached Microsoft customer service and they should start a thread with you. If possible, can you send your Dev environment and PipFile to the customer service representative? It will help us narrow down the issue quickly. Thanks in advance. |
I have sent this data. Likely the only different part is the PipFile |
I'm getting this error as well. When I run the However, I can run it on my local development environment using azure-cli 2.0.41 and acr 2.0.28. Here is the same section of output from my local build:
It looks like there is some problem encoding the
|
on windows, set PYTHONIOENCODING=utf-8. i'm using the latest cli (py39, pip installed). so stupid we're dealing with this in 2021. i didn't do too much investigation but i think it's more fundamentally with colorama. |
try to fix colorama problem by this Azure/azure-cli#6408 (comment)
Describe the bug
We're running
az acr build ...
from our jenkins slaves that also run tests.If the docker build process returns unicode characters, az throws an UnicodeDecodeError (full traceback below).
When running the build process interactively on my local machine i see the line that is causing the error:
npm WARN deprecated babel-preset-es2015@6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
I suspect the emoji is causing the error because the library colorama used in az handles the output different for a non-tty environment.
To Reproduce
trigger a az acr build with a Dockerfile that causes unicode output in e.g. jenkins (non-tty environment).
Expected behavior
i'd expect the build to succeed and the unicode characters returned as well
Environment summary
rpm installation, bash, non interactive.
version:
Additional context
this seems to be related: tartley/colorama#36
full output:
The text was updated successfully, but these errors were encountered: