Hi, how dow you handle a flaky maven proxy? E.g. ...
# community-support
b
Hi, how dow you handle a flaky maven proxy? E.g. in CI the replication of the artifact can be late in the proxy (for various reasons, like it's own network problem, or else), and as such the proxy returns 404 because it couldn't find the artifact in time – yet the artifact exists on central. Worse this can happen on auxiliary files. The fix for this issue, github.com/gradle/gradle/issues/4629 is nice but only works connection problems. So it doesn't apply to
ArtifactNotFoundException
Copy code
Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find resilience4j-timelimiter-0.12.0.jar (io.github.resilience4j:resilience4j-timelimiter:0.12.0).
Searched in the following locations:
    https://{the.proxy}/io/github/resilience4j/resilience4j-timelimiter/0.12.0/resilience4j-timelimiter-0.12.0.jar
        at org.gradle.internal.resolve.result.DefaultBuildableArtifactFileResolveResult.notFound(DefaultBuildableArtifactFileResolveResult.java:28)
        at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveArtifact(ExternalResourceResolver.java:489)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$ResolveAndCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:470)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.lambda$resolveArtifact$12(ErrorHandlingModuleComponentRepository.java:180)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.tryResolveAndMaybeDisable(ErrorHandlingModuleComponentRepository.java:251)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.performOperationWithRetries(ErrorHandlingModuleComponentRepository.java:204)
...
So, I'm wondering if Gradle is missing a retry mechanism in that case
v
Hi, how dow you handle a flaky maven proxy?
Fix the flaky proxy. It would not really make sense for Gradle to retry on 404, because the repository said "I don't know about this file". A proper proxy should directly call through to the proxied system if it does not have the artifact as copy yet and not asynchronously add it but return 404.
b
Fix the flaky proxy.
That angle is out of my reach, but I fear that is the only option.
v
I think the only viable, yes. I don't think you can fix this on your side somehow except for rerunning the build and probably with
--refresh-dependencies
I don't think you can force it to retry 404 immediately. Maybe with using some additional in-process proxy additionally that you use a repository that proxies the flaky repository and retries, but even if possible, I don't think that this is a good idea.
b
Agreed