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

[bug] Conan cache restore on non-existing file #16112

Closed
Todiq opened this issue Apr 19, 2024 · 1 comment · Fixed by #16113
Closed

[bug] Conan cache restore on non-existing file #16112

Todiq opened this issue Apr 19, 2024 · 1 comment · Fixed by #16113
Assignees
Labels
Milestone

Comments

@Todiq
Copy link
Contributor

Todiq commented Apr 19, 2024

Describe the bug

OS : Windows 11 23H2 & Python 3.9.13. Same behaviour on docker image python:3.9.19-slim
Conan version : 2.2.3

Trying to restore a non-existing file with conan cache restore file results in a traceback.

How to reproduce it

I have no name!@docker-desktop:/workspace$ conan cache restore hello
ERROR: Traceback (most recent call last):
  File "/opt/venv/lib/python3.9/site-packages/conan/cli/cli.py", line 283, in main
    cli.run(args)
  File "/opt/venv/lib/python3.9/site-packages/conan/cli/cli.py", line 193, in run
    command.run(self._conan_api, args[0][1:])
  File "/opt/venv/lib/python3.9/site-packages/conan/cli/command.py", line 180, in run
    sub.run(conan_api, parser, *args)
  File "/opt/venv/lib/python3.9/site-packages/conan/cli/command.py", line 197, in run
    info = self._method(conan_api, parent_parser, self._parser, *args)
  File "/opt/venv/lib/python3.9/site-packages/conan/cli/commands/cache.py", line 156, in cache_restore
    package_list = conan_api.cache.restore(path)
  File "/opt/venv/lib/python3.9/site-packages/conan/api/subapi/cache.py", line 158, in restore
    with open(path, mode='rb') as file_handler:
FileNotFoundError: [Errno 2] No such file or directory: '/workspace/hello'

ERROR: [Errno 2] No such file or directory: '/workspace/hello'
@memsharded memsharded self-assigned this Apr 19, 2024
@memsharded memsharded added the bug label Apr 19, 2024
@memsharded memsharded added this to the 2.3.0 milestone Apr 19, 2024
@memsharded
Copy link
Member

Thanks for reporting @Todiq
It was fixed in #16113 for next Conan 2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants