ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 224 forks source link

`Anaconda Distribution for Linux` installation failed: `'ascii' codec can't encode character '\xe4' in position 96` #13407

Closed hywhuangyuwei closed 3 months ago

hywhuangyuwei commented 3 months ago

Checklist

Impacted product

What happened?

Install using ./Anaconda3-2024.06-1-Linux-x86_64.sh failed on a fresh Ubuntu 24.04:

Do you accept the license terms? [yes|no]
>>> yes

Anaconda3 will now be installed into this location:
/home/user/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/user/anaconda3] >>>
PREFIX=/home/user/anaconda3
Unpacking payload ...
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
  File "concurrent/futures/process.py", line 261, in _process_worker
  File "conda_package_handling/api.py", line 77, in extract
  File "conda_package_handling/conda_fmt.py", line 46, in extract
  File "conda_package_handling/streaming.py", line 53, in _extract
  File "conda_package_streaming/extract.py", line 47, in extract_stream
  File "tarfile.py", line 2256, in extractall
  File "conda_package_streaming/extract.py", line 42, in checked_members
  File "conda_package_streaming/extract.py", line 33, in is_within_dest_dir
  File "<frozen posixpath>", line 416, in realpath
  File "<frozen posixpath>", line 451, in _joinrealpath
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 96: ordinal not in range(128)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "entry_point.py", line 170, in _constructor_extract_conda_pkgs
  File "concurrent/futures/_base.py", line 449, in result
  File "concurrent/futures/_base.py", line 401, in __get_result
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 96: ordinal not in range(128)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "entry_point.py", line 308, in <module>
  File "entry_point.py", line 300, in main
  File "entry_point.py", line 208, in _constructor_subcommand
  File "entry_point.py", line 172, in _constructor_extract_conda_pkgs
RuntimeError: Failed to extract /home/user/anaconda3/pkgs/sphinx-7.3.7-py312h5eee18b_0.conda: 'ascii' codec can't encode character '\xe4' in position 96: ordinal not in range(128)
[42452] Failed to execute script 'entry_point' due to unhandled exception!

Expected behavior or outcome

N/A

Conda info

No response

Conda config

No response

Conda list

No response

Additional information

No response

hywhuangyuwei commented 3 months ago

Since ascii appears in the error log, I guess there was something wrong related to language settings. This got fixed after I add this to my current shell config (which is missed on a freshly installed Ubuntu 24.04):

export LANGUAGE="en_US.utf8"
export LC_ALL="en_US.utf8"
export LC_CTYPE="en_US.utf8"
export LANG="en_US.utf8"

Anyway, it would be better if the error message were more user-friendly.

marcoesters commented 3 months ago

Thanks @hywhuangyuwei for reporting this and finding the solution! I will forward this to the docs team to add it to our troubleshooting page.

The error message comes from the os module, but I will file issues with conda-package-streaming and/or conda-standalone to see if the encoding can either be handled without errors or to at least improve messaging.

dholth commented 3 months ago

Which version of Python is the installer using, see https://peps.python.org/pep-0686/

dholth commented 3 months ago

I downloaded the package, the offending file must be this file, which is test data in ./info/

./info/test/tests/roots/test-images:
testim<C3><A4>ge.png
marcoesters commented 3 months ago

The bootstrapper was packaged with 3.11.9: https://github.com/AnacondaRecipes/conda-standalone-feedstock/blob/master/recipe/meta.yaml#L6

dholth commented 3 months ago

Oh, I see the UTF-8 as default is not until Python 15.

marcoesters commented 3 months ago

Filed the issue here: https://github.com/conda/conda-package-streaming/issues/93