conan: [bug] conan install sometimes fails offline, despite all recipes/packages in cache
Environment details
- Operating System+version: Ubuntu 22.04 x86_64
- Compiler+version: g++11
- Conan version: 2.0.15
- Python version: 3.10
We are using a private artifactory instance as our conan remote, with conan-center removed from the remotes list.
Steps to reproduce
Reproduction: I’m still not sure how to reproduce this. Sometimes it happens, and sometimes it doesn’t.
The only step I take on my end that causes it to occur is to disconnect my machine from the internet.
Notes:
- All recipes and binaries are definitely in my local cache (due to earlier builds succeeding while online)
- “–update” is not passed as an arg to
conan install
, so it shouldn’t be reaching out to any remotes - Passing
-nr
while offline (and while this error is occurring) allows for a successful build, also proving the recipes/package binaries are available - The project build does succeed when
-nr
is passed. - My
conan install
invocation (with -vvv passed in) is contained within the logs attached. - The is one log for invoking with
-nr
and one without (and contains the error output)
Logs
install_log_with_nr.txt install_log_without_nr.txt
Related slack thread: https://cpplang.slack.com/archives/C41CWV9HA/p1703140106967259
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Comments: 28 (13 by maintainers)
I am experimenting in https://github.com/conan-io/conan/pull/15516 the possibility of the behavior that you suggest above, and considering the possible risks. Not guaranteed to move forward, just trying at this moment
In any case, the intended and designed Conan logic is that “offline remotes” must be managed explicitly, not implicitly, and
-nr
is a convenience to avoid temporary disabling of remotes by users, not as a general strategy. If at some point some remotes are offline, the recommended approach is to explicitly inform Conan withconan remote disable
. Otherwise remotes are expected to be available and connected, and not being able to reach them is considered an error, not skipped.