conan-io / conan

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

Conan seems to be using deprecated authentication method with GitHub [bug] #16628

Closed adamryczkowski closed 4 months ago

adamryczkowski commented 4 months ago

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).

[requires]
zlib/1.2.11
google-cloud-cpp/2.19.0

[generators]
CMakeDeps
CMakeToolchain

[layout]
cmake_layout

I get the following error:

======== 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
    conanfile.txt: /home/Adama-docs/Adam/MyDocs/praca/Sabre/Projects/Spanner/examples2/tutorial/consuming_packages/simple_cmake_project/conanfile.txt
Requirements
    abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02 - Cache
    bzip2/1.0.8#411fc05e80d47a89045edc1ee6f23c1d - Cache
    c-ares/1.19.1#fdfbfd5f2e5c3b6c019302e167442d0d - Cache
    crc32c/1.1.2#6aace0bc1ea0bdb963bcb40953b5031d - Cache
    google-cloud-cpp/2.19.0#e1c3d7dec38c25142254c69b17853993 - Cache
    grpc/1.54.3#c91ab98988e037d26221e3921baf8c68 - Cache
    libcap/2.69#7ef2d60864c2e58e89db957be936dc49 - Cache
    libcurl/8.8.0#9170903d66d6f6e6795fbb566a403129 - Cache
    libmount/2.39.2#64850679fa9d5ead878e5076b0cab2a8 - Cache
    libselinux/3.6#5a78ff6ae5034eeaac8da723361a8ce4 - Cache
    libsystemd/255#8e49d0c6b1d63861e3e10665cc1b7b4d - Cache
    libxcrypt/4.4.36#4b4e8f20794f1997dd59eeed0b7cdcfb - Cache
    lz4/1.9.4#1217a03c990b79aa34ed0faede18f534 - Cache
    nlohmann_json/3.11.3#45828be26eb619a2e04ca517bb7b828d - Cache
    openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15 - Cache
    pcre2/10.42#576680686b88a4dadf6d382d6d6351d9 - Cache
    protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73 - Cache
    re2/20230301#e8d673155a0494f27c7589b611e8350d - Cache
    xz_utils/5.4.5#51e5a6e6564f4ea3afd79def01f035ad - Cache
    zlib/1.2.11#ffa77daf83a57094149707928bdce823 - Cache
    zstd/1.5.5#93372fe14bb7883bd4de82914e0a1841 - Cache
Build requirements
    abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02 - Cache
    autoconf/2.71#f9307992909d7fb3df459340f1932809 - Cache
    automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50 - Cache
    bzip2/1.0.8#411fc05e80d47a89045edc1ee6f23c1d - Cache
    c-ares/1.19.1#fdfbfd5f2e5c3b6c019302e167442d0d - Cache
    flex/2.6.4#e35bc44b3fcbcd661e0af0dc5b5b1ad4 - Cache
    gnu-config/cci.20210814#15c3bf7dfdb743977b84d0321534ad90 - Cache
    gperf/3.1#1d622ad9717e9348ed3685c9994ad0b9 - Cache
    grpc/1.54.3#c91ab98988e037d26221e3921baf8c68 - Cache
    libcap/2.69#7ef2d60864c2e58e89db957be936dc49 - Cache
    libmount/2.39.2#64850679fa9d5ead878e5076b0cab2a8 - Cache
    libselinux/3.6#5a78ff6ae5034eeaac8da723361a8ce4 - Cache
    libsystemd/255#8e49d0c6b1d63861e3e10665cc1b7b4d - Cache
    libtool/2.4.7#08316dad5c72c541ed21e039e4cf217b - Cache
    libxcrypt/4.4.36#4b4e8f20794f1997dd59eeed0b7cdcfb - Cache
    lz4/1.9.4#1217a03c990b79aa34ed0faede18f534 - Cache
    m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Cache
    meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19 - Cache
    meson/1.4.0#024dfac41ea5570cb1aec3ea6fe34d0a - Cache
    ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache
    openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15 - Cache
    pcre2/10.42#576680686b88a4dadf6d382d6d6351d9 - Cache
    pkgconf/2.1.0#27f44583701117b571307cf5b5fe5605 - Cache
    pkgconf/2.2.0#6462942a22803086372db44689ba825f - Cache
    protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73 - Cache
    re2/20230301#e8d673155a0494f27c7589b611e8350d - Cache
    xz_utils/5.4.5#51e5a6e6564f4ea3afd79def01f035ad - Cache
    zlib/1.2.13#e377bee636333ae348d51ca90874e353 - Cache
    zstd/1.5.5#93372fe14bb7883bd4de82914e0a1841 - Cache
