Skip to content

Intermittent Maven build errors - Could not resolve dependencies / Could not transfer artifact #6231

Closed

Description

@devinbost

We're occasionally getting build errors that look like this:

[ERROR] Failed to execute goal on project buildtools: Could not resolve dependencies for project org.apache.pulsar:buildtools:jar:2.6.0-SNAPSHOT: Could not transfer artifact org.apache-extras.beanshell:bsh:jar:2.0b6 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache-extras/beanshell/bsh/2.0b6/bsh-2.0b6.jar 503 between bytes timeout -> [Help 1]

[ERROR] Failed to execute goal on project pulsar-presto-distribution: Could not resolve dependencies for project org.apache.pulsar:pulsar-presto-distribution:jar:2.6.0-SNAPSHOT: Could not transfer artifact org.eclipse.jetty:jetty-io:jar:9.4.11.v20180605 from/to central (https://repo.maven.apache.org/maven2): Failed to transfer file https://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-io/9.4.11.v20180605/jetty-io-9.4.11.v20180605.jar with status code 500 -> [Help 1]

Here's a third case (with an image of where it appeared):

image

Activity

  1. added
    type/feature
    on Feb 5, 2020
  2. changed the title [-]Intermittent Maven build errors - Could not resolve dependencies[/-] [+]Intermittent Maven build errors - Could not resolve dependencies / Could not transfer artifact[/+] on Feb 5, 2020
  3. devinbost commented on Feb 5, 2020

    @devinbost
    ContributorAuthor

    I wasn't sure if this should have been labeled as a bug or not since it's just showing up in the build tests.

  4. aahmed-se commented on Feb 5, 2020

    @aahmed-se
    Contributor

    @devinbost wha's your maven version ?

  5. devinbost commented on Feb 5, 2020

    @devinbost
    ContributorAuthor
    OCPC-LM31977:pulsar dbost$ mvn --version
    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: /Users/dbost/src/apache-maven-3.6.3
    Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
    
  6. devinbost commented on Feb 5, 2020

    @devinbost
    ContributorAuthor
  7. aahmed-se commented on Feb 5, 2020

    @aahmed-se
    Contributor

    Try with should be using 3.6.1, believe versions after that have issues

  8. devinbost commented on Feb 5, 2020

    @devinbost
    ContributorAuthor

    @aahmed-se Thanks for the information. This was also happening in Github CI though. Is there a place where the Maven version is set for building the project in the Github CI Actions?

  9. aahmed-se commented on Feb 5, 2020

    @aahmed-se
    Contributor

    where is github ci do you see this ?

  10. aahmed-se commented on Feb 5, 2020

    @aahmed-se
    Contributor

    Here is the example for setting up maven to a specific vesion

    - name: Set up Maven

    The error in your link is not related that's just a repo timeout.

  11. devinbost commented on Feb 7, 2020

    @devinbost
    ContributorAuthor

    @aahmed-se How do we fix the repo timeout? I got it again...
    [ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.0.1:add-source (default) on project flink: Execution default of goal net.alchim31.maven:scala-maven-plugin:4.0.1:add-source failed: Plugin net.alchim31.maven:scala-maven-plugin:4.0.1 or one of its dependencies could not be resolved: Could not transfer artifact org.apache.maven:maven-compat:jar:3.3.9 from/to central (https://repo.maven.apache.org/maven2): Failed to transfer file https://repo.maven.apache.org/maven2/org/apache/maven/maven-compat/3.3.9/maven-compat-3.3.9.jar with status code 500 -> [Help 1]
    (https://github.com/apache/pulsar/pull/6202/checks?check_run_id=431040196)

  12. devinbost commented on Feb 7, 2020

    @devinbost
    ContributorAuthor

    Here's another one:

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project buildtools: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.19.1 or one of its dependencies could not be resolved: Could not transfer artifact org.apache.maven.surefire:maven-surefire-common:jar:2.19.1 from/to central (https://repo.maven.apache.org/maven2): Failed to transfer file https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.19.1/maven-surefire-common-2.19.1.jar with status code 500 -> [Help 1]
    (https://github.com/apache/pulsar/pull/6202/checks?check_run_id=432260374)

  13. woop commented on Jul 31, 2020

    @woop

    @devinbost Are you still getting this problem? We seem to be running into it over at Feast. Using self-hosted runners with GitHub Actions.

  14. smolnar82 commented on Aug 28, 2020

    @smolnar82

    The same with Apache Knox: https://github.com/apache/knox/runs/1040256760?check_suite_focus=true
    This is really annoying. We also use Travis CI and it's working like a charm.
    @devinbost, were you able to fix it by updating your workflow file?

  15. devinbost commented on Aug 28, 2020

    @devinbost
    ContributorAuthor

    I never actually figured out what was causing this... Sorry about that.

  16. lhotari commented on Oct 27, 2020

    @lhotari
    Member

    There are some suggestions in this SO Q&A: https://stackoverflow.com/questions/55899091/maven-retry-dependency-download-if-failed .
    It seems that passing -Dmaven.wagon.http.retryHandler.count=3 would help reduce the issues when downloads are retried 3 times. One of the answers suggests passing -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false, however that might have a performance impact.
    I'll experiment to see if -Dmaven.wagon.http.retryHandler.count=3 helps fixing the issue.

  17. added 3 commits that reference this issue on Oct 27, 2020
    1377e6c
    5781f66
    3caa9cc
  18. lhotari commented on Oct 27, 2020

    @lhotari
    Member

    I ended up trying to use -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 in MAVEN_OPTS environment variable in the PR to fix this issue. Let's see if that's effective.

  19. lhotari commented on Oct 27, 2020

    @lhotari
    Member

    I now found https://issues.apache.org/jira/browse/WAGON-545 which is a close match to this issue.
    In the last comment, it says "Azure users shall set the TTL to 240 seconds or less."

  20. added a commit that references this issue on Oct 27, 2020
    03f71d9
  21. added a commit that references this issue on Nov 13, 2020
    c27a47e
  22. added a commit that references this issue on Nov 17, 2020
    08906ed
  23. lhotari commented on Dec 10, 2020

    @lhotari
    Member

    I seems that the solution introduced in #8386 doesn't fix all "Connection reset" issues. The recommendation seems to be to disable the connection pooling completely with -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false options instead of configuring the pool TTL and retry counts.

    Here's a recent failure:

    Error:  Plugin pl.project13.maven:git-commit-id-plugin:4.0.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for pl.project13.maven:git-commit-id-plugin:jar:4.0.2: Could not transfer artifact pl.project13.maven:git-commit-id-plugin:pom:4.0.2 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin/4.0.2/git-commit-id-plugin-4.0.2.pom: Connection reset -> [Help 1]
    

    another similar failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/buildtype/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions