mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.76k stars 347 forks source link

Mamba doesn't work behind a corporate proxy (conda does): download error (56) - failure when receiving data from the peer #2438

Open garfieldthecat opened 1 year ago

garfieldthecat commented 1 year ago

Troubleshooting docs

Search tried in issue tracker

yes, nothing found

Latest version of Mamba

Tried in Conda?

Not reproducible with Conda

Describe your issue

The issue

At home I am a happy user of Mambaforge on my Windows PC I installed the same on my work PC (also Windows) behind a corporate firewall, after uninstalling Anaconda, but mamba couldn't download any package. Odd, because the very same proxy settings worked with Anaconda. So I installed miniconda, installed mamba from conda-forge, ran conda clean --all, and tried again: with the very same .condarc file and proxy settings, conda works, mamba does not. See error message in the section below. it didn't make a difference, but I also installed conda-build.

Please note, I installed only mamba and condabuild - all the other packages in my environment were installed by conda when I installed these two.

My interpretation

My guess is that, since conda works with the very same proxy settings and .condarc files, the proxy server is not blocking access to the conda-forge repository. So I guess it must be one of:

  1. mamba does not work behind a corporate proxy
  2. mamba requires a different configuration than conda to work behind a proxy (but I have not been able to find information about this)
  3. my corporate network allows requests from conda but not from mamba (not even sure if this is feasible at all, to be honest)

What I have found

There is a vaguely similar report, where a user fixed the issue by setting the proxy outside of .condarc : https://github.com/mamba-org/mamba/issues/151#issuecomment-1081449544

set http_proxy=http://proxy.myproxy.com/
set https_proxy=https://proxy.myproxy.com/

but that didn't work for me - I get the same error.

There are other reports about SSL issues https://github.com/mamba-org/mamba/issues/1106 but that's not the error I am getting.

my .condarc file

channels:
- conda-forge

show_channel_urls: True

proxy_servers:
http: <proxy.work.com:xyz>
https: <proxy.work.com:xyz>

ssl_verify: False

conda doesn't work with ssl_verify set to true. mamba doesn't work with either setting.

