Skip to content

Error when accessing private indexes in 2.0 #3826

@dougthor42

Description

@dougthor42

🐞 bug report

Affected Rule

gazelle_python_manifest

Is this a regression?

Yes, 1.9.0 was working

Description

Google Artifact Registry ("GAR") does not, to my knowledge, have a way to enable the un-scoped directory listing defined by PEP 503. Gemini says this is an intentional design decision. /shrug.

Anyway, what that means is that trying to GET the /simple (or /simple/) endpoint - added in #3657 - fails with 404.

$ curl --fail-with-body -s -L --header "Authorization: Bearer $(gcloud auth print-access-token)" https://us-west2-python.pkg.dev/GCS-PROJECT/GAR-NAME/simple

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    ...
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>  <ins>That’s all we know.</ins>

🔬 Minimal Reproduction

  1. Make a GAR
  2. Add it as an index
  3. Try to pull from it.

🔥 Exception or Error

$ bazel run //tools/bazel/gazelle:gazelle_python_manifest.update
INFO: Invocation ID: 948bae7b-027c-4f2b-8973-64b37b86d35b
WARNING: /usr/local/google/home/dthor/dev/pyle3/MODULE.bazel:2:7: The attribute 'compatibility_level' in module() is a no-op and will be removed in a future Bazel release. Please remove it from your MODULE.bazel file.
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.8.2, but got bazel_skylib@1.9.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'aspect_bazel_lib', the root module requires module version aspect_bazel_lib@2.19.3, but got aspect_bazel_lib@2.21.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'tar.bzl', the root module requires module version tar.bzl@0.7.0, but got tar.bzl@0.10.4 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'bazel_gazelle', the root module requires module version gazelle@0.47.0, but got gazelle@0.51.3 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_java', the root module requires module version rules_java@8.14.0, but got rules_java@8.16.1 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'platforms', the root module requires module version platforms@1.0.0, but got platforms@1.1.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: Remote Cache: NOT_FOUND: Unable to download blob from any provided URI: HTTP request failed with status "404 Not Found" (retrieving cached blob failed with: rpc error: code = NotFound desc = could not get action from action cache: Action result with digest "65a8ca5ff68e3b7e62969ea3ef6a013929ace1660b288e6da6eba9d26b376010/170" not found)
WARNING: Download from https://oauth2accesstoken@us-python.pkg.dev/artifact-foundry-prod/standard-python-3p-l3/simple/ failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Remote Cache: NOT_FOUND: Unable to download blob from any provided URI: HTTP request failed with status "404 Not Found" (retrieving cached blob failed with: rpc error: code = NotFound desc = could not get action from action cache: Action result with digest "2c4dcf60806de2f6d23423b41275575b249a924fbf026a3e933dc0b9052720f3/169" not found)
WARNING: Download from https://oauth2accesstoken@us-west2-python.pkg.dev/GCS-PROEJCT/GAR-NAME/simple/ failed: class java.io.FileNotFoundException GET returned 404 Not Found
ERROR: /usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/simpleapi_download.bzl:260:39: Traceback (most recent call last):
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/extension.bzl", line 378, column 25, in _pip_impl
                mods = parse_modules(
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/extension.bzl", line 267, column 30, in parse_modules
                builder.pip_parse(
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/hub_builder.bzl", line 60, column 47, in lambda
                pip_parse = lambda *a, **k: _pip_parse(self, *a, **k),
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/hub_builder.bzl", line 193, column 22, in _pip_parse
                _create_whl_repos(
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/hub_builder.bzl", line 542, column 50, in _create_whl_repos
                requirements_by_platform = parse_requirements(
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/parse_requirements.bzl", line 212, column 36, in parse_requirements
                index_urls = get_index_urls(
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/hub_builder.bzl", line 381, column 144, in lambda
                self._get_index_urls[python_version] = lambda ctx, distributions, *, index_url = None, extra_index_urls = None: self._simpleapi_download_fn(
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/simpleapi_download.bzl", line 91, column 31, in simpleapi_download
                dist_urls = _get_dist_urls(
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/simpleapi_download.bzl", line 170, column 43, in _get_dist_urls
                results[index_url] = download.wait()
        File "/usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/external/rules_python+/python/private/pypi/simpleapi_download.bzl", line 260, column 39, in lambda
                result = download.wait(),
Error in wait: java.io.IOException: Error downloading [https://oauth2accesstoken@us-west2-python.pkg.dev/GCS-PROJECT/GAR-NAME/simple/] to /usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/modextwd/rules_python++pip/https___oauth2accesstoken@us_west2_python_pkg_dev_GCS_PROJECT_GAR_NAME_simple.html: GET returned 404 Not Found
ERROR: error evaluating module extension @@rules_python+//python/extensions:pip.bzl%pip
INFO: Elapsed time: 115.278s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED: 
    Fetching module extension @@rules_python+//python/extensions:pip.bzl%pip; Fetch package lists from PyPI index 114s

🌍 Your Environment

Operating System:

gLinux

Output of bazel version:

$ bazel version
Bazelisk version: v1.26.0
Build label: 8.7.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Wed May 06 18:59:43 2026 (1778093983)
Build timestamp: 1778093983
Build timestamp as int: 1778093983

Rules_python version:

Running from a git checkout of commit e7d1378 (tag 2.0.3)

Anything else relevant?

I think you asked me to review things before 2.0 came out and I never did. Sorry! 😭

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions