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

--offline mode does not work if user has just cleaned the index cache #1197

Closed
jaimergp opened this issue Oct 1, 2021 · 3 comments
Closed
Labels
type::question Further information is requested

Comments

@jaimergp
Copy link
Contributor

jaimergp commented Oct 1, 2021

This is kind of a corner case.

% conda clean --index-cache
% mamba create  -n testtestre --offline python
...

    Traceback (most recent call last):
      File "/opt/conda-src/conda/exceptions.py", line 1085, in __call__
        return func(*args, **kwargs)
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 927, in exception_converter
        raise e
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 921, in exception_converter
        exit_code = _wrapped_main(*args, **kwargs)
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 879, in _wrapped_main
        result = do_call(args, p)
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 761, in do_call
        exit_code = create(args, parser)
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 664, in create
        return install(args, parser, "create")
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 534, in install
        index = load_channels(pool, channels, repos)
      File "/opt/conda/lib/python3.9/site-packages/mamba/utils.py", line 172, in load_channels
        with FileLock(subdir.cache_path()):
    RuntimeError: Cache not loaded!

....

If I use a different lock file by patching this line, we get a different error:

% mamba create -n test  --offline python
....
    Traceback (most recent call last):
      File "/opt/conda-src/conda/exceptions.py", line 1085, in __call__
        return func(*args, **kwargs)
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 927, in exception_converter
        raise e
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 921, in exception_converter
        exit_code = _wrapped_main(*args, **kwargs)
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 879, in _wrapped_main
        result = do_call(args, p)
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 761, in do_call
        exit_code = create(args, parser)
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 664, in create
        return install(args, parser, "create")
      File "/opt/conda/lib/python3.9/site-packages/mamba/mamba.py", line 534, in install
        index = load_channels(pool, channels, repos)
      File "/opt/conda/lib/python3.9/site-packages/mamba/utils.py", line 174, in load_channels
        repo = subdir.create_repo(pool)
    RuntimeError: [json.exception.type_error.302] type must be string, but is null
@wolfv
Copy link
Member

wolfv commented Oct 2, 2021

We have a function in mamba to create a repository from all things found in pkgs — but I'm not sure that would be the expected behavior. I think it should fail, right? Since we can't solve for the indicated channels.

@adriendelsalle
Copy link
Member

@jaimergp the lock files were replaced by our implementation

I also don't get how to solve offline without an index file, could you please elaborate a bit on that?
Thx!

@adriendelsalle adriendelsalle added the type::question Further information is requested label Nov 2, 2021
@jaimergp
Copy link
Contributor Author

jaimergp commented Nov 2, 2021

This reproduces the test found at https://github.com/conda/conda/blob/27c559cec875f61ccaad56817562ed0a42afc5f0/tests/test_create.py#L2342.

Let me know if you need more context!

@jonashaag jonashaag closed this as not planned Won't fix, can't repro, duplicate, stale Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants