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

Bazel crashes fetching http_archive dependency #14682

Closed
mambon2 opened this issue Feb 1, 2022 · 9 comments
Closed

Bazel crashes fetching http_archive dependency #14682

mambon2 opened this issue Feb 1, 2022 · 9 comments
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Comments

@mambon2
Copy link

mambon2 commented Feb 1, 2022

Description of the problem / feature request:

Bazel build crashes fetching http_archive rules dependency if its not accessible. What the best way to protect against this?

Feature requests: what underlying problem are you trying to solve with this feature?

Perhaps cache the dependency in bazel cache?

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

This is only reproducible if an http_archive dependency goes away. it happened today intermittently for https://github.com/buchgr/rules_jmh/zipball/6ccf8d7b270083982e5c143935704b9f3f18b256

What operating system are you running Bazel on?

ubuntu 18.04.1

What's the output of bazel info release?

release 4.0.0

@Wyverald
Copy link
Member

Wyverald commented Feb 1, 2022

Can you provide the crash log please?

@Wyverald Wyverald added more data needed team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. labels Feb 1, 2022
@mambon2
Copy link
Author

mambon2 commented Feb 1, 2022

Can you provide the crash log please?

WARNING: Download from https://github.com/buchgr/rules_jmh/zipball/6ccf8d7b270083982e5c143935704b9f3f18b256 failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was f88fe443f17ae00bf759f4b5f2614dfc4bfddf9c558c2f3f470ffc51fcf96e85 but wanted dbb7d7e5ec6e932eddd41b910691231ffd7b428dff1ef9a24e4a9a59c1a1762d
11:39:29 ERROR: An error occurred during the fetch of repository 'rules_jmh':
11:39:29 Traceback (most recent call last):
11:39:29 File "/root/.cache/bazel/_bazel_root/fd19306aeb82431c50d8802f6a113c90/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
11:39:29 download_info = ctx.download_and_extract(
11:39:29 Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/buchgr/rules_jmh/zipball/6ccf8d7b270083982e5c143935704b9f3f18b256] to /root/.cache/bazel/_bazel_root/fd19306aeb82431c50d8802f6a113c90/external/rules_jmh/temp969063267732403804/6ccf8d7b270083982e5c143935704b9f3f18b256.zip: Checksum was f88fe443f17ae00bf759f4b5f2614dfc4bfddf9c558c2f3f470ffc51fcf96e85 but wanted dbb7d7e5ec6e932eddd41b910691231ffd7b428dff1ef9a24e4a9a59c1a1762d
11:39:29 ERROR: Error fetching repository: Traceback (most recent call last):
11:39:29 File "/root/.cache/bazel/_bazel_root/fd19306aeb82431c50d8802f6a113c90/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
11:39:29 download_info = ctx.download_and_extract(
11:39:29 Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/buchgr/rules_jmh/zipball/6ccf8d7b270083982e5c143935704b9f3f18b256] to /root/.cache/bazel/_bazel_root/fd19306aeb82431c50d8802f6a113c90/external/rules_jmh/temp969063267732403804/6ccf8d7b270083982e5c143935704b9f3f18b256.zip: Checksum was f88fe443f17ae00bf759f4b5f2614dfc4bfddf9c558c2f3f470ffc51fcf96e85 but wanted dbb7d7e5ec6e932eddd41b910691231ffd7b428dff1ef9a24e4a9a59c1a1762d
11:39:29 INFO: Repository rules_jvm_external instantiated at:
11:39:29 /home/jenkins/agent/workspace/FES_Package_Builder_master/beeswaxio/WORKSPACE:13:11: in
11:39:29 /home/jenkins/agent/workspace/FES_Package_Builder_master/beeswaxio/beeswax/bzl/workspace/rules_deps.bzl:31:17: in rules_deps
11:39:29 Repository rule http_archive defined at:
11:39:29 /root/.cache/bazel/_bazel_root/fd19306aeb82431c50d8802f6a113c90/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in
11:39:29 ERROR: no such package '@rules_jmh//': java.io.IOException: Error downloading [https://github.com/buchgr/rules_jmh/zipball/6ccf8d7b270083982e5c143935704b9f3f18b256] to /root/.cache/bazel/_bazel_root/fd19306aeb82431c50d8802f6a113c90/external/rules_jmh/temp969063267732403804/6ccf8d7b270083982e5c143935704b9f3f18b256.zip: Checksum was f88fe443f17ae00bf759f4b5f2614dfc4bfddf9c558c2f3f470ffc51fcf96e85 but wanted dbb7d7e5ec6e932eddd41b910691231ffd7b428dff1ef9a24e4a9a59c1a1762d
11:39:29 Loading: 0 packages loaded
11:39:29 Loading: 0 packages loaded

@mambon2
Copy link
Author

mambon2 commented Feb 1, 2022

and this is our rules_dependency

http_archive(
    name = "rules_jmh",
    sha256 = "dbb7d7e5ec6e932eddd41b910691231ffd7b428dff1ef9a24e4a9a59c1a1762d",
    strip_prefix = "buchgr-rules_jmh-6ccf8d7",
    type = "zip",
    url = "https://github.com/buchgr/rules_jmh/zipball/6ccf8d7b270083982e5c143935704b9f3f18b256",
)

@Wyverald
Copy link
Member

Wyverald commented Feb 1, 2022

This is not a crash. It's simply saying there was a checksum mismatch:

11:39:29 Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/buchgr/rules_jmh/zipball/6ccf8d7b270083982e5c143935704b9f3f18b256] to /root/.cache/bazel/_bazel_root/fd19306aeb82431c50d8802f6a113c90/external/rules_jmh/temp969063267732403804/6ccf8d7b270083982e5c143935704b9f3f18b256.zip: Checksum was f88fe443f17ae00bf759f4b5f2614dfc4bfddf9c558c2f3f470ffc51fcf96e85 but wanted dbb7d7e5ec6e932eddd41b910691231ffd7b428dff1ef9a24e4a9a59c1a1762d

See relevant discussion at bazel-contrib/SIG-rules-authors#11 (comment)

@mambon2
Copy link
Author

mambon2 commented Feb 1, 2022

thank you. I don't see any activity on this project https://github.com/buchgr/rules_jmh
so its possible it was not accessible?

@Wyverald
Copy link
Member

Wyverald commented Feb 1, 2022

GitHub had a temporary change today that caused all non-stable archives to have different checksums. The error log you provided indicates that the download was successful, but the checksum was different. (Whether a project is active or not has no bearing on the accessibility of its archives.)

In any case, this isn't a Bazel bug. Please go to e.g. slack.bazel.build to discuss this.

@mambon2
Copy link
Author

mambon2 commented Feb 1, 2022

My google account does not end with google.com. Can you send me an invite [email protected] ?

@mambon2
Copy link
Author

mambon2 commented Feb 1, 2022

I realize its not a bazel bug. I'm asking if bazel provides a way to guard against this? and what makes this a non-stable archive?

@Wyverald
Copy link
Member

Wyverald commented Feb 2, 2022

Bazel cannot guard against this, since you can point http_archive at anything and that thing can become unavailable. According to bazel-contrib/SIG-rules-authors#11 (comment), archives in releases are stable, while others are potentially not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

No branches or pull requests

2 participants