The error report

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\conda\exceptions.py", line 1132, in __call__
        return func(*args, **kwargs)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\conda_env\cli\main.py", line 78, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\conda\notices\core.py", line 121, in wrapper
        return func(*args, **kwargs)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\conda_env\cli\main_create.py", line 152, in execute
        result[installer_type] = installer.install(prefix, pkg_specs, args, env)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\mamba_env.py", line 55, in mamba_install
        index = load_channels(pool, channel_urls, repos, prepend=False)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\utils.py", line 129, in load_channels
        index = get_index(
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\utils.py", line 110, in get_index
        is_downloaded = dlist.download(api.MAMBA_DOWNLOAD_FAILFAST)
    RuntimeError: Download error (56) Failure when receiving data from the peer [https://conda.anaconda.org/conda-forge/noarch/repodata.json]

mamba info / micromamba info

active environment : base
    active env location : C:\Users\username\AppData\Local\miniconda3
            shell level : 1
       user config file : C:\Users\username\.condarc
 populated config files : C:\Users\username\.condarc
          conda version : 23.3.1
    conda-build version : 3.24.0
         python version : 3.10.10.final.0
       virtual packages : __archspec=1=x86_64
                          __win=0=0
       base environment : C:\Users\username\AppData\Local\miniconda3  (writable)
      conda av data dir : C:\Users\username\AppData\Local\miniconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : C:\Users\username\AppData\Local\miniconda3\pkgs
                          C:\Users\username\.conda\pkgs
                          C:\Users\username\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\username\AppData\Local\miniconda3\envs
                          C:\Users\username\.conda\envs
                          C:\Users\username\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/23.3.1 requests/2.28.2 CPython/3.10.10 Windows/10 Windows/10.0.19044
          administrator : False
             netrc file : None
           offline mode : False

Logs

Looking for: ['pandas']

info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\beautifulsoup4-4.12.0-pyha770c72_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\boltons-23.0.0-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\brotlipy-0.7.0-py310h8d17308_1005.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\bzip2-1.0.8-h8ffe710_4.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\ca-certificates-2022.12.7-h5b45459_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\certifi-2022.12.7-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\cffi-1.15.1-py310h628cb3f_3.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\chardet-5.1.0-py310h5588dad_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\charset-normalizer-3.1.0-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\colorama-0.4.6-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\conda-23.3.1-py310h5588dad_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\conda-build-3.24.0-py310h5588dad_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\conda-content-trust-0.1.3-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\conda-package-handling-2.0.2-pyh38be061_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\conda-package-streaming-0.7.0-pyhd8ed1ab_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\console_shortcut_miniconda-0.1.1-haa95532_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\cryptography-40.0.1-py310h6e82f81_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\filelock-3.10.7-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\fmt-9.1.0-h181d51b_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\glob2-0.7-py_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\idna-3.4-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\jinja2-3.1.2-pyhd8ed1ab_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\jsonpatch-1.32-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\jsonpointer-2.0-py_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\krb5-1.20.1-heb0366b_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libarchive-3.6.2-h27c7867_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libcurl-7.88.1-h68f0423_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libffi-3.4.2-h8ffe710_5.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libiconv-1.17-h8ffe710_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\liblief-0.12.3-h63175ca_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libmamba-1.4.1-h8a7d157_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libmambapy-1.4.1-py310h3fe4c2e_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libsolv-0.7.23-h12be248_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libsqlite-3.40.0-hcfcfb64_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libssh2-1.10.0-h9a1e1f7_3.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libxml2-2.10.3-hc3477c8_6.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\libzlib-1.2.13-hcfcfb64_4.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\lz4-c-1.9.4-hcfcfb64_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\lzo-2.10-he774522_1000.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\m2-msys2-runtime-2.5.0.17080.65c939c-3.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\m2-patch-2.7.5-2.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\m2w64-gcc-libgfortran-5.3.0-6.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\m2w64-gcc-libs-5.3.0-7.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\m2w64-gcc-libs-core-5.3.0-7.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\m2w64-gmp-6.1.0-2.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\m2w64-libwinpthread-git-5.0.0.4634.697f757-2.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\mamba-1.4.1-py310hd9d798f_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\markupsafe-2.1.2-py310h8d17308_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\menuinst-1.4.19-py310h5588dad_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\msys2-conda-epoch-20160418-1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\openssl-3.1.0-hcfcfb64_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\packaging-23.0-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pip-23.0.1-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pkginfo-1.9.6-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pluggy-1.0.0-pyhd8ed1ab_5.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\powershell_shortcut_miniconda-0.0.1-haa95532_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\psutil-5.9.4-py310h8d17308_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\py-lief-0.12.3-py310h00ffb61_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pybind11-abi-4-hd8ed1ab_3.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pycosat-0.6.4-py310h8d17308_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pycparser-2.21-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pyopenssl-23.1.1-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pysocks-1.7.1-pyh0701188_6.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\python-3.10.10-h4de0772_0_cpython.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\python-libarchive-c-4.0-py310h5588dad_2.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\python_abi-3.10-3_cp310.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pytz-2023.3-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\pyyaml-6.0-py310h8d17308_5.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\reproc-14.2.4-hcfcfb64_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\reproc-cpp-14.2.4-h63175ca_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\requests-2.28.2-pyhd8ed1ab_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\ripgrep-13.0.0-h7f3b576_2.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\ruamel.yaml-0.17.21-py310h8d17308_3.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\ruamel.yaml.clib-0.2.7-py310h8d17308_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\setuptools-65.6.3-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\six-1.16.0-pyh6c4a22f_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\soupsieve-2.3.2.post1-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\sqlite-3.40.0-hcfcfb64_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\tk-8.6.12-h8ffe710_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\tomli-2.0.1-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\toolz-0.12.0-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\tqdm-4.65.0-pyhd8ed1ab_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\tzdata-2023c-h71feb2d_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\ucrt-10.0.22621.0-h57928b3_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\urllib3-1.26.15-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\vc-14.3-hb6edc58_10.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\vs2015_runtime-14.34.31931-h4c5c07a_10.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\wheel-0.40.0-pyhd8ed1ab_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\wincertstore-0.2-pyhd8ed1ab_1009.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\win_inet_pton-1.1.0-pyhd8ed1ab_6.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\xz-5.2.6-h8d14728_0.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\yaml-0.2.5-h8ffe710_2.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\yaml-cpp-0.7.0-h63175ca_2.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\zlib-1.2.13-hcfcfb64_4.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\zstandard-0.19.0-py310h0009e47_1.json"
info     libmamba Loading single package record: "C:\\Users\\username\\AppData\\Local\\miniconda3\\conda-meta\\zstd-1.5.2-h12be248_6.json"
info     libmamba Reading cache files 'C:\Users\username\AppData\Local\Temp\1\tmpvs5e2c9_.*' for repo index 'installed'
info     libmamba Searching index cache file for repo 'https://conda.anaconda.org/conda-forge/win-64/repodata.json'
info     libmamba No valid cache found
info     libmamba Using Proxy dg-webproxy.mycompany.com:443
info     libmamba Searching index cache file for repo 'https://conda.anaconda.org/conda-forge/noarch/repodata.json'
info     libmamba No valid cache found
info     libmamba Using Proxy dg-webproxy.mycompany.com:443
info     libmamba Starting to download targets
[+] 3.4s
conda-forge/win-64 -----------------------------------------------------------------------------------------   9.5MB /  ??.?MB @   2.8MB/s  3.4s
conda-forge/noarch -----------------------------------------------------------------------------------------   9.6MB /  ??.?MB @   3.4MB/s  3.4s[+] 4.3s
conda-forge/win-64 -----------------------------------------------  19.5MB /  ??.?MB @   4.6MB/s Failure when receiving data from the peer  4.3s
conda-forge/noarch -----------------------------------------------   0.0 B /   1.0 B @   3.4MB/s Failure when receiving data from the peer  4.3s[+] 5.5s
conda-forge/win-64 -----------------------------------------------   0.0 B /   1.0 B @   4.6MB/s Failure when receiving data from the peer  5.5s
[+] 6.8s
conda-forge/win-64 -----------------------------------------------   0.0 B /   1.0 B @   4.6MB/s Failure when receiving data from the peer  6.8s
[+] 8.4s
conda-forge/win-64 -----------------------------------------------   0.0 B /  ??.?MB @  ??.?MB/s Failure when receiving data from the peer  8.4s
conda-forge/noarch -----------------------------------------------   9.7MB /  ??.?MB @   3.4MB/s Failure when receiving data from the peer  8.4s[+] 10.5s
conda-forge/win-64 -----------------------------------------------  17.5MB /  ??.?MB @   4.9MB/s Failure when receiving data from the peer 10.5s
[+] 10.9s
conda-forge/win-64 -----------------------------------------------  19.6MB /  ??.?MB @   4.9MB/s Failure when receiving data from the peer 10.9s
conda-forge/noarch -----------------------------------------------   0.0 B /  ??.?MB @  ??.?MB/s Failure when receiving data from the peer 10.9s[+] 12.9s
conda-forge/win-64 -----------------------------------------------   0.0 B /   1.0 B @   4.9MB/s Failure when receiving data from the peer 12.9s
[+] 13.6s
conda-forge/win-64 -----------------------------------------------   0.0 B /  ??.?MB @  ??.?MB/s Failure when receiving data from the peer 13.6s
conda-forge/noarch -----------------------------------------------   9.5MB /  ??.?MB @   3.2MB/s Failure when receiving data from the peer 13.6s[+] 16.3s
conda-forge/win-64 -----------------------------------------------   0.0 B /  ??.?MB @  ??.?MB/s Failure when receiving data from the peer 16.3s
[+] 17.5s
conda-forge/win-64 -----------------------------------------------  19.4MB /  ??.?MB @   4.3MB/s Failure when receiving data from the peer 17.5s
conda-forge/noarch -----------------------------------------------   0.0 B /  ??.?MB @  ??.?MB/s Failure when receiving data from the peer 17.5s[+] 19.4s
conda-forge/win-64 -----------------------------------------------   0.0 B /   1.0 B @   4.3MB/s Failure when receiving data from the peer 19.4s
conda-forge/noarch -----------------------------------------------   9.6MB /  ??.?MB @   3.7MB/s Failure when receiving data from the peer 19.4sDownload error (56) Failure when receiving data from the peer [https://conda.anaconda.org/conda-forge/noarch/repodata.json]

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\conda\exceptions.py", line 1132, in __call__
        return func(*args, **kwargs)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\mamba.py", line 941, in exception_converter
        raise e
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\mamba.py", line 934, in exception_converter
        exit_code = _wrapped_main(*args, **kwargs)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\mamba.py", line 892, in _wrapped_main
        result = do_call(parsed_args, p)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\mamba.py", line 754, in do_call
        exit_code = install(args, parser, "install")
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\mamba.py", line 499, in install
        index = load_channels(pool, channels, repos)
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\utils.py", line 129, in load_channels
        index = get_index(
      File "C:\Users\username\AppData\Local\miniconda3\lib\site-packages\mamba\utils.py", line 110, in get_index
        is_downloaded = dlist.download(api.MAMBA_DOWNLOAD_FAILFAST)
    RuntimeError: Download error (56) Failure when receiving data from the peer [https://conda.anaconda.org/conda-forge/noarch/repodata.json]

`$ C:\Users\username\AppData\Local\miniconda3\Scripts\mamba install -v pandas`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=C:\Users\username\AppData\Local\miniconda3\condabin\..\Scripts\conda.e
                          xe
               CONDA_EXES="C:\Users\username\AppData\Local\miniconda3\condabin\..\Scripts\conda.
                          exe"
             CONDA_PREFIX=C:\Users\username\AppData\Local\miniconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=C:\Users\username\AppData\Local\miniconda3\python.exe
               CONDA_ROOT=C:\Users\username\AppData\Local\miniconda3
              CONDA_SHLVL=1
           CURL_CA_BUNDLE=<not set>
                 HOMEPATH=\
               LD_PRELOAD=<not set>
                NODE_PATH=C:\Program Files\SQL Anywhere 17\Node
                     PATH=C:\Users\username\AppData\Local\miniconda3;C:\Users\username\AppData\L
                          ocal\miniconda3\Library\mingw-
                          w64\bin;C:\Users\username\AppData\Local\miniconda3\Library\usr\bin;C:\
                          Users\username\AppData\Local\miniconda3\Library\bin;C:\Users\username\
                          AppData\Local\miniconda3\Scripts;C:\Users\username\AppData\Local\minic
                          onda3\bin;C:\Users\username\AppData\Local\miniconda3\condabin;C:\Progr
                          am Files\Eclipse Adoptium\jre-17.0.5.8-
                          hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
                          \WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C
                          :\APPS\Global\dev_tools;C:\Users\username\AppData\Local\JetBra
                          ins\PyCharm 2022.3.3\bin;.
             PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\Windows
                          PowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL
                          Server\150\Tools\PowerShell\Modules\;C:\Program Files (x86)\Microsoft
                          Azure Information Protection\Powershell;C:\Program
                          Files\Citrix\Telemetry Service\
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : base
    active env location : C:\Users\username\AppData\Local\miniconda3
            shell level : 1
       user config file : C:\Users\username\.condarc
 populated config files : C:\Users\username\.condarc
          conda version : 23.3.1
    conda-build version : 3.24.0
         python version : 3.10.10.final.0
       virtual packages : __archspec=1=x86_64
                          __win=0=0
       base environment : C:\Users\username\AppData\Local\miniconda3  (writable)
      conda av data dir : C:\Users\username\AppData\Local\miniconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : C:\Users\username\AppData\Local\miniconda3\pkgs
                          C:\Users\username\.conda\pkgs
                          C:\Users\username\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\username\AppData\Local\miniconda3\envs
                          C:\Users\username\.conda\envs
                          C:\Users\username\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/23.3.1 requests/2.28.2 CPython/3.10.10 Windows/10 Windows/10.0.19044
          administrator : False
             netrc file : None
           offline mode : False

An unexpected error has occurred. Conda has prepared the above report.

environment.yml

name: base
channels:
  - defaults
  - conda-forge
dependencies:
  - beautifulsoup4=4.12.0=pyha770c72_0
  - boltons=23.0.0=pyhd8ed1ab_0
  - brotlipy=0.7.0=py310h8d17308_1005
  - bzip2=1.0.8=h8ffe710_4
  - ca-certificates=2022.12.7=h5b45459_0
  - certifi=2022.12.7=pyhd8ed1ab_0
  - cffi=1.15.1=py310h628cb3f_3
  - chardet=5.1.0=py310h5588dad_0
  - charset-normalizer=3.1.0=pyhd8ed1ab_0
  - colorama=0.4.6=pyhd8ed1ab_0
  - conda=23.3.1=py310h5588dad_0
  - conda-build=3.24.0=py310h5588dad_0
  - conda-content-trust=0.1.3=pyhd8ed1ab_0
  - conda-package-handling=2.0.2=pyh38be061_0
  - conda-package-streaming=0.7.0=pyhd8ed1ab_1
  - console_shortcut_miniconda=0.1.1=haa95532_1
  - cryptography=40.0.1=py310h6e82f81_0
  - filelock=3.10.7=pyhd8ed1ab_0
  - fmt=9.1.0=h181d51b_0
  - glob2=0.7=py_0
  - idna=3.4=pyhd8ed1ab_0
  - jinja2=3.1.2=pyhd8ed1ab_1
  - jsonpatch=1.32=pyhd8ed1ab_0
  - jsonpointer=2.0=py_0
  - krb5=1.20.1=heb0366b_0
  - libarchive=3.6.2=h27c7867_0
  - libcurl=7.88.1=h68f0423_1
  - libffi=3.4.2=h8ffe710_5
  - libiconv=1.17=h8ffe710_0
  - liblief=0.12.3=h63175ca_0
  - libmamba=1.4.1=h8a7d157_0
  - libmambapy=1.4.1=py310h3fe4c2e_0
  - libsolv=0.7.23=h12be248_0
  - libsqlite=3.40.0=hcfcfb64_0
  - libssh2=1.10.0=h9a1e1f7_3
  - libxml2=2.10.3=hc3477c8_6
  - libzlib=1.2.13=hcfcfb64_4
  - lz4-c=1.9.4=hcfcfb64_0
  - lzo=2.10=he774522_1000
  - m2-msys2-runtime=2.5.0.17080.65c939c=3
  - m2-patch=2.7.5=2
  - m2w64-gcc-libgfortran=5.3.0=6
  - m2w64-gcc-libs=5.3.0=7
  - m2w64-gcc-libs-core=5.3.0=7
  - m2w64-gmp=6.1.0=2
  - m2w64-libwinpthread-git=5.0.0.4634.697f757=2
  - mamba=1.4.1=py310hd9d798f_0
  - markupsafe=2.1.2=py310h8d17308_0
  - menuinst=1.4.19=py310h5588dad_1
  - msys2-conda-epoch=20160418=1
  - openssl=3.1.0=hcfcfb64_0
  - packaging=23.0=pyhd8ed1ab_0
  - pip=23.0.1=pyhd8ed1ab_0
  - pkginfo=1.9.6=pyhd8ed1ab_0
  - pluggy=1.0.0=pyhd8ed1ab_5
  - powershell_shortcut_miniconda=0.0.1=haa95532_1
  - psutil=5.9.4=py310h8d17308_0
  - py-lief=0.12.3=py310h00ffb61_0
  - pybind11-abi=4=hd8ed1ab_3
  - pycosat=0.6.4=py310h8d17308_1
  - pycparser=2.21=pyhd8ed1ab_0
  - pyopenssl=23.1.1=pyhd8ed1ab_0
  - pysocks=1.7.1=pyh0701188_6
  - python=3.10.10=h4de0772_0_cpython
  - python-libarchive-c=4.0=py310h5588dad_2
  - python_abi=3.10=3_cp310
  - pytz=2023.3=pyhd8ed1ab_0
  - pyyaml=6.0=py310h8d17308_5
  - reproc=14.2.4=hcfcfb64_0
  - reproc-cpp=14.2.4=h63175ca_0
  - requests=2.28.2=pyhd8ed1ab_1
  - ripgrep=13.0.0=h7f3b576_2
  - ruamel.yaml=0.17.21=py310h8d17308_3
  - ruamel.yaml.clib=0.2.7=py310h8d17308_1
  - setuptools=65.6.3=pyhd8ed1ab_0
  - six=1.16.0=pyh6c4a22f_0
  - soupsieve=2.3.2.post1=pyhd8ed1ab_0
  - sqlite=3.40.0=hcfcfb64_0
  - tk=8.6.12=h8ffe710_0
  - tomli=2.0.1=pyhd8ed1ab_0
  - toolz=0.12.0=pyhd8ed1ab_0
  - tqdm=4.65.0=pyhd8ed1ab_1
  - tzdata=2023c=h71feb2d_0
  - ucrt=10.0.22621.0=h57928b3_0
  - urllib3=1.26.15=pyhd8ed1ab_0
  - vc=14.3=hb6edc58_10
  - vs2015_runtime=14.34.31931=h4c5c07a_10
  - wheel=0.40.0=pyhd8ed1ab_0
  - win_inet_pton=1.1.0=pyhd8ed1ab_6
  - wincertstore=0.2=pyhd8ed1ab_1009
  - xz=5.2.6=h8d14728_0
  - yaml=0.2.5=h8ffe710_2
  - yaml-cpp=0.7.0=h63175ca_2
  - zlib=1.2.13=hcfcfb64_4
  - zstandard=0.19.0=py310h0009e47_1
  - zstd=1.5.2=h12be248_6
prefix: C:\Usersusername\AppData\Local\miniconda3

~/.condarc

channel_priority: strict
channels:
- conda-forge

show_channel_urls: true

proxy_servers:
  http: dg-webproxy.mycompany.com:xyz
  https: dg-webproxy.mycompany.com:xyz

ssl_verify: False
garfieldthecat commented 1 year ago

In my work network there are 3 .crt certificate files that can be used. I have changed the .condarc file so that ssl_verify: c:\users\username\certificate_file.crt conda works if I specify any of the 3 .crt files. mamba does not work with any of the 3 files

The files are:

My interpretation is that there is nothing wrong with my network, my certificates work fine, my firewall/proxy is not blocking access to conda-forge and the issue is with mamba, which should replicate the syntax and functionality of conda but, in this specific instance, does not (conda works perfectly well).

Has anyone else tried to use mamba behind a corporate firewall/proxy and/or with .crt certificates? Surely I can't be the only one in this situation?

jonashaag commented 1 year ago

Can you try to get it to work with curl only? Like downloading the repodata file.

garfieldthecat commented 1 year ago

Can you try to get it to work with curl only? Like downloading the repodata file.

Forgive me if it's a banal question, but how exactly would I do that? Do you mean downloading the .json file locally and then adding some parameters to tell mamba to look up the json stored locally?

jonashaag commented 1 year ago

No just use curl to download the file for debugging. No way to use it in Mamba then. Just for testing purposes. If that works then it’s a problem with Mamba, otherwise it’s a problem with curl.

garfieldthecat commented 1 year ago

Thank you for the suggestion - very useful - we may finally be getting somewhere

What I have tried

I played around with the curl syntax; it works if I run curl --proxy same_proxy_server_as_in_the_condarc_file.com https://conda.anaconda.org/conda-forge/noarch/repodata.json If I run

curl https://conda.anaconda.org/conda-forge/noarch/repodata.json
curl --insecure https://conda.anaconda.org/conda-forge/noarch/repodata.json
curl --http1.0 https://conda.anaconda.org/conda-forge/noarch/repodata.json

I get a curl: (28) Failed to connect to conda.anaconda.org port 443 after 4229 ms: Timed out I get the same message if I set ssl_verify to False and if I set it to any of the 3 certificate files I mentioned above. Do you get the same error message, too?

It also works if I add the proxy to the environment variables, then run curl without a parameter for the proxy: set http_proxy=same_proxy_server.com set https_proxy=same_proxy_server.com curl https://conda.anaconda.org/conda-forge/noarch/repodata.json but it does not work if I run mamba install somepackage after setting environment variables for the proxy server as above!

My interpretation

The problem is not with curl but with mamba - curl with the right proxy settings works just fine

Possible solution / hack?

If we download the repodata.json manually, would it be possible to add it to the local cache? Would that make a difference? As in, that way mamba doesn't have to connect to the remote json anymore?

jonashaag commented 1 year ago

Interesting, what's the output of curl -V?

Does Conda (as opposed to Mamba) respect the environment variables?

garfieldthecat commented 1 year ago

Curl reads the environment variables (for the proxy servers)

Conda was finding the proxy settings in the .condarc file. Whether it would have worked with the proxy set in the environment variables but not the .condarc I don't know.

Mamba is supposed to recognise the proxy settings in the .condarc file. Supposedly...

As for the output of curl -v (lower case v) - by the way, the powershell prompt did not show the output, only the ordinary prompt - it's this, except some details anonymised :

(base) c:\users\username>curl -v https://conda.anaconda.org/conda-forge/noarch/repodata.json
* Uses proxy env variable https_proxy == 'http://work_proxy_server.com:8080'
*   Trying x.y.z:8080...
* Connected to work_proxy_server.com (x.y.z) port 8080 (#0)
* allocate connect buffer
* Establish HTTP proxy tunnel to conda.anaconda.org:443
> CONNECT conda.anaconda.org:443 HTTP/1.1
> Host: conda.anaconda.org:443
> User-Agent: curl/7.83.1
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection Established
< Proxy-Agent: Zscaler/6.2
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed
* schannel: disabled automatic use of client certificate
* ALPN: offers http/1.1
* ALPN: server did not agree on a protocol. Uses default.
> GET /conda-forge/noarch/repodata.json HTTP/1.1
> Host: conda.anaconda.org
> User-Agent: curl/7.83.1
> Accept: */*
>
* schannel: failed to decrypt data, need more data
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Tue, 04 Apr 2023 12:21:58 GMT
< Content-Type: application/json
< Content-Length: 84022577
< Connection: keep-alive
< CF-Ray: some_code
< Accept-Ranges: bytes
< Age: 9218
< Cache-Control: public, max-age=1200
< ETag: "some_code"
< Expires: Tue, 04 Apr 2023 12:41:58 GMT
< Last-Modified: Tue, 04 Apr 2023 09:47:35 GMT
< Vary: Accept-Encoding
< CF-Cache-Status: HIT
< x-amz-id-2: some_id
< x-amz-request-id: some_other_id
< x-amz-version-id: null
< Set-Cookie: __cf_bm=some_code; path=/; expires=Tue, 04-Apr-23 12:51:58 GMT; domain=.anaconda.org; HttpOnly; Secure; SameSite=None
< Server: cloudflare
<
{
  "info": {
    "subdir": "noarch"
  },
  "packages": {
    "_current_repodata_hack_gcc_linux_64_75-0.0.1-0.tar.bz2": {
      "build": "0",
      "build_number": 0,
      "depends": [
        "gcc_linux-64 7.5.*"
      ],
      "license": "LicenseRef-OTHER",
      "md5": "6f29ba77e8b03b191c9d667f331bf2a0",
      "name": "_current_repodata_hack_gcc_linux_64_75",
      "noarch": "generic",
      "sha256": "ecde63af23e0d49c0ece19ec539d873ea408a6f966d3126994c6d33ae1b9d3f7",
      "size": 3357,
      "subdir": "noarch",
      "timestamp": 1599854591823,
      "version": "0.0.1"
    },
jonashaag commented 1 year ago

No I meant curl -V :)

jonashaag commented 1 year ago

Note that curl in PowerShell might actually be a different program shipped with Windows that's aliased to curl, not the real curl.

jonashaag commented 1 year ago

Some observations:

garfieldthecat commented 1 year ago

As for https vs https in the proxy settings and in the .condarc : I have played around with a gazillion different combinations. They al work fine with conda, while none works with mamba.

Yes, if I set the proxy in the environment variable then curl works. I have no idea if mamba does not send the correct proxy settings to mamba, or if it does and the issue is elsewhere. I don't have a proxy without zscaler to test this hypothesys.

Have you tried contacting zscaler at all?

As for the output with the capital V:

(base) c:\users\username>curl -V https://conda.anaconda.org/conda-forge/noarch/repodata.json
curl 7.83.1 (Windows) libcurl/7.83.1 Schannel
Release-Date: 2022-05-13
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI UnixSockets
jonashaag commented 1 year ago

One last request, can you try to upgrade curl to 7.88 and confirm that it still works?

To me it looks like a problem with Mamba and not with Zscaler because vanilla curl works.

garfieldthecat commented 1 year ago

You mean update the curl used by mamba? How do I do that? It's not even clear to me where the two curls, the one used in the command prompt and the one used by mamba, are.

If I search my C: drive for curl.exe, I find only one, in C:\Program Files\Git\mingw64\bin , and that's version 7.61.1

If I search for libcurl.dll, I see a few:

SQL McAfee Office\ODBC\Salesforce drivers R Cisco spark

jonashaag commented 1 year ago

No the curl command line program. Mamba uses libcurl. Not sure where your curl command line program is coming from.

But you can try with the mingw one as well!

garfieldthecat commented 1 year ago

I updated libcurl in the base environment to 7.88.1. Updating libcurl solved this issue https://github.com/mamba-org/mamba/issues/1856 for the user who raised it, but changed absolutely nothing for me.

I have learnt that curl is now part of Windows: https://curl.se/windows/microsoft.html

Since curl version 7.83.1 (the one that comes with Windows) does download the json (if I set the proxy in the environment variables) I downloaded version 7.83.1 from https://curl.se/windows/dl-7.83.1/ I ran that, and got:

H:\curl-7.83.1-win64-mingw\bin>curl https://conda.anaconda.org/conda-forge/noarch/repodata.json
curl: (60) SSL certificate problem: self-signed certificate in certificate chain
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

So: the curl 7.83.1 which is part of Windows works, while the curl 7.83.1 one can download from the curl website does not! It seems the former recognises all the settings for proxy ssl certificates etc, while the latter does not.

What a headache!

jonashaag commented 1 year ago

I wonder if the Windows curl has some „hidden“ settings/certificate stores that the normal one doesn’t.

jeanmonet commented 1 year ago

Having the exact same issue as OP reports. Using zscaler as well. Conda works, mamba doesn't.

garfieldthecat commented 1 year ago

Has anyone tried mamba from a proxy / firewall that is NOT zscaler? Is there an easy way to connect to a proxy from a home PC?

jonashaag commented 1 year ago

Yes that should just work

garfieldthecat commented 1 year ago

Sorry, what should just work? Is there some kind of free proxy service I can connect to from my home PC, just to test the connection?

jonashaag commented 1 year ago

There are some free proxy services, or you can try a VPN provider that allows to connect via HTTP proxy. If it works in your browser it should also work with Conda and Mamba (except Zscaler…)

jeanmonet commented 1 year ago

Though ideally would be nice to have mamba work with Zscaler and conda-forge, or at least find a configuration setting that allows its use, given that conda works, and that curl provided by default in PowerShell also works.

jeanmonet commented 1 year ago

Following-up, this is not specific to Windows. I am having the exact same problem on Ubuntu 22.04 (via WSL2), only affecting mamba, not conda.

jonashaag commented 1 year ago

@jeanmonet that's good to know because I assumed this is related to the Windows SSL stack. Can you try to reproduce the issue with some version of curl?

jeanmonet commented 1 year ago

Please see below (successful) result using default curl installed with Ubuntu 22.04:

$ curl https://conda.anaconda.org/conda-forge/noarch/repodata.json -o _temp_cf.json
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 83.6M  100 83.6M    0     0  34.0M      0  0:00:02  0:00:02 --:--:-- 34.0M

$ curl --version
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.14
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd

EDIT: mamba with conda-forge appears to work in WSL2/Ubuntu (don't know what happened or if it's temporary, started workig apparently after running the curl command above inside WSL). However still no-go on PowerShell (Windows).

jeanmonet commented 1 year ago

It might be that the problem comes from Zscaler intermediate root CA certificate.

It can be found, in Windows, as such:

Conda (and default curl in PowerShell) probably make use of this certificate and that is why connections work fine (presumably).

Is there any way that mamba can do the same?