Skip to content
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

Unable to download packages from offline machine with configured proxy #1764

Closed
2 tasks done
toiletsandpaper opened this issue Aug 8, 2024 · 8 comments · Fixed by #1820
Closed
2 tasks done

Unable to download packages from offline machine with configured proxy #1764

toiletsandpaper opened this issue Aug 8, 2024 · 8 comments · Fixed by #1820
Labels
🐞 bug Something isn't working 🐍 pypi Issue related to PyPI dependencies

Comments

@toiletsandpaper
Copy link

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

PS C:\Users\user\Desktop\pixi_test> pixi add mypy
 WARN Ignoring 'repodata_options' in at C:\Users\user\Desktop\pixi_test\.pixi\config.toml
 WARN TLS verification is disabled. This is insecure and should only be used for testing or internal networks.
Added mypy >=1.11.1,<2

PS C:\Users\user\Desktop\pixi_test> pixi add pytorch
 WARN Ignoring 'repodata_options' in at C:\Users\user\Desktop\pixi_test\.pixi\config.toml
 WARN TLS verification is disabled. This is insecure and should only be used for testing or internal networks.
  x failed to solve the conda requirements of 'default' 'win-64'
  `-> Cannot solve the request because of: No candidates were found for pytorch *.

PS C:\Users\user\Desktop\pixi_test> pixi add --pypi torch
 WARN Ignoring 'repodata_options' in at C:\Users\user\Desktop\pixi_test\.pixi\config.toml
 WARN TLS verification is disabled. This is insecure and should only be used for testing or internal networks.
  x failed to download pypi name mapping
  |-> Middleware error: Request error: error sending request for url (https://conda-mapping.prefix.dev/hash-
  |   v0/0fce54f8ec3e59f5ef3bb7641863be4e1bf1279623e5af3d3fa726e8f7628ddb)                                                
  |-> Request error: error sending request for url (https://conda-mapping.prefix.dev/hash-                                
  |   v0/0fce54f8ec3e59f5ef3bb7641863be4e1bf1279623e5af3d3fa726e8f7628ddb)                                                
  |-> error sending request for url (https://conda-mapping.prefix.dev/hash-                                               
  |   v0/0fce54f8ec3e59f5ef3bb7641863be4e1bf1279623e5af3d3fa726e8f7628ddb)                                                
  |-> client error (Connect)                                                                                              
  |-> dns error: No such host is known. (os error 11001)                                                                  
  `-> No such host is known. (os error 11001)                                                                                                                                                                                                   
PS C:\Users\user\Desktop\pixi_test> pixi config list
 WARN Ignoring 'repodata_options' in at C:\Users\user\Desktop\pixi_test\.pixi\config.toml
tls-no-verify = true
detached-environments = false
[mirrors]                                                                                                                   "https://conda.anaconda.org/conda-forge" = [                                                                                    "http://MY_MIRROR/repository/conda-forge-proxy",                                                                                 "http://MY_MIRROR/repository/anaconda-pytorch",                                                                                  "http://MY_MIRROR/repository/anaconda-nvidia",                                                                           
]                                                                                                                                                                                                                                               
[pypi-config]
index-url = "http://MY_MIRROR/repository/pypi-all/simple"
keyring-provider = "subprocess"

Issue description

So I have several local machines, that cutted out from internet, but have access to already cached packages with Sonatype Nexus.
When I configure my pdm/poerty/pip/conda configs with exact cacher urls that in example above - everything works right with every tool, but pixi rejects to work properly.

I followed step-by-step with this guide https://pixi.sh/v0.18.0/advanced/global_configuration/
BTW, WARN Ignoring 'repodata_options' is very strange message, because you have that in your example.

For now, the only thing that working is installing packages from the first specified mirror for conda-forge (ex. conda-forge-proxy), like it worked for installing mypy in the above example

Expected behavior

I expected that pixi will:

  1. fetch all specified mirrors in order, not only the first one
  2. fetch pypi packages even without compressed_mappings (btw, pip have index and index-url in config)
@ruben-arts
Copy link
Contributor

The error is caused by the requirement to find our custom conda-pypi-mapping This makes sure pixi won't override conda packages with pypi packages when the same packages come from the solve.

You can selfhost or hardcode the mapping in your project. Documentation here: https://pixi.sh/dev/reference/project_configuration/#conda-pypi-map-optional

The mapping is located here: https://github.com/prefix-dev/parselmouth/blob/main/files/compressed_mapping.json

The WARN Ignoring was a typo in the documentation it should have been repodata_options or repodata-options in the newer version. This is fixed in the latest documentation.

@toiletsandpaper
Copy link
Author

I don't really get it. How to config properly? I've downloaded mapping, then tried to add conda-pypi-mapping = {"conda-forge"} and even with replacing "conda-forge" with full link to "https://conda.anaconda.org/conda-forge", but still have this warn:

WARN Defined custom mapping channel https://conda.anaconda.org/conda-forge/ is missing from project channels

pixi_config_list_cat_piped.txt
pixi.txt

@toiletsandpaper
Copy link
Author

Can we just have config flag like disable-conda = true for environments, when we don't use conda at all? Maybe then you don't even will be needed to check mappings... 👉👈

@ruben-arts
Copy link
Contributor

You can disable mapping with giving it an empty table:

conda-pypi-map = { }

The mapping was indeed broken. Not sure for how long but I fixed that in #1820

@toiletsandpaper
Copy link
Author

I've changed config to

conda-pypi-map = { }

and now I can install packages only from conda (btw, looks like not only from the first one mirror in list, but even from nvidia conda channel). Also pixi now panicking when I do add/remove some packages - but package itself is installed/uninstalled after this error as normal anyways.

But --pypi packages now failing... all info in .txt below

pixi.txt

@toiletsandpaper
Copy link
Author

Any info about how to make pypi work properly?

@ruben-arts
Copy link
Contributor

We'll have to dive a little deeper. I'm sorry for the inconvenience. You could manually make a pip install task to to the pypi work untill we figure this out properly.

@ruben-arts ruben-arts added the 🐍 pypi Issue related to PyPI dependencies label Aug 19, 2024
@toiletsandpaper
Copy link
Author

toiletsandpaper commented Aug 27, 2024

@ruben-arts @baszalmstra pixi is still failing with --pypi flag like in #1764 (comment)

the only thing I've changed is upgrading to pixi v 0.28.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🐍 pypi Issue related to PyPI dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants