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 Build Maven Fetch Error #3157

Closed
anandwana001 opened this issue May 4, 2021 · 7 comments · Fixed by #3168
Closed

Bazel Build Maven Fetch Error #3157

anandwana001 opened this issue May 4, 2021 · 7 comments · Fixed by #3168
Assignees
Labels
Priority: Important This work item is really important to complete for its milestone, but it can be scoped out. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@anandwana001
Copy link
Contributor

anandwana001 commented May 4, 2021

Describe the bug
Currently, Bazel build is causing error while fetching Maven dependencies on GitHub actions as well as on local Bazel build.

Expected behavior
Bazel build should fetch Maven dependencies without throwing any error.

Additional context

ERROR: /home/runner/work/oppia-android/oppia-android/third_party/BUILD.bazel:22:17: 
//third_party:javax_inject_javax_inject depends on @maven//:javax_inject_javax_inject in 
repository @maven which failed to fetch. no such package '@maven//': Error while fetching 
artifact with coursier: Exception in thread "main" java.lang.NumberFormatException: For input string: "intot"
ERROR: /home/runner/work/oppia-android/oppia-android/third_party/BUILD.bazel:22:17: 
//third_party:androidx_appcompat_appcompat depends on 
@maven//:androidx_appcompat_appcompat in repository @maven which failed to fetch. no such 
package '@maven//': Error while fetching artifact with coursier: Exception in thread "main" 
java.lang.NumberFormatException: For input string: "intot"

Digging deep

ERROR: An error occurred during the fetch of repository 'maven':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_akshaynandwana/0e0a7569f455d331a530cc35527abf40/external/rules_jvm_external/coursier.bzl", line 710, column 38, in _coursier_fetch_impl
                dep_tree = make_coursier_dep_tree(
        File "/private/var/tmp/_bazel_akshaynandwana/0e0a7569f455d331a530cc35527abf40/external/rules_jvm_external/coursier.bzl", line 649, column 13, in make_coursier_dep_tree
                fail("Error while fetching artifact with coursier: " + exec_result.stderr)
Error in fail: Error while fetching artifact with coursier: Exception in thread "main" java.lang.NumberFormatException: For input string: "intot"

/private/var/tmp/_bazel_akshaynandwana/0e0a7569f455d331a530cc35527abf40/external/rules_jvm_external/coursier.bzl

exec_result = repository_ctx.execute(
        cmd,
        timeout = timeout,
        environment = environment,
        quiet = not _is_verbose(repository_ctx))
    if (exec_result.return_code != 0):
        fail("Error while fetching artifact with coursier: " + exec_result.stderr)
@anandwana001
Copy link
Contributor Author

@fsharpasharp Are you also facing this issue?

@anandwana001 anandwana001 added the Priority: Important This work item is really important to complete for its milestone, but it can be scoped out. label May 4, 2021
@fsharpasharp
Copy link
Contributor

I am also facing this issue @anandwana001.

@BenHenning
Copy link
Sponsor Member

Given that Bazel mostly guarantees a deterministic build graph, my best initial guess is that something change on the Maven repo's side that's causing our maven_install rule to fail. Unfortunately, it seems that no one has reported this yet or I'm having difficulty tracking down an issue number for it.

@BenHenning
Copy link
Sponsor Member

Hmm still not sure why this is a new issue, but it appears to be a bug with Coursier (which rules_jvm uses underneath): #1972. Need to find a version of rules_jvm to upgrade to to get that fix.

@anandwana001
Copy link
Contributor Author

anandwana001 commented May 6, 2021

Right now, my bazel running on below, it might work.

"rules_jvm": {
        "sha": "f04b1466a00a2845106801e0c5cec96841f49ea4e7d1df88dc8e4bf31523df74",
        "version": "2.7",
    },
maven_install(
    artifacts = DAGGER_ARTIFACTS + get_maven_dependencies(),
    fetch_sources = True,
    repositories = DAGGER_REPOSITORIES + [
        "https://jcenter.bintray.com/",
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)

update
The above config, not giving me the fetch error. Trying on the original rules_jvm version, skipping "https://bintray.com/bintray/jcenter", and "https://maven.fabric.io/public", from maven_install repositories.

@BenHenning
Copy link
Sponsor Member

Hmm--I thought we needed jcenter for some of our dependencies per #2923. We should be also migrating Gradle off of jcenter to avoid disparity between the two (especially since some dependencies will need to be migrated to make this work).

@anandwana001
Copy link
Contributor Author

Bintray is no more a repository source in rules jvm - bazelbuild/rules_jvm_external#517

BenHenning pushed a commit that referenced this issue May 7, 2021
* bazel maven fix

* revert rules_jvm change
@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Important This work item is really important to complete for its milestone, but it can be scoped out. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Projects
3 participants