Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oci.pull doesn't work for some images running on Debian on WSL2 #665

Open
KennyS opened this issue Aug 1, 2024 · 0 comments
Open

oci.pull doesn't work for some images running on Debian on WSL2 #665

KennyS opened this issue Aug 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@KennyS
Copy link

KennyS commented Aug 1, 2024

Versions tried:

bazel_dep(name = "rules_oci", version = "1.7.6")
bazel_dep(name = "rules_oci", version = "1.8.0")

Bazel version: 7.2.1

Issue:
I am trying to pull two images using Bazel on Debian running on WSL2. The distroless_cc image works, but the nginx image does not. A friend tested the same configuration on macOS and Linux with the same Bazel version, and it worked for him.

Definition:


oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
    name = "distroless_cc",
    digest = "sha256:f7fa4923556853754e9ff647df410d5711fc4d99a8dafa777ec617cf4a6700f6",
    image = "gcr.io/distroless/cc-debian11:nonroot",
    platforms = [
        "linux/amd64",
    ],
)
oci.pull(
    name = "nginx",
    digest = "sha256:6af79ae5de407283dcea8b00d5c37ace95441fd58a8b1d2aa1ed93f5511bb18c",
    image = "docker.io/library/nginx:1.27.0",
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "distroless_cc")
use_repo(oci, "nginx")

Error for bazel build @nginx:

INFO: Repository rules_oci~~oci~nginx_linux_amd64 instantiated at:
  <builtin>: in <toplevel>
Repository rule oci_pull defined at:
  /home/kshor/.cache/bazel/_bazel_kshor/9dbb2f1a485ec1872a1e9cfa8f1672c1/external/rules_oci~/oci/private/pull.bzl:281:27: in <toplevel>
ERROR: An error occurred during the fetch of repository 'rules_oci~~oci~nginx_linux_amd64':
   Traceback (most recent call last):
        File "/home/kshor/.cache/bazel/_bazel_kshor/9dbb2f1a485ec1872a1e9cfa8f1672c1/external/rules_oci~/oci/private/pull.bzl", line 256, column 29, in _oci_pull_impl
                downloader.download_blob(manifest["config"]["digest"], config_output_path)
        File "/home/kshor/.cache/bazel/_bazel_kshor/9dbb2f1a485ec1872a1e9cfa8f1672c1/external/rules_oci~/oci/private/pull.bzl", line 162, column 61, in lambda
                download_blob = lambda identifier, output: _download(rctx, authn, identifier, output, "blobs"),
        File "/home/kshor/.cache/bazel/_bazel_kshor/9dbb2f1a485ec1872a1e9cfa8f1672c1/external/rules_oci~/oci/private/pull.bzl", line 108, column 23, in _download
                return download_fn(
        File "/home/kshor/.cache/bazel/_bazel_kshor/9dbb2f1a485ec1872a1e9cfa8f1672c1/external/rules_oci~/oci/private/download.bzl", line 121, column 25, in _bazel_download
                return rctx.download(**kwargs)
Error in download: com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException: Checksum was e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 but wanted a72860cb95fd59e9c696c66441c64f18e66915fa26b249911e83c3854477ed9a
ERROR: no such package '@@rules_oci~~oci~nginx_linux_amd64//': com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException: Checksum was e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 but wanted a72860cb95fd59e9c696c66441c64f18e66915fa26b249911e83c3854477ed9a
ERROR: /home/kshor/.cache/bazel/_bazel_kshor/9dbb2f1a485ec1872a1e9cfa8f1672c1/external/rules_oci~~oci~nginx/BUILD.bazel:1:6: @@rules_oci~~oci~nginx//:nginx depends on @@rules_oci~~oci~nginx_linux_amd64//:nginx_linux_amd64 in repository @@rules_oci~~oci~nginx_linux_amd64 which failed to fetch. no such package '@@rules_oci~~oci~nginx_linux_amd64//': com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException: Checksum was e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 but wanted a72860cb95fd59e9c696c66441c64f18e66915fa26b249911e83c3854477ed9a

Any guidance on debugging this issue would be appreciated.

@thesayyn thesayyn added the bug Something isn't working label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants