Getting Maven "Could not transfer artifact" with 500 error when using Github Actions

Hi, 

In our open source project, we are intermittently getting errors like these after moving from Jenkins to Github CI Actions:

More examples are documented in our Github Issues here: https://github.com/apache/pulsar/issues/6231

This issue almost seems related to this issue: 

https://github.community/t5/GitHub-Actions/GitHub-Package-Registry-with-Maven-causes-deployment-issues/td-p/39879

and this issue (about proxy settings):

https://stackoverflow.com/questions/15334394/could-not-transfer-artifact-org-apache-maven-pluginsmaven-surefire-pluginpom2

Our Github workflow files are located here: https://github.com/apache/pulsar/tree/master/.github/workflows

This one, for example, has caused the issue: https://github.com/apache/pulsar/blob/master/.github/workflows/ci-unit-flaky.yaml

How do we resolve this issue?

I tested on the forked repository of your repository, but did not reproduce the problem, it always can work without errors.

Maybe you can try to enabling debug logging on your repository, and share the detailed debug logs with us if the error occurs again next time.

I am getting similar errors intermittently on a private Jenkins instance; same maven repository, different packages. Maybe the problem is with Apache’s server?

The issue is intermittent and unpredictable.

@devinbost & @liori ,

Sorry for the late response.

Whether the problem occurs again recently?

If it occurs again, I will help you report this to the appropriate engineering team, and if possible, please share you repositories with us so that we can check more deatils of the workflows in your repositories to analyze the root cause.

I’ve stopped getting errors some time ago.

It seems that passing -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 to maven will fix the issue.

This is used in apache/pulsar repository:

env:
  MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3

In the last comment of WAGON-545, it says “Azure users shall set the TTL to 240 seconds or less.”