conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
7.96k stars 952 forks source link

[bug] fails to download from conancenter #16437

Closed ocpalo closed 3 weeks ago

ocpalo commented 3 weeks ago

Describe the bug

Rocky linux 9.4 conan version 2.4.0

conan profile:

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

Error is:

libsodium/1.0.19: WARN: network: Error downloading file https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz: 'HTTPSConnectionPool(host='[github.com](http://github.com/)', port=443): Max retries exceeded with url: /jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz (Caused by ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')))'
libsodium/1.0.19: Waiting 5 seconds to retry...
libsodium/1.0.19: WARN: network: Error downloading file https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz: 'HTTPSConnectionPool(host='[github.com](http://github.com/)', port=443): Max retries exceeded with url: /jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz (Caused by ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')))'
libsodium/1.0.19: Waiting 5 seconds to retry...
ERROR: libsodium/1.0.19: Error in source() method, line 74
        get(self, **self.conan_data["sources"][self.version], strip_root=True)
        ConanException: Error downloading file https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz: 'HTTPSConnectionPool(host='[github.com](http://github.com/)', port=443): Max retries exceeded with url: /jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz (Caused by ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')))'

How to reproduce it

No response

ocpalo commented 3 weeks ago

image (6)

It fails to download protobuff to. However I think zlib successfully downloaded and installed. What can be wrong?

memsharded commented 3 weeks ago

Hi @ocpalo

This kind of error, downloading things from the internet can be caused by several reasons, outside Conan scope, like VPN, enterprise proxies configurations, ZScaler, custom user certificates, etc.

Something you can try is to add the -c tools.files.download:verify=False to disable the https verification (this is kind of a workaround/test, if this works, then you might need to work with your IT to find the blocker and allow-list those URLs or add certificates)

ocpalo commented 3 weeks ago

conan install -c tools.files.download:verify=False . --output=build --build=missing

I tried like that and it did not work out. Is the placement of the -c tools... flag correct?

memsharded commented 3 weeks ago

In general it is preferred positional arguments first (argparse can have ambiguities otherwise), so

conan install  . -c tools.files.download:verify=False --output-folder=build --build=missing

Also the --output-folder full format is preferred, or the short -of=build

Still it doesn't seem that it would be the issue, and there are other limitations elsewhere. Can you please confirm your system conan version and also if you are running it in some corporate computer and/or network that could be limiting some resources?

ocpalo commented 3 weeks ago

I tried to git clone and it also failed. Error is :

fatal: unable to access 'https://github.com/zeux/pugixml/': OpenSSL SSL_connect: Connection reset by peer in connection to github.com:443)fatal: unable to access 'https://github.com/zeux/pugixml/': OpenSSL SSL_connect: Connection reset by peer in connection to [github.com:443](http://github.com:443/)

Do you have any idea about that error?

There is something wrong with the netwok configuraitons. It seems that it has nothing to do with conan. Thanks for quick response!

memsharded commented 3 weeks ago

Do you have any idea about that error?

Yes, I know the main reasons:

But besides that it is quite challenging to know what exactly it could be. If you can easily reproduce with a git clone url or a wget or curl normal download, I suggest you reach out to your IT with that and ask them for help. This process might need to be iterated a few times to allow-list several sites like github, sourceforge and others

ocpalo commented 3 weeks ago

ah ok. Thank you. I am closing this.

ocpalo commented 3 weeks ago

Hi again @memsharded

It is odd that without making any changes on network, i managed to sucessfully run conan install with the following command

conan install . -pr:h=release -pr:b=release --output-folder=build --build=missing

Previously I was used

conan install . --output-folder=build --build=missing

Do you think that makes a difference?

memsharded commented 3 weeks ago

-pr:h=release -pr:b=release

No, the profiles shouldn't affect this behavior, unless you had some specific [conf] in your profiles, the source() download will do exactly the same. Maybe it is that using those profiles, Conan is finding a pre-compiled binary and not needing to build from source, and as it is not building from source, the source() method will not be executed and it will not fail to download anything. You should be able to see that in the output of the command.