Closed adamryczkowski closed 4 months ago
Thanks @adamryczkowski for opening this issue. We are currently investigating.
The recipe in the logs will attempt to download this file: https://github.com/abseil/abseil-cpp/archive/20230125.3.tar.gz which should require no authentication, so it's a bit strange to see this error
Thanks for your report @adamryczkowski
I am not able to reproduce it here. Sources are downloaded correctly. I am trying with:
conan install --requires=abseil/20230125.3 --build=abseil*
which forces to trigger the same you are reporting. I have tried in 2 different machines, Windows and Ubuntu, works well in both.
I think it might be something else from your side. Does it happen with every download from github? Can you please try with other packages? Do you have any special github configuration?
Interesting. Thank you for letting me know. Let me try on different machines on my end... Give me a few minutes.
I tried from a different Ubuntu 22.04 machine, and got the same error:
...
gnu-config/cci.20210814: Retrieving package da39a3ee5e6b4b0d3255bfef95601890afd80709 from remote 'conancenter'
gnu-config/cci.20210814: Package installed da39a3ee5e6b4b0d3255bfef95601890afd80709
gnu-config/cci.20210814: Downloaded package revision 22618e30bd9e326eb95e824dc90cc860
gperf/3.1: Retrieving package 3593751651824fb813502c69c971267624ced41a from remote 'conancenter'
gperf/3.1: Package installed 3593751651824fb813502c69c971267624ced41a
gperf/3.1: Downloaded package revision 0ba7440d0b6449abe04c0de185ea7922
m4/1.4.19: Retrieving package 3593751651824fb813502c69c971267624ced41a from remote 'conancenter'
m4/1.4.19: Package installed 3593751651824fb813502c69c971267624ced41a
m4/1.4.19: Downloaded package revision cd8019a4f9b70880d548f7cc26569604
ninja/1.11.1: Retrieving package 3593751651824fb813502c69c971267624ced41a from remote 'conancenter'
ninja/1.11.1: Package installed 3593751651824fb813502c69c971267624ced41a
ninja/1.11.1: Downloaded package revision 60e6fc0f973babfbed66a66af22a4f02
nlohmann_json/3.11.3: Retrieving package da39a3ee5e6b4b0d3255bfef95601890afd80709 from remote 'conancenter'
nlohmann_json/3.11.3: Package installed da39a3ee5e6b4b0d3255bfef95601890afd80709
nlohmann_json/3.11.3: Downloaded package revision 552828a2560333bcbeff9d087ce0af0f
pkgconf/2.1.0: Retrieving package c0b621fd4b3199fe05075171573398833dba85f4 from remote 'conancenter'
pkgconf/2.1.0: Package installed c0b621fd4b3199fe05075171573398833dba85f4
pkgconf/2.1.0: Downloaded package revision 74a82dec52448dda20253a19d65965c7
pkgconf/2.2.0: Retrieving package c0b621fd4b3199fe05075171573398833dba85f4 from remote 'conancenter'
pkgconf/2.2.0: Package installed c0b621fd4b3199fe05075171573398833dba85f4
pkgconf/2.2.0: Downloaded package revision 35e5163b1cf42becef616e6b7873202e
autoconf/2.71: Retrieving package da39a3ee5e6b4b0d3255bfef95601890afd80709 from remote 'conancenter'
autoconf/2.71: Package installed da39a3ee5e6b4b0d3255bfef95601890afd80709
autoconf/2.71: Downloaded package revision 5b77f70c17ad1741f5845d4e468a347e
meson/1.4.0: Retrieving package da39a3ee5e6b4b0d3255bfef95601890afd80709 from remote 'conancenter'
meson/1.4.0: Package installed da39a3ee5e6b4b0d3255bfef95601890afd80709
meson/1.4.0: Downloaded package revision 91b870cdcf4edb1a302a2ef7a0514791
automake/1.16.5: Retrieving package 9a4eb3c8701508aa9458b1a73d0633783ecc2270 from remote 'conancenter'
automake/1.16.5: Package installed 9a4eb3c8701508aa9458b1a73d0633783ecc2270
automake/1.16.5: Downloaded package revision 9719e51a6a62041af6a63e00eef35434
abseil/20230125.3: Sources downloaded from 'conancenter'
abseil/20230125.3: Calling source() in /home/adam/.conan2/p/absei529ffcf1a2678/s/src
ERROR: abseil/20230125.3: Error in source() method, line 81
get(self, **self.conan_data["sources"][self.version], strip_root=True)
AuthenticationException: Deprecated authentication method. Create a Personal Access Token to access: https://github.com/settings/tokens
It may be relevant, that I've installed conan with pipx
.
I have still an Ubuntu 24.04 to try...
Btw, there were 2 additional steps to reproduce in the last run:
pipx install conan
conan profile detect
The last one produced the following output:
detect_api: Found cc=gcc- 12.3.0
detect_api: gcc>=5, using the major as version
detect_api: gcc C++ standard library: libstdc++11
Detected profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux
WARN: This profile is a guess of your environment, please check it.
WARN: The output of this command is not guaranteed to be stable and can change in future Conan versions.
WARN: Use your own profile files for stability.
Saving detected profile to /home/adam/.conan2/profiles/default
That is still surprising, I am not sure where this is coming from, unless there is some special configuration in your machines or network that could be affecting.
Does it happen the same for other packages? can you please try with any other package with the code on github, as nlohmann_json/3.11.3
? You can try packages independently with conan install --requires=nlohmann_json/3.11.3 --build=nlohmann*
Can you reproduce it in a docker image you can share with us? Are you aware of any company configuration, computer provisioning, corporate network/vpn/proxy that could be affecting?
Thank you for the conan install --requires=nlohmann_json/3.11.3 --build=nlohmann*
. It fails with the same error on all my three development environments. On the other hand, both your command and my original script works successfully on a vanilla Ubuntu 22.04 and 24.04 so I understand why you cannot reproduce either. Hm... I wonder what is the problem on my production machines...
I am not aware of any GitHub-specific configuration on my end. I also tried disabling .bashrc
conan install --requires=nlohmann_json/3.11.3 --build=nlohmann*
does NOT fail on virtual machines spawned from the machines where it fails (For convenience, I currently use LXC to test rather than Docker)
Hi @adamryczkowski,
By any chance do you have a source_credentials.json in your Conan cache that could be adding credentials when you try to download sources from GitHub?
If that's the case, please try to rename the file and try again.
You can check by doing conan config home
and checking for the file there.
I don't think I have anything related to credentials. Here's my debug session:
[adam:~] $ conan install --requires=nlohmann_json/3.11.3 --build=nlohmann*
======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
======== Computing dependency graph ========
Graph root
cli
Requirements
nlohmann_json/3.11.3#45828be26eb619a2e04ca517bb7b828d - Cache
======== Computing necessary packages ========
nlohmann_json/3.11.3: Forced build from source
Requirements
nlohmann_json/3.11.3#45828be26eb619a2e04ca517bb7b828d:da39a3ee5e6b4b0d3255bfef95601890afd80709 - Build
======== Installing packages ========
nlohmann_json/3.11.3: WARN: Trying to remove corrupted source folder
nlohmann_json/3.11.3: WARN: This can take a while for big packages
nlohmann_json/3.11.3: Calling source() in /home/adam/.conan2/p/nlohm8cff3addf075b/s/src
ERROR: nlohmann_json/3.11.3: Error in source() method, line 36
get(self, **self.conan_data["sources"][self.version], strip_root=True)
AuthenticationException: Deprecated authentication method. Create a Personal Access Token to access: https://github.com/settings/tokens
[adam:~] 1 $ conan cache path nlohmann_json/3.11.3
/home/adam/.conan2/p/nlohm8cff3addf075b/e
[adam:~] $ cd /home/adam/.conan2/p/nlohm8cff3addf075b/e
[adam:~/.conan2/p/nlohm8cff3addf075b/e] $ ls
conandata.yml conanfile.py conanmanifest.txt
[adam:~/.conan2/p/nlohm8cff3addf075b/e] $ cat conandata.yml
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: conandata.yml
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ sources:
2 │ 3.11.3:
3 │ sha256: 0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406
4 │ url: https://github.com/nlohmann/json/archive/v3.11.3.tar.gz
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[adam:~/.conan2/p/nlohm8cff3addf075b/e] 4s $ cat conanfile.py -p
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
import os
required_conan_version = ">=1.50.0"
class NlohmannJsonConan(ConanFile):
name = "nlohmann_json"
homepage = "https://github.com/nlohmann/json"
description = "JSON for Modern C++ parser and generator."
topics = "json", "header-only"
url = "https://github.com/conan-io/conan-center-index"
license = "MIT"
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True
@property
def _minimum_cpp_standard(self):
return 11
def layout(self):
basic_layout(self, src_folder="src")
def package_id(self):
self.info.clear()
def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, self._minimum_cpp_standard)
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
pass
def build(self):
pass
def package(self):
copy(self, "LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses"))
copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include"))
def package_info(self):
self.cpp_info.set_property("cmake_file_name", "nlohmann_json")
self.cpp_info.set_property("cmake_target_name", "nlohmann_json::nlohmann_json")
self.cpp_info.set_property("pkg_config_name", "nlohmann_json")
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
[adam:~/.conan2/p/nlohm8cff3addf075b/e] $ cat conanmanifest.txt
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: conanmanifest.txt
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 1701220700
2 │ conandata.yml: 0548419b4d47b41d49d9bd609fc0c113
3 │ conanfile.py: 5e0fc6193591c8f6055fd4a97445a4f1
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I can also download the file from the command line:
[adam:~/.conan2/p/nlohm8cff3addf075b/e] $ wget https://github.com/nlohmann/json/archive/v3.11.3.tar.gz
--2024-07-08 12:07:18-- https://github.com/nlohmann/json/archive/v3.11.3.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/nlohmann/json/tar.gz/refs/tags/v3.11.3 [following]
--2024-07-08 12:07:19-- https://codeload.github.com/nlohmann/json/tar.gz/refs/tags/v3.11.3
Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8053705 (7.7M) [application/x-gzip]
Saving to: ‘v3.11.3.tar.gz’
v3.11.3.tar.gz 100%[========================================================================================================================================>] 7.68M 10.8MB/s in 0.7s
2024-07-08 12:07:20 (10.8 MB/s) - ‘v3.11.3.tar.gz’ saved [8053705/8053705]
I can also download the file from the command line:
[adam:~/.conan2/p/nlohm8cff3addf075b/e] $ wget https://github.com/nlohmann/json/archive/v3.11.3.tar.gz --2024-07-08 12:07:18-- https://github.com/nlohmann/json/archive/v3.11.3.tar.gz Resolving github.com (github.com)... 140.82.121.4 Connecting to github.com (github.com)|140.82.121.4|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://codeload.github.com/nlohmann/json/tar.gz/refs/tags/v3.11.3 [following] --2024-07-08 12:07:19-- https://codeload.github.com/nlohmann/json/tar.gz/refs/tags/v3.11.3 Resolving codeload.github.com (codeload.github.com)... 140.82.121.9 Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 8053705 (7.7M) [application/x-gzip] Saving to: ‘v3.11.3.tar.gz’ v3.11.3.tar.gz 100%[========================================================================================================================================>] 7.68M 10.8MB/s in 0.7s 2024-07-08 12:07:20 (10.8 MB/s) - ‘v3.11.3.tar.gz’ saved [8053705/8053705]
Can you please double check by doing something like:
ls $(conan config home)
And verify that source_credentials.json
is not there?
I found the problem:
~/.netrc
. What I have inside is
default
login <user name>
password <user token>
which I use to authenticate with the company's asset server.
I never thought it would be relevant. I am a wget guy, not using curl other than implicitly for some work-related download script someone else wrote.
From my perspective, the issue is solved. Thank you very much for your help and time.
Probably it would be worth it to mention that issue (with the error I got from GitHub) in FAQ session, so it gets indexed by Google, and cuts the friction for the Conan-beginners like me.
Something like:
Conan uses curl to fetch the packages. If you have login credentials in .netrc
that uses the default
scope - i.e. they apply to all the sites - GitHub may return this error.
Solution: Replace the default
with the actual site you want your login credentials in .netrc
be applied to, or remove the file altogether.
Great that you found the root issue!
The effect of .netrc
is already described in the FAQ: https://docs.conan.io/2/knowledge/faq.html#error-authenticationexception
As a detail, it is not because Conan uses curl
, but the Python requests
http library is also honoring the .netrc
file.
Do you think that some further clarification is needed in that entry of the FAQ? Thanks for the feedback.
Closing as solved. If you have any specific suggestion for the docs, you can always open a ticket in the docs
repo, or even directly a suggestion in the form of a PR. Thanks!
The effect of
.netrc
is already described in the FAQ: https://docs.conan.io/2/knowledge/faq.html#error-authenticationexceptionAs a detail, it is not because Conan uses
curl
, but the Pythonrequests
http library is also honoring the.netrc
file.Do you think that some further clarification is needed in that entry of the FAQ? Thanks for the feedback.
Yes. Please add a verbatim quote of the error message I got. This way someone like me will find it and solve in order of seconds rather than hours.
Thank you.
Describe the bug
Ubuntu 22.04, Conan 2.5.0.
https://github.com/conan-io/examples2.git, example
tutorial/consuming_packages/simple_cmake_project
.I added Google-cloud in the conanfile.txt to make the example do something (I already have
zlib-dev
installed on my machine, so testing Conan with it would not prove that Conan actually did any work).I get the following error:
How to reproduce it