Created attachment 824901 [details] emerge --info, 2 outputs with and without 'force-mirror' feature When I use 'force-mirror' feature (ie. FEATURES='force-mirror' in make.conf), the url that emerge uses to wget some (or all?) crates from the mirror(s) is different(wrong, gives 404) than when not using 'force-mirror' ! With 'force-mirror', it tries this and it's a 404 not found: https://distfiles.gentoo.org/distfiles/discard-1.0.4.crate Without 'force-mirror', it tries the following and it's correct (found): https://distfiles.gentoo.org/distfiles/86/discard-1.0.4.crate also: With 'force-mirror', you may notice something new(compared to without): Warning: No mirrors available for file '.layout.conf.distfiles.gentoo.org' But without 'force-mirror' it downloads that layout just fine: >>> Downloading 'https://distfiles.gentoo.org/distfiles/layout.conf' --2022-10-21 01:39:16-- https://distfiles.gentoo.org/distfiles/layout.conf Connecting to distfiles.gentoo.org|156.146.33.18|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 45 [text/plain] Saving to: '/var/cache/distfiles/.layout.conf.distfiles.gentoo.org' 100%[================================================================================>] 45 --.-KB/s in 0s 2022-10-21 01:39:16 (17.2 MB/s) - '/var/cache/distfiles/.layout.conf.distfiles.gentoo.org' saved [45/45] I'm not sure whether or not this layout being gotten(or not) influences the correctness of the path (eg. for `discard-1.0.4.crate`). (it seems I'm limited to attaching only one file, but I need to attach 3, yet the attach message says `(without tar)`)
Ok, now I can confirm that the layout file not being gotten at all ever(due to 'force-mirror' being used), is the reason why the wget url is wrong. Once the layout is gotten once, it's cached in .mirror-cache.json # cat /var/cache/distfiles/.layout.conf.distfiles.gentoo.org [structure] 0=filename-hash BLAKE2B 8 1=flat # mv /var/cache/distfiles/.layout.conf.distfiles.gentoo.org /tmp # mv /var/cache/distfiles/.mirror-cache.json /tmp # rm /var/cache/distfiles/discard-1.0.4.crate # FEATURES="force-mirror" GENTOO_MIRRORS='https://distfiles.gentoo.org' emerge -1v librsvg --fetchonly --ask=n ...snip... * difflib-0.4.0.crate BLAKE2B SHA512 size ;-) ... [ ok ] Warning: No mirrors available for file '.layout.conf.distfiles.gentoo.org' >>> Downloading 'https://distfiles.gentoo.org/distfiles/discard-1.0.4.crate' --2022-10-21 02:35:13-- https://distfiles.gentoo.org/distfiles/discard-1.0.4.crate Resolving distfiles.gentoo.org... wget: !! FUNCTION_NAME == 'gethostbyname' hostname='distfiles.gentoo.org' wget: !! REENTRANT_NAME == 'gethostbyname_r' hostname='distfiles.gentoo.org' 212.102.56.179, 195.181.170.19, 212.102.56.143, ... Connecting to distfiles.gentoo.org|212.102.56.179|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2022-10-21 02:35:13 ERROR 404: Not Found. !!! Couldn't download 'discard-1.0.4.crate'. Aborting. * doc-comment-0.3.3.crate BLAKE2B SHA512 size ;-) ... ...snip... * yeslogic-fontconfig-sys-2.11.2.crate BLAKE2B SHA512 size ;-) ... [ ok ] * Fetch failed for 'gnome-base/librsvg-2.55.1'
Well, I'm happily using the following workaround, since I want FEATURES='force-mirror': ```patch Index: /var/tmp/portage/sys-apps/portage-3.0.38.1/work/portage-3.0.38.1/lib/portage/package/ebuild/fetch.py =================================================================== --- .orig/var/tmp/portage/sys-apps/portage-3.0.38.1/work/portage-3.0.38.1/lib/portage/package/ebuild/fetch.py +++ /var/tmp/portage/sys-apps/portage-3.0.38.1/work/portage-3.0.38.1/lib/portage/package/ebuild/fetch.py @@ -1094,9 +1094,10 @@ def fetch( writemsg(_("Invalid mirror definition in SRC_URI:\n"), noiselevel=-1) writemsg(" %s\n" % (myuri), noiselevel=-1) else: - if (restrict_fetch and not override_fetch) or force_mirror: - # Only fetch from specific mirrors is allowed. - continue + if myfile[:13] != '.layout.conf.': + if (restrict_fetch and not override_fetch) or force_mirror: + # Only fetch from specific mirrors is allowed. + continue primaryuris = primaryuri_dict.get(myfile) if primaryuris is None: primaryuris = [] ```
tl;dr: probably irrelevant to this issue, but still, this happened just now. While using the patch from Comment 2, for some reason 2 mirrors had a different file and the third one had the correct file. The difference seems to be that one file included more inner files like the examples dir and termcolor.hpp header, and also the date/time of inner files is different, year 2021 vs 2020. >> Fetching (11 of 11) dev-python/termcolor-2.1.0::gentoo >>> Downloading 'https://ftp.belnet.be/pub/rsync.gentoo.org/gentoo/distfiles/9f/termcolor-2.1.0.tar.gz' --2022-10-30 22:14:51-- https://ftp.belnet.be/pub/rsync.gentoo.org/gentoo/distfiles/9f/termcolor-2.1.0.tar.gz Resolving ftp.belnet.be... wget: !! FUNCTION_NAME == 'gethostbyname' hostname='ftp.belnet.be' wget: !! REENTRANT_NAME == 'gethostbyname_r' hostname='ftp.belnet.be' 193.190.198.27 Connecting to ftp.belnet.be|193.190.198.27|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 89041 (87K) [application/octet-stream] Saving to: '/var/cache/distfiles/termcolor-2.1.0.tar.gz' /var/cache/distfiles/termcolo 100%[=================================================>] 86.95K --.-KB/s in 0.03s 2022-10-30 22:14:51 (2.44 MB/s) - '/var/cache/distfiles/termcolor-2.1.0.tar.gz' saved [89041/89041] !!! Fetched file: termcolor-2.1.0.tar.gz VERIFY FAILED! !!! Reason: Filesize does not match recorded size !!! Got: 89041 !!! Expected: 10665 !!! lefetch: 'https://mirror.init7.net/gentoo/distfiles/layout.conf' -> '.layout.conf.mirror.init7.net' >>> Downloading 'https://mirror.init7.net/gentoo/distfiles/layout.conf' --2022-10-30 22:14:51-- https://mirror.init7.net/gentoo/distfiles/layout.conf Resolving mirror.init7.net... wget: !! FUNCTION_NAME == 'gethostbyname' hostname='mirror.init7.net' wget: !! REENTRANT_NAME == 'gethostbyname_r' hostname='mirror.init7.net' 109.202.202.202 Connecting to mirror.init7.net|109.202.202.202|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 45 [application/octet-stream] Saving to: '/var/cache/distfiles/.layout.conf.mirror.init7.net' /var/cache/distfiles/.layout. 100%[=================================================>] 45 --.-KB/s in 0s 2022-10-30 22:14:51 (16.9 MB/s) - '/var/cache/distfiles/.layout.conf.mirror.init7.net' saved [45/45] >>> Downloading 'https://mirror.init7.net/gentoo/distfiles/9f/termcolor-2.1.0.tar.gz' --2022-10-30 22:14:51-- https://mirror.init7.net/gentoo/distfiles/9f/termcolor-2.1.0.tar.gz Resolving mirror.init7.net... wget: !! FUNCTION_NAME == 'gethostbyname' hostname='mirror.init7.net' wget: !! REENTRANT_NAME == 'gethostbyname_r' hostname='mirror.init7.net' 109.202.202.202 Connecting to mirror.init7.net|109.202.202.202|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 89041 (87K) [application/octet-stream] Saving to: '/var/cache/distfiles/termcolor-2.1.0.tar.gz' /var/cache/distfiles/termcolo 100%[=================================================>] 86.95K --.-KB/s in 0.03s 2022-10-30 22:14:51 (2.96 MB/s) - '/var/cache/distfiles/termcolor-2.1.0.tar.gz' saved [89041/89041] !!! Fetched file: termcolor-2.1.0.tar.gz VERIFY FAILED! !!! Reason: Filesize does not match recorded size !!! Got: 89041 !!! Expected: 10665 >>> Downloading 'https://files.pythonhosted.org/packages/source/t/termcolor/termcolor-2.1.0.tar.gz' --2022-10-30 22:14:51-- https://files.pythonhosted.org/packages/source/t/termcolor/termcolor-2.1.0.tar.gz Resolving files.pythonhosted.org... wget: !! FUNCTION_NAME == 'gethostbyname' hostname='files.pythonhosted.org' wget: !! REENTRANT_NAME == 'gethostbyname_r' hostname='files.pythonhosted.org' 199.232.17.63 Connecting to files.pythonhosted.org|199.232.17.63|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://files.pythonhosted.org/packages/62/1a/e78a930f70dd576f2a7250a98263ac973a80d6f1a395d89328844881a0c0/termcolor-2.1.0.tar.gz [following] --2022-10-30 22:14:52-- https://files.pythonhosted.org/packages/62/1a/e78a930f70dd576f2a7250a98263ac973a80d6f1a395d89328844881a0c0/termcolor-2.1.0.tar.gz Reusing existing connection to files.pythonhosted.org:443. HTTP request sent, awaiting response... 200 OK Length: 10665 (10K) [application/x-tar] Saving to: '/var/cache/distfiles/termcolor-2.1.0.tar.gz' /var/cache/distfiles/termcolo 100%[=================================================>] 10.42K --.-KB/s in 0.001s 2022-10-30 22:14:52 (14.0 MB/s) - '/var/cache/distfiles/termcolor-2.1.0.tar.gz' saved [10665/10665] * termcolor-2.1.0.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ] ------ The bad mirrors have these two urls be the same file(contents checked to match, between mirrors too): https://ftp.belnet.be/pub/rsync.gentoo.org/gentoo/distfiles/9f/termcolor-2.1.0.tar.gz https://ftp.belnet.be/pub/rsync.gentoo.org/gentoo/distfiles/termcolor-2.1.0.tar.gz https://mirror.init7.net/gentoo/distfiles/termcolor-2.1.0.tar.gz https://mirror.init7.net/gentoo/distfiles/9f/termcolor-2.1.0.tar.gz So, I guess, unless I'm missing something, those mirrors serve different termcolor-2.1.0.tar.gz which appear to be newer based simply on the date of the files inside, but unacceptable by the checksums. sha512 of the bad: 668853a93e1208a08a4ea9ac8db2d9c615cefd0325c35402b767e0b1bf373589507b8eb7685babd5801c1e4f2533db6f4eabfedde365737a4c7c069f00f536d8 termcolor-2.1.0.tar.gz /tmp/bad/2/termcolor-2.1.0.tar.gz 3311/3311 100% drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/ drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/.github/ drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/.github/workflows/ -rw-rw-r-- root/root 1287 2021-12-14 00:24 termcolor-2.1.0/.github/workflows/cmake.yml -rw-rw-r-- root/root 535 2021-12-14 00:24 termcolor-2.1.0/.github/workflows/macos.yml -rw-rw-r-- root/root 1097 2021-12-14 00:24 termcolor-2.1.0/.github/workflows/ubuntu.yml -rw-rw-r-- root/root 549 2021-12-14 00:24 termcolor-2.1.0/.github/workflows/windows.yml -rw-rw-r-- root/root 23 2021-12-14 00:24 termcolor-2.1.0/.gitignore -rw-rw-r-- root/root 59 2021-12-14 00:24 termcolor-2.1.0/.mailmap -rw-rw-r-- root/root 1418 2021-12-14 00:24 termcolor-2.1.0/CMakeLists.txt -rw-rw-r-- root/root 1531 2021-12-14 00:24 termcolor-2.1.0/LICENSE -rw-rw-r-- root/root 6488 2021-12-14 00:24 termcolor-2.1.0/README.rst drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/cmake/ -rw-rw-r-- root/root 138 2021-12-14 00:24 termcolor-2.1.0/cmake/config.cmake.in drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/docs/ drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/docs/_static/ -rw-rw-r-- root/root 81639 2021-12-14 00:24 termcolor-2.1.0/docs/_static/example.png -rw-rw-r-- root/root 883 2021-12-14 00:24 termcolor-2.1.0/docs/conf.py -rw-rw-r-- root/root 242 2021-12-14 00:24 termcolor-2.1.0/docs/index.rst drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/examples/ drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-external/ -rw-rw-r-- root/root 732 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-external/CMakeLists.txt -rw-rw-r-- root/root 291 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-external/example.cpp drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-fetch/ -rw-rw-r-- root/root 503 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-fetch/CMakeLists.txt -rw-rw-r-- root/root 291 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-fetch/example.cpp drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-package/ -rw-rw-r-- root/root 212 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-package/CMakeLists.txt -rw-rw-r-- root/root 291 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-package/example.cpp drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-submodule/ -rw-rw-r-- root/root 258 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-submodule/CMakeLists.txt -rw-rw-r-- root/root 291 2021-12-14 00:24 termcolor-2.1.0/examples/cmake-submodule/example.cpp drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/include/ drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/include/termcolor/ -rw-rw-r-- root/root 29464 2021-12-14 00:24 termcolor-2.1.0/include/termcolor/termcolor.hpp drwxrwxr-x root/root 0 2021-12-14 00:24 termcolor-2.1.0/test/ -rw-rw-r-- root/root 185 2021-12-14 00:24 termcolor-2.1.0/test/subtest.cpp -rw-rw-r-- root/root 112 2021-12-14 00:24 termcolor-2.1.0/test/subtest.hpp -rw-rw-r-- root/root 7183 2021-12-14 00:24 termcolor-2.1.0/test/test.cpp sha512 of the good: 9dd1b8f1d137fc66d77f26913297a6c82eb25b3fd7ae1c5e639cd023eff02f155363ed5b731ff36bcb4281b7678d8e508fb8430ae0f89fa02b9c219e03f99e8f termcolor-2.1.0.tar.gz /tmp/good/termcolor-2.1.0.tar.gz 2273/2273 100% -rw-r--r-- 0/0 264 2020-02-02 01:00 termcolor-2.1.0/.coveragerc -rw-r--r-- 0/0 313 2020-02-02 01:00 termcolor-2.1.0/.editorconfig -rw-r--r-- 0/0 30 2020-02-02 01:00 termcolor-2.1.0/.flake8 -rw-r--r-- 0/0 1663 2020-02-02 01:00 termcolor-2.1.0/.pre-commit-config.yaml -rw-r--r-- 0/0 561 2020-02-02 01:00 termcolor-2.1.0/CHANGES.md -rw-r--r-- 0/0 891 2020-02-02 01:00 termcolor-2.1.0/RELEASING.md -rw-r--r-- 0/0 401 2020-02-02 01:00 termcolor-2.1.0/tox.ini -rw-r--r-- 0/0 42 2020-02-02 01:00 termcolor-2.1.0/.github/FUNDING.yml -rw-r--r-- 0/0 190 2020-02-02 01:00 termcolor-2.1.0/.github/SECURITY.md -rw-r--r-- 0/0 1823 2020-02-02 01:00 termcolor-2.1.0/.github/labels.yml -rw-r--r-- 0/0 805 2020-02-02 01:00 termcolor-2.1.0/.github/release-drafter.yml -rw-r--r-- 0/0 350 2020-02-02 01:00 termcolor-2.1.0/.github/renovate.json -rw-r--r-- 0/0 1199 2020-02-02 01:00 termcolor-2.1.0/.github/workflows/deploy.yml -rw-r--r-- 0/0 352 2020-02-02 01:00 termcolor-2.1.0/.github/workflows/labels.yml -rw-r--r-- 0/0 267 2020-02-02 01:00 termcolor-2.1.0/.github/workflows/lint.yml -rw-r--r-- 0/0 459 2020-02-02 01:00 termcolor-2.1.0/.github/workflows/release-drafter.yml -rw-r--r-- 0/0 452 2020-02-02 01:00 termcolor-2.1.0/.github/workflows/require-pr-label.yml -rw-r--r-- 0/0 1153 2020-02-02 01:00 termcolor-2.1.0/.github/workflows/test.yml -rw-r--r-- 0/0 282 2020-02-02 01:00 termcolor-2.1.0/src/termcolor/__init__.py -rw-r--r-- 0/0 0 2020-02-02 01:00 termcolor-2.1.0/src/termcolor/py.typed -rw-r--r-- 0/0 6101 2020-02-02 01:00 termcolor-2.1.0/src/termcolor/termcolor.py -rw-r--r-- 0/0 5894 2020-02-02 01:00 termcolor-2.1.0/tests/test_termcolor.py -rw-r--r-- 0/0 2035 2020-02-02 01:00 termcolor-2.1.0/.gitignore -rw-r--r-- 0/0 1072 2020-02-02 01:00 termcolor-2.1.0/COPYING.txt -rw-r--r-- 0/0 2770 2020-02-02 01:00 termcolor-2.1.0/README.md -rw-r--r-- 0/0 1703 2020-02-02 01:00 termcolor-2.1.0/pyproject.toml -rw-r--r-- 0/0 4253 2020-02-02 01:00 termcolor-2.1.0/PKG-INFO
(In reply to Emanuel Czirai from comment #3) > tl;dr: probably irrelevant to this issue, but still, this happened just now. It is indeed irrelevant and already fixed. commit 335eddbcf0b42a5117c4d4ba11053ad255d65d1f Author: Arthur Zamarin <arthurzam@gentoo.org> Date: Sun Oct 30 22:38:40 2022 +0200 dev-python/termcolor: rename distfile to avoid collision It has collision with dev-cpp/termcolor, so rename the distfile. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=542222ac998b655bcea7e491465e7df7f5e74591 commit 542222ac998b655bcea7e491465e7df7f5e74591 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-09-16 16:43:33 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-09-16 17:05:51 +0000 fetch: ignore force-mirror feature when try_mirrors is false When fetching layout.conf, we call fetch(try_mirrors=False) to force direct use of the primary URI being passed and ignore mirrors. The force-mirror feature causes fetch to ignore the primary URI. Ignoring both the primary URI and mirrors leads to an unfetchable file. Give precedence to the try_mirrors parameter since we really only set it to False when fetching layout.conf from a mirror. Bug: https://bugs.gentoo.org/877793 Signed-off-by: Mike Gilbert <floppym@gentoo.org> NEWS | 2 ++ lib/portage/package/ebuild/fetch.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f9211a35abef13079f93a96f57f3a96083c69a7 commit 9f9211a35abef13079f93a96f57f3a96083c69a7 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-10-03 15:38:28 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-10-03 15:38:41 +0000 sys-apps/portage: add 3.0.52 Closes: https://bugs.gentoo.org/704866 Closes: https://bugs.gentoo.org/877793 Closes: https://bugs.gentoo.org/889300 Closes: https://bugs.gentoo.org/900224 Closes: https://bugs.gentoo.org/912676 Closes: https://bugs.gentoo.org/912808 Closes: https://bugs.gentoo.org/913070 Closes: https://bugs.gentoo.org/913103 Closes: https://bugs.gentoo.org/914159 Closes: https://bugs.gentoo.org/915054 Closes: https://bugs.gentoo.org/915119 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.52.ebuild | 235 +++++++++++++++++++++++++++++++++ 2 files changed, 236 insertions(+)