Resolved version ranges
    libcurl/[>=7.78 <9]: libcurl/8.8.0
    openssl/[>=1.1 <4]: openssl/3.2.2
    zlib/[>=1.2.11 <2]: zlib/1.2.13

======== Computing necessary packages ========
abseil/20230125.3: Compatible package ID 838c313f1b7acdfd23b222f0156e7c264dcc2515 equal to the default package ID: Skipping it.
abseil/20230125.3: Checking 7 compatible configurations
abseil/20230125.3: Compatible configurations not found in cache, checking servers
abseil/20230125.3: '97f9d2083eade1b2faa35ed31dacf4eedb1da012': compiler.cppstd=14
abseil/20230125.3: '8dae6b0772f40e251c46f6cd0dad705447084b6c': compiler.cppstd=gnu14
abseil/20230125.3: '87bbb286a7517318e730f10181ac32c50f1dbc94': compiler.cppstd=17
abseil/20230125.3: '5e94c1dd02c7d7a627af96ae15ead8ce230d4b66': compiler.cppstd=20
abseil/20230125.3: 'ae8bbfde471a4ef9ad5c9a444af7dc967e124f44': compiler.cppstd=gnu20
abseil/20230125.3: '4b45763d7e991e78ae4e5ddc6855437d163e666a': compiler.cppstd=23
abseil/20230125.3: 'fa0109ce4135cff0ce8b21ebe07ebf08a1ebd5ee': compiler.cppstd=gnu23
crc32c/1.1.2: Compatible package ID 838c313f1b7acdfd23b222f0156e7c264dcc2515 equal to the default package ID: Skipping it.
crc32c/1.1.2: Checking 9 compatible configurations
crc32c/1.1.2: Compatible configurations not found in cache, checking servers
crc32c/1.1.2: 'ea4603e10d8f2b746e15ef156a8d3732bb8e5487': compiler.cppstd=11
crc32c/1.1.2: '6e7289231a13f3ecc5e81da5418e2fd3ca83f067': compiler.cppstd=gnu11
crc32c/1.1.2: '97f9d2083eade1b2faa35ed31dacf4eedb1da012': compiler.cppstd=14
crc32c/1.1.2: '8dae6b0772f40e251c46f6cd0dad705447084b6c': compiler.cppstd=gnu14
crc32c/1.1.2: '87bbb286a7517318e730f10181ac32c50f1dbc94': compiler.cppstd=17
crc32c/1.1.2: '5e94c1dd02c7d7a627af96ae15ead8ce230d4b66': compiler.cppstd=20
crc32c/1.1.2: 'ae8bbfde471a4ef9ad5c9a444af7dc967e124f44': compiler.cppstd=gnu20
crc32c/1.1.2: '4b45763d7e991e78ae4e5ddc6855437d163e666a': compiler.cppstd=23
crc32c/1.1.2: 'fa0109ce4135cff0ce8b21ebe07ebf08a1ebd5ee': compiler.cppstd=gnu23
re2/20230301: Compatible package ID d82d61b049c28e3ef95ee28911620ac73218b75e equal to the default package ID: Skipping it.
re2/20230301: Checking 9 compatible configurations
re2/20230301: Compatible configurations not found in cache, checking servers
re2/20230301: 'f0f99c5b578f36dcc1cf4bc94c401008dac93823': compiler.cppstd=11
re2/20230301: '9746e33d5a48ab513a0eaea26d00b7958da76e59': compiler.cppstd=gnu11
re2/20230301: '13229baf20e106b598af499a73fc638f325a63e5': compiler.cppstd=14
re2/20230301: '6a20314cc50c86c5dacf8ab3ef1769c5949d590f': compiler.cppstd=gnu14
re2/20230301: 'aa13fd4badf8a00a52b3f3a760709c53a72932f1': compiler.cppstd=17
re2/20230301: '0ffd9f1c8347bf5e30f3b70158058325ea868fb8': compiler.cppstd=20
re2/20230301: 'eb8b2fa104154810893e3eb8d87df5a052ff62b5': compiler.cppstd=gnu20
re2/20230301: '14695d4fad01c1aaf31d6c3ec5ccd2a958f2627a': compiler.cppstd=23
re2/20230301: 'f0c2437e56eacd140e08852edf4696cf12e2ddfc': compiler.cppstd=gnu23
protobuf/3.21.12: Compatible package ID 4542f75c49be97c83728bba0f392fad58807ed00 equal to the default package ID: Skipping it.
protobuf/3.21.12: Checking 11 compatible configurations
protobuf/3.21.12: Compatible configurations not found in cache, checking servers
protobuf/3.21.12: 'fc176aab77c0f49d70dd4ce9fff2d203a42e580b': compiler.cppstd=98
protobuf/3.21.12: 'e7893d83073fe2cb1985f31bfb1b6993315d97a7': compiler.cppstd=gnu98
protobuf/3.21.12: '9e4fc7bb44e5605583559a81ac3b2d01c96834fe': compiler.cppstd=11
protobuf/3.21.12: '2885c1962ff97dba4480a0f03c83927dff78e9d1': compiler.cppstd=gnu11
protobuf/3.21.12: '28668c064f8d6fd8c04d442a5e7b20b43d2ba5ff': compiler.cppstd=14
protobuf/3.21.12: '7711c6db4a325a26e46d364de9cf5fe6c668cdfa': compiler.cppstd=gnu14
protobuf/3.21.12: 'a57a2aa9fcfcf6a8fcf58e04c5bfbbc95bc477fc': compiler.cppstd=17
protobuf/3.21.12: '74c47a8c6d45df59b72018f342d2b064e1099707': compiler.cppstd=20
protobuf/3.21.12: 'dd21620e26f9f2406102205016eac3e92ec4e960': compiler.cppstd=gnu20
protobuf/3.21.12: '7e494d8b7b2b8b2078f0223b804896f8430e919d': compiler.cppstd=23
protobuf/3.21.12: '6eea0ba7e15c87874824358f3156bed3794a6c52': compiler.cppstd=gnu23
grpc/1.54.3: Compatible package ID 3fec99570122730c4aaaa703150bba620fcae6ff equal to the default package ID: Skipping it.
grpc/1.54.3: Checking 7 compatible configurations
grpc/1.54.3: Compatible configurations not found in cache, checking servers
grpc/1.54.3: 'bace30a5669c5047012104cc07bc95bd7f3712ec': compiler.cppstd=14
grpc/1.54.3: '64b8ed04343953d7befaf07480df1cfb8128d16d': compiler.cppstd=gnu14
grpc/1.54.3: '87f731f4c481dc388ed72b307acae03fa5dad5f1': compiler.cppstd=17
grpc/1.54.3: '8dd0f9b98bb9f50baaf00c72885049d42ec04880': compiler.cppstd=20
grpc/1.54.3: 'efaf8342c3dab95ccc9d47cca540966aaf652576': compiler.cppstd=gnu20
grpc/1.54.3: 'd26b0f39d8309012280e1dce0d5f34cee98bc08d': compiler.cppstd=23
grpc/1.54.3: 'f205a5da1ec7fa465c2ce434e9b42540eb02129f': compiler.cppstd=gnu23
google-cloud-cpp/2.19.0: Compatible package ID fe432b097ecdd5b7ae53967a31bb98b1c9d2eed0 equal to the default package ID: Skipping it.
google-cloud-cpp/2.19.0: Checking 7 compatible configurations
google-cloud-cpp/2.19.0: Compatible configurations not found in cache, checking servers
google-cloud-cpp/2.19.0: '9837fbca80facda5bf78eb72c49fa4398e2bb3a8': compiler.cppstd=14
google-cloud-cpp/2.19.0: '88adcf34a375cf62e471e5095105656089b5bcf0': compiler.cppstd=gnu14
google-cloud-cpp/2.19.0: 'cc8b8c8600c6898375d066fd73c7c75f46b8fec2': compiler.cppstd=17
google-cloud-cpp/2.19.0: '20b3516dc35d635bd3ae6678b63f6981da616dd8': compiler.cppstd=20
google-cloud-cpp/2.19.0: 'cde7f307a0a0e458a337371cff0d25acb7b062c2': compiler.cppstd=gnu20
google-cloud-cpp/2.19.0: 'ea8f9e020db79fa02d00b711dfd05eb6e30105fe': compiler.cppstd=23
google-cloud-cpp/2.19.0: 'b21050daa747aeda64553e7fb16bf58153802e81': compiler.cppstd=gnu23
Requirements
    abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02:838c313f1b7acdfd23b222f0156e7c264dcc2515 - Build
    bzip2/1.0.8#411fc05e80d47a89045edc1ee6f23c1d:432d7695adc526147073285e155d2ca0340bc76d - Build
    c-ares/1.19.1#fdfbfd5f2e5c3b6c019302e167442d0d:7494606b7156a5838c6e9cf6f1b4434683f651b0 - Build
    crc32c/1.1.2#6aace0bc1ea0bdb963bcb40953b5031d:838c313f1b7acdfd23b222f0156e7c264dcc2515 - Build
    google-cloud-cpp/2.19.0#e1c3d7dec38c25142254c69b17853993:fe432b097ecdd5b7ae53967a31bb98b1c9d2eed0 - Build
    grpc/1.54.3#c91ab98988e037d26221e3921baf8c68:3fec99570122730c4aaaa703150bba620fcae6ff - Build
    libcap/2.69#7ef2d60864c2e58e89db957be936dc49:b5e16bfc1c90834c7a2a9a40bf19330cdaf7a61f - Build
    libcurl/8.8.0#9170903d66d6f6e6795fbb566a403129:14e90be0eca5e27cbf6fad35a2bdae2c9d728cae - Build
    libmount/2.39.2#64850679fa9d5ead878e5076b0cab2a8:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    libselinux/3.6#5a78ff6ae5034eeaac8da723361a8ce4:a0afe298300d5fbb1974cd513b25fe12e13151e0 - Build
    libsystemd/255#8e49d0c6b1d63861e3e10665cc1b7b4d:e6f1771258569bd1762887c6b054c224301a6798 - Build
    libxcrypt/4.4.36#4b4e8f20794f1997dd59eeed0b7cdcfb:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    lz4/1.9.4#1217a03c990b79aa34ed0faede18f534:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    nlohmann_json/3.11.3#45828be26eb619a2e04ca517bb7b828d:da39a3ee5e6b4b0d3255bfef95601890afd80709#552828a2560333bcbeff9d087ce0af0f - Cache
    openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15:502f8d3964c9daa17dc3d33f8aea77ba87afe7c8 - Build
    pcre2/10.42#576680686b88a4dadf6d382d6d6351d9:76c95db7e12977a699163a3804ecb7084abcc1b2 - Build
    protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73:4542f75c49be97c83728bba0f392fad58807ed00 - Build
    re2/20230301#e8d673155a0494f27c7589b611e8350d:d82d61b049c28e3ef95ee28911620ac73218b75e - Build
    xz_utils/5.4.5#51e5a6e6564f4ea3afd79def01f035ad:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    zlib/1.2.11#ffa77daf83a57094149707928bdce823:c81087b06d1a5beef0ad711fc32d45f7a425a8f3#8b4d794668affb718997b06d7265faba - Cache
    zstd/1.5.5#93372fe14bb7883bd4de82914e0a1841:ef043a2a516d05649c001063aa1b140e18f115d8 - Build
Build requirements
    abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02:838c313f1b7acdfd23b222f0156e7c264dcc2515 - Build
    autoconf/2.71#f9307992909d7fb3df459340f1932809:da39a3ee5e6b4b0d3255bfef95601890afd80709#5b77f70c17ad1741f5845d4e468a347e - Cache
    automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50:9a4eb3c8701508aa9458b1a73d0633783ecc2270#9719e51a6a62041af6a63e00eef35434 - Cache
    bzip2/1.0.8#411fc05e80d47a89045edc1ee6f23c1d:432d7695adc526147073285e155d2ca0340bc76d - Build
    c-ares/1.19.1#fdfbfd5f2e5c3b6c019302e167442d0d:7494606b7156a5838c6e9cf6f1b4434683f651b0 - Build
    flex/2.6.4#e35bc44b3fcbcd661e0af0dc5b5b1ad4:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    gnu-config/cci.20210814#15c3bf7dfdb743977b84d0321534ad90:da39a3ee5e6b4b0d3255bfef95601890afd80709#22618e30bd9e326eb95e824dc90cc860 - Cache
    gperf/3.1#1d622ad9717e9348ed3685c9994ad0b9:3593751651824fb813502c69c971267624ced41a#0ba7440d0b6449abe04c0de185ea7922 - Cache
    grpc/1.54.3#c91ab98988e037d26221e3921baf8c68:3fec99570122730c4aaaa703150bba620fcae6ff - Build
    libcap/2.69#7ef2d60864c2e58e89db957be936dc49:b5e16bfc1c90834c7a2a9a40bf19330cdaf7a61f - Build
    libmount/2.39.2#64850679fa9d5ead878e5076b0cab2a8:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    libselinux/3.6#5a78ff6ae5034eeaac8da723361a8ce4:a0afe298300d5fbb1974cd513b25fe12e13151e0 - Build
    libsystemd/255#8e49d0c6b1d63861e3e10665cc1b7b4d:e6f1771258569bd1762887c6b054c224301a6798 - Build
    libtool/2.4.7#08316dad5c72c541ed21e039e4cf217b:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    libxcrypt/4.4.36#4b4e8f20794f1997dd59eeed0b7cdcfb:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    lz4/1.9.4#1217a03c990b79aa34ed0faede18f534:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    m4/1.4.19#b38ced39a01e31fef5435bc634461fd2:3593751651824fb813502c69c971267624ced41a#cd8019a4f9b70880d548f7cc26569604 - Cache
    meson/1.4.0#024dfac41ea5570cb1aec3ea6fe34d0a:da39a3ee5e6b4b0d3255bfef95601890afd80709#91b870cdcf4edb1a302a2ef7a0514791 - Cache
    ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21:3593751651824fb813502c69c971267624ced41a#60e6fc0f973babfbed66a66af22a4f02 - Cache
    openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15:502f8d3964c9daa17dc3d33f8aea77ba87afe7c8 - Build
    pcre2/10.42#576680686b88a4dadf6d382d6d6351d9:76c95db7e12977a699163a3804ecb7084abcc1b2 - Build
    pkgconf/2.1.0#27f44583701117b571307cf5b5fe5605:c0b621fd4b3199fe05075171573398833dba85f4#74a82dec52448dda20253a19d65965c7 - Cache
    pkgconf/2.2.0#6462942a22803086372db44689ba825f:c0b621fd4b3199fe05075171573398833dba85f4#35e5163b1cf42becef616e6b7873202e - Cache
    protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73:4542f75c49be97c83728bba0f392fad58807ed00 - Build
    re2/20230301#e8d673155a0494f27c7589b611e8350d:d82d61b049c28e3ef95ee28911620ac73218b75e - Build
    xz_utils/5.4.5#51e5a6e6564f4ea3afd79def01f035ad:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    zlib/1.2.13#e377bee636333ae348d51ca90874e353:c81087b06d1a5beef0ad711fc32d45f7a425a8f3 - Build
    zstd/1.5.5#93372fe14bb7883bd4de82914e0a1841:ef043a2a516d05649c001063aa1b140e18f115d8 - Build
Skipped binaries
    meson/1.2.2

======== Installing packages ========
abseil/20230125.3: WARN: Trying to remove corrupted source folder
abseil/20230125.3: WARN: This can take a while for big packages
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

How to reproduce it

git clone https://github.com/conan-io/examples2.git
cd examples2/tutorial/consuming_packages/simple_cmake_project
echo "[requires]
zlib/1.2.11
google-cloud-cpp/2.19.0

[generators]
CMakeDeps
CMakeToolchain

[layout]
cmake_layout" > conanfile.txt
conan install conanfile.txt --build=missing
jcar87 commented 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

memsharded commented 4 months ago

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?

adamryczkowski commented 4 months ago

Interesting. Thank you for letting me know. Let me try on different machines on my end... Give me a few minutes.

adamryczkowski commented 4 months ago

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...

adamryczkowski commented 4 months ago

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
memsharded commented 4 months ago

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?

adamryczkowski commented 4 months ago

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)

czoido commented 4 months ago

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.

adamryczkowski commented 4 months ago

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
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
adamryczkowski commented 4 months ago

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]
czoido commented 4 months ago

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?

adamryczkowski commented 4 months ago

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:

ERROR: AuthenticationException: Deprecated authentication method. Create a Personal Access Token to access: https://github.com/settings/tokens

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.

memsharded commented 4 months ago

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.

memsharded commented 4 months ago

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!

adamryczkowski commented 4 months ago

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.

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.