Azure-Samples / graphrag-accelerator

One-click deploy of a Knowledge Graph powered RAG (GraphRAG) in Azure
https://github.com/microsoft/graphrag
MIT License
1.73k stars 275 forks source link

UnicodeEncodeError when pushing graphrag:backend image to Azure Container Registry (ACR) #45

Closed chiara89 closed 2 months ago

chiara89 commented 3 months ago

Hello, I am trying to deploy the graph accelerator on Azure but executing the following command: sh deploy.sh -p deploy.parameters.json I have an error in deployment and consequent exiting. After debugging I discover that the problem is in this command: az acr build --registry crvwq35lo5nblxu.azurecr.io -f /c/Users/PicardiC/graphrag-accelerator/infra/../docker/Dockerfile-backend --image graphrag:backend /c/Users/PicardiC/graphrag-accelerator/infra/../ I report the full traceback: WARNING: The login server endpoint suffix '.azurecr.io' is automatically omitted. WARNING: Packing source code into tar to upload... WARNING: Excluding '.git' based on default ignore rules WARNING: Excluding '.gitignore' based on default ignore rules WARNING: Uploading archived source code from 'C:\Users\PicardiC\AppData\Local\Temp\build_archive_fe8dc0a0a207438da6e25782605aa14c.tar.gz'... WARNING: Sending context (52.576 MiB) to registry: crvwq35lo5nblxu... WARNING: Queued a build with ID: dbe WARNING: Waiting for an agent... 2024/07/03 14:15:53 Downloading source code... 2024/07/03 14:15:55 Finished downloading source code 2024/07/03 14:15:55 Using acb_vol_9d9f85b4-a403-4374-9fe3-74b2f7e1f80e as the home volume 2024/07/03 14:15:55 Setting up Docker configuration... 2024/07/03 14:15:55 Successfully set up Docker configuration 2024/07/03 14:15:55 Logging in to registry: crvwq35lo5nblxu.azurecr.io 2024/07/03 14:15:56 Successfully logged into crvwq35lo5nblxu.azurecr.io 2024/07/03 14:15:56 Executing step ID: build. Timeout(sec): 28800, Working directory: '', Network: '' 2024/07/03 14:15:56 Scanning for dependencies... 2024/07/03 14:15:56 Successfully scanned dependencies 2024/07/03 14:15:56 Launching container with name: build Sending build context to Docker daemon 121.7MB Step 1/15 : FROM python:3.10 3.10: Pulling from library/python e9aef93137af: Pulling fs layer 58b365fa3e8d: Pulling fs layer 3dbed71fc544: Pulling fs layer ae70830af8b6: Pulling fs layer fd155188cf05: Pulling fs layer f0d61d0facb6: Pulling fs layer 726c326e9564: Pulling fs layer 331871c631e8: Pulling fs layer fd155188cf05: Waiting f0d61d0facb6: Waiting 726c326e9564: Waiting 331871c631e8: Waiting ae70830af8b6: Waiting 58b365fa3e8d: Verifying Checksum 58b365fa3e8d: Download complete e9aef93137af: Verifying Checksum e9aef93137af: Download complete 3dbed71fc544: Verifying Checksum 3dbed71fc544: Download complete fd155188cf05: Verifying Checksum fd155188cf05: Download complete 726c326e9564: Verifying Checksum 726c326e9564: Download complete f0d61d0facb6: Verifying Checksum f0d61d0facb6: Download complete 331871c631e8: Verifying Checksum 331871c631e8: Download complete e9aef93137af: Pull complete ae70830af8b6: Download complete 58b365fa3e8d: Pull complete 3dbed71fc544: Pull complete ae70830af8b6: Pull complete fd155188cf05: Pull complete f0d61d0facb6: Pull complete 726c326e9564: Pull complete 331871c631e8: Pull complete Digest: sha256:659a717c4274ece1533ccdfb8c9f1d62e803e3cf5f80fe5dd3543639e93f7f87 Status: Downloaded newer image for python:3.10 ---> 6905cae1f812 Step 2/15 : ARG GRAPHRAG_VERSION=0.0.0 ---> Running in 76802a9e23eb Removing intermediate container 76802a9e23eb ---> cd5e591f8918 Step 3/15 : ENV GRAPHRAG_VERSION=v${GRAPHRAG_VERSION} ---> Running in ce1f998a3305 Removing intermediate container ce1f998a3305 ---> 84f25b4577be Step 4/15 : ENV PIP_ROOT_USER_ACTION=ignore ---> Running in dc44cbf10258 Removing intermediate container dc44cbf10258 ---> 2ed0dec53ade Step 5/15 : ENV PIP_DISABLE_PIP_VERSION_CHECK=1 ---> Running in 44dbeb92dd15 Removing intermediate container 44dbeb92dd15 ---> e9d3d1014d8a Step 6/15 : ENV SETUPTOOLS_USE_DISTUTILS=stdlib ---> Running in dd1e6afeaa88 Removing intermediate container dd1e6afeaa88 ---> b7ee725522ac Step 7/15 : ENV PYTHONPATH=/backend ---> Running in 97da30268dfe Removing intermediate container 97da30268dfe ---> cfc8d25c54c7 Step 8/15 : COPY poetry.lock pyproject.toml / ---> bc7372e5d631 Step 9/15 : COPY backend /backend ---> 00d8336a5c7d Step 10/15 : RUN pip install poetry && poetry config virtualenvs.create false && poetry install --without frontend ERROR: The command failed with an unexpected error. Here is the traceback: ERROR: 'charmap' codec can't encode characters in position 109-147: character maps to Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 664, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 731, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 701, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 334, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acr/build.py", line 143, in acr_build File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acr/_stream_utils.py", line 58, in stream_logs File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acr/_stream_utils.py", line 143, in _stream_logs File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\colorama/ansitowin32.py", line 47, in write File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\colorama/ansitowin32.py", line 177, in write File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\colorama/ansitowin32.py", line 205, in write_and_convert File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\colorama/ansitowin32.py", line 210, in write_plain_text File "encodings\cp1252.py", line 19, in encode UnicodeEncodeError: 'charmap' codec can't encode characters in position 109-147: character maps to Do you have any ideas on how to solve the issue? Thanks in advance Chiara

timothymeyers commented 3 months ago

Hi @chiara89 - is there any more information you can provide about your deployment environment?

Are you running this locally in WSL? Have you tried deploying it in a Codespace or from within the dev container?

chiara89 commented 3 months ago

Hi @timothymeyers thanks for your help. I am running locally in WSL. I try it from codespace within the dev container but unfortunately I have limitations on my Azure subscription which impose me to access it only with the device I am using, so my only options is to run it locally. In my understanding the error should depend on the Azure cli but I am not sure how to solve it. Thanks again for your help.

eyast commented 3 months ago

Hi @chiara89, I think you're right -it seems the error is caused by az cli - here's another thread that mentions it, as well as a resolution: https://github.com/Azure/azure-cli/issues/21409

I just tried to run the step manually (#523 at deploy.sh) and it succeeded:

Keep in mind that using the devcontainer as suggested above is the easiest way to get started - and it doesn't have any dependency on Azure. It's a way to help the developers bring the correct versions of all required libraries to you, to make the deployment easier.

The administrators of my workplace have also set restrictions on how I can access Azure - I can only access it from my device as well. Here's my setup:

Can you share the steps you took to deploy, and more information about your environment? Can you try with devcontainers again, as it is one of the easiest ways to get you started quickly.

chiara89 commented 2 months ago

@eyast thanks for your help. I was able to deploy using az cli version 2.55.0. So it seems that this is the version working :) Thanks again for the support.