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

Latest Conda doesn't work against Artifactory with "conda install" #8623

Closed
yuvalreches opened this issue May 2, 2019 · 6 comments
Closed
Labels
locked [bot] locked due to inactivity

Comments

@yuvalreches
Copy link
Contributor

Current Behavior

The latest Conda client (tested with 4.6.14) fails to perform conda install X against JFrog Artifactory.
Any version of 4.5.x and below does work.

Seems to be an issue with a new commit on conda/common/url.py line 119, in path_to_url

Steps to Reproduce

  1. Run Artifactory (https://jfrog.com/download-artifactory-pro/)
  2. Set up Conda repositories (top right Admin menu --> Quick setup --> Conda)
  3. Install the latest Conda client
  4. Configure Conda client to work against Artifactory:
    Go to Artifctory Conda repo, click on Set Me Up in the top right
    under ~/.condarc add the text from the Set Me Up dialog
    (starts with: channel_alias: http://admin:<KEY>@localhost:8081/artifactory/api/conda/conda/......)
  5. Perform conda install scipy
  6. You will notice a IndexError: string index out of range of the client.

The following stacktrace appears:

    Traceback (most recent call last):
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1003, in __call__
        return func(*args, **kwargs)
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/cli/main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/cli/main_install.py", line 20, in execute
        install(args, parser, 'install')
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/cli/install.py", line 275, in install
        handle_txn(unlink_link_transaction, prefix, args, newenv)
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/cli/install.py", line 304, in handle_txn
        unlink_link_transaction.execute()
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/core/link.py", line 236, in execute
        self.verify()
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/common/io.py", line 88, in decorated
        return f(*args, **kwds)
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/core/link.py", line 213, in verify
        self.prepare()
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/core/link.py", line 205, in prepare
        stp.remove_specs, stp.update_specs)
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/core/link.py", line 280, in _prepare
        for prec, pcrec in zip(link_precs, pkg_cache_recs_to_link))
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/core/link.py", line 280, in <genexpr>
        for prec, pcrec in zip(link_precs, pkg_cache_recs_to_link))
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/gateways/disk/read.py", line 104, in read_package_info
        channel=Channel(record.schannel or record.channel),
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/models/channel.py", line 37, in __call__
        c = Channel._cache_[value] = Channel.from_value(value)
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/models/channel.py", line 106, in from_value
        return Channel.from_url(path_to_url(value))
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/_vendor/auxlib/decorators.py", line 59, in _memoized_func
        result = func(*args, **kwargs)
      File "/Users/yuvalr/miniconda2/lib/python2.7/site-packages/conda/common/url.py", line 119, in path_to_url
        if path[1] == ':':
    IndexError: string index out of range

I would mention that I noticed the url.py code has been changed in the latest version.
During the run, the path variable gets the value of /.
However the new code looks for ":" at second char for some reason.

On the old version (4.5.12) I see the value of path is also /, and it works perfectly with Artifactory.

Stacktrace shows problem is here:

conda/common/url.py", line 119, in path_to_url
        if path[1] == ':':
    IndexError: string index out of range

But I couldn't figure out where the path is derived from.
Seems to me the condition should be different.

Environment Information

`conda info`

``` active environment : None user config file : /Users/yuvalr/.condarc populated config files : /Users/yuvalr/.condarc conda version : 4.6.14 conda-build version : not installed python version : 2.7.16.final.0 base environment : /Users/yuvalr/miniconda2 (writable) channel URLs : http://admin:@localhost:8080/artifactory/api/conda/conda-remote/osx-64 http://admin:@localhost:8080/artifactory/api/conda/conda-remote/noarch package cache : /Users/yuvalr/miniconda2/pkgs /Users/yuvalr/.conda/pkgs envs directories : /Users/yuvalr/miniconda2/envs /Users/yuvalr/.conda/envs platform : osx-64 user-agent : conda/4.6.14 requests/2.21.0 CPython/2.7.16 Darwin/18.5.0 OSX/10.14.4 UID:GID : 501:20 netrc file : None offline mode : False ```

`conda config --show-sources`

``` ==> /Users/yuvalr/.condarc <== channels: - http://admin:@localhost:8080/artifactory/api/conda/conda-remote/ default_channels: - http://admin:@localhost:8080/artifactory/api/conda/conda-remote/ channel_alias: http://admin:@localhost:8080/artifactory/api/conda/conda-remote/ ```

@yuvalreches
Copy link
Contributor Author

@mingwandroid Maybe you could have a look please? :)

@msarahan
Copy link
Contributor

msarahan commented May 2, 2019

Artifactory is a 3rd party index, and while conda doesn't intentionally break it, we also make no effort to ensure that it will not break, nor do we "fix" conda when it breaks.

@AlexMikhalev
Copy link

AlexMikhalev commented May 14, 2019

Bump. Same issue on Linux.
@msarahan if you can propose workaround it would be more helpful.

@AlexMikhalev
Copy link

The actual fix has already been committed,
b030abf
the problem is current miniconda.sh and anaconda.sh shipped with broken get_url which means you would not be able to install updated conda package.
Solution: open the editor and fix manually
if len(path) > 1 and path[1] == ':':

@tpanza
Copy link

tpanza commented Oct 4, 2019

Any insight on when we can see an update to conda 4.6.x on Linux that applies this fix?

@rgommers
Copy link
Contributor

This can be closed, the solution landed in conda 4.7.0

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Mar 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

6 participants