Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Bazel builds started failing due to checksum error #681

Open
SGudbrandsson opened this issue Feb 1, 2022 · 10 comments
Open

Bazel builds started failing due to checksum error #681

SGudbrandsson opened this issue Feb 1, 2022 · 10 comments

Comments

@SGudbrandsson
Copy link

Bazel builds are now failing due to a failed checksum error.
This started happening this morning.

sha256 = "e9df8412ddabc9c21b4437ee138875b95ebb32c25f07f962439e16005152e00e",

Anyone else experiencing this?

WARNING: Download from https://github.com/yaml/pyyaml/archive/5.1.2.zip failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was ba59d7e97eb131d8f8f52d19cb124bb67772f4c7f4d14cb2919deb885ef8c572 but wanted e9df8412ddabc9c21b4437ee138875b95ebb32c25f07f962439e16005152e00e
ERROR: An error occurred during the fetch of repository 'com_github_yaml_pyyaml':
   java.io.IOException: Error downloading [https://github.com/yaml/pyyaml/archive/5.1.2.zip] to /home/sigurdur/.cache/bazel/_bazel_sigurdur/71ecaec01697b935e8cbde2c3c9da6e5/external/com_github_yaml_pyyaml/5.1.2.zip: Checksum was ba59d7e97eb131d8f8f52d19cb124bb67772f4c7f4d14cb2919deb885ef8c572 but wanted e9df8412ddabc9c21b4437ee138875b95ebb32c25f07f962439e16005152e00e
ERROR: Evaluation of query "filter('\.apply', attr('tags', 'upload-assets', attr('tags', 'dev', allrdeps(set()))))" failed due to BUILD file errors
@SGudbrandsson SGudbrandsson changed the title Bazel builds started failing due to Bazel builds started failing due to checksum error Feb 1, 2022
@jarimayenburg
Copy link

Yup, same thing here

@jarimayenburg
Copy link

jarimayenburg commented Feb 1, 2022

Might be onto something here.

bazelbuild/rules_k8s uses the URL https://github.com/yaml/pyyaml/archive/5.1.2.zip, expecting checksum e9df8412ddabc9c21b4437ee138875b95ebb32c25f07f962439e16005152e00e while the file has checksum ba59d7e97eb131d8f8f52d19cb124bb67772f4c7f4d14cb2919deb885ef8c572

However, using URL https://github.com/yaml/pyyaml/archive/refs/tags/5.1.2.zip still yields checksum e9df8412ddabc9c21b4437ee138875b95ebb32c25f07f962439e16005152e00e.

The extracted files from both archives yield the same checksum, so I guess if we use URL https://github.com/yaml/pyyaml/archive/refs/tags/5.1.2.zip the problem should be fixed. Or we can change the checksum to ba59d7e97eb131d8f8f52d19cb124bb67772f4c7f4d14cb2919deb885ef8c572.

Also, shouldn't we use PyYAML 5.4 in this rule anyway? Since there's an approved PR for the requirements.txt upgrade (#676)

@rajatvig
Copy link

rajatvig commented Feb 1, 2022

Keep going back and forth on it but #683 updates the SHA for pyyaml

@luna-duclos
Copy link

Also seeing this issue, its failing most of our builds, we're using the following patch as (very temporary) mitigation:

From 383338ca3cb4b94deed34d18ff8237ab53cd28bf Mon Sep 17 00:00:00 2001
From: Luna Duclos <luna.duclos@embark-studios.com>
Date: Tue, 1 Feb 2022 16:28:37 +0100
Subject: [PATCH] Use stable URL for pyyaml download

---
 k8s/k8s.bzl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git k8s/k8s.bzl k8s/k8s.bzl
index ad3268d..2fe510b 100644
--- k8s/k8s.bzl
+++ k8s/k8s.bzl
@@ -49,7 +49,7 @@ py_library(
 """,
             sha256 = "e9df8412ddabc9c21b4437ee138875b95ebb32c25f07f962439e16005152e00e",
             strip_prefix = "pyyaml-5.1.2",
-            urls = ["https://github.com/yaml/pyyaml/archive/5.1.2.zip"],
+            urls = ["https://github.com/yaml/pyyaml/archive/refs/tags/5.1.2.zip"],
         )
 
     # Register the default kubectl toolchain targets for supported platforms
-- 
2.30.0.windows.2

@marmeladema
Copy link

Yes https://github.com/yaml/pyyaml/archive/5.1.2.zip is now redirecting to https://codeload.github.com/yaml/pyyaml/zip/5.1.2 and I believe the new hash is of the HTML page for the redirection:

<html><body>You are being <a href="https://codeload.github.com/yaml/pyyaml/zip/5.1.2">redirected</a>.</body></html>

@rajatvig
Copy link

rajatvig commented Feb 1, 2022

Yes https://github.com/yaml/pyyaml/archive/5.1.2.zip is now redirecting to https://codeload.github.com/yaml/pyyaml/zip/5.1.2 and I believe the new hash is of the HTML page for the redirection:

<html><body>You are being <a href="https://codeload.github.com/yaml/pyyaml/zip/5.1.2">redirected</a>.</body></html>

The hash for the archive is ba59d7e97eb131d8f8f52d19cb124bb67772f4c7f4d14cb2919deb885ef8c572 when the redirects are followed.

@bduffany
Copy link

bduffany commented Feb 1, 2022

This is possibly related: https://twitter.com/shs96c/status/1488480089700503558

@brentleyjones
Copy link

Locally this is now fixed for us.

@rajatvig
Copy link

rajatvig commented Feb 1, 2022

Seems that way. https://twitter.com/tgummerer/status/1488493440103030787?s=20&t=DaupVstH5BiSJd0BgLSa_Q suggests they applied a fix.

@moriarty
Copy link

moriarty commented Feb 2, 2022

Linking this to an upstream discussion: bazel-contrib/SIG-rules-authors#11 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants