Cache miss and redirect to jcenter for newly published plugin

Hello.
Every few weeks it happens that we see issues with resolving newly published plugins and or its depdencies through plugins.gradle.org. In most cases it will resolve after around 24h on its own but it is kinda stressfull because it mostly works for us locally but fails on our CI systems.
I tried to get down the rabbithole today with a newly published plugin.

This curl
curl https://plugins.gradle.org/m2/net/wooga/snyk-wdk-java/net.wooga.snyk-wdk-java.gradle.plugin/0.1.0/net.wooga.snyk-wdk-java.gradle.plugin-0.1.0.pom -v works perfectly fine on my computer and all coworkers (Berlin Germany) but not on the build machine which is located in Dublin.

A quick dns lookup tells me that at the moment plugins.gradle.org points to 04.18.191.9 or 04.18.190.9

The machines in Dublin only ever use the 04.18.191.9 IP and receive a 303 which points to the location https://repo.gradle.org/artifactory/jcenter/net/wooga/snyk-wdk-java/net.wooga.snyk-wdk-java.gradle.plugin/0.1.0/net.wooga.snyk-wdk-java.gradle.plugin-0.1.0.pom which returns a 404.

My local machine always connects to 04.18.190.9 and resolves the requested pom file without any redirects. If I add some URL parameters at the end of the URL like ?garbage then the Dublin based machines also contact the 04.18.190.9 machine and resolve the pom without issues.

I think/feel there is nothing I can do from my side or? It would be great if somebody could lead me to a solution here since this happens always when we don’t need it.

I suspect this is caching related too. We use Cloudflare in front of the plugin portal and recently made changes to the TTL. Has this been happening for awhile or did it start recently?

cc: @ljacomet

As of this morning it is working again as expected.

As I said we had similar issues where a dependency is reportedly not available in the repo even though I was able to look it up manually via the web. I find it interesting that it fails by pointing to a jcenter URL which doesn’t exist even now that it returns the artifacts correctly: https://repo.gradle.org/ui/native/jcenter/net/wooga/snyk-wdk-java/net.wooga.snyk-wdk-java.gradle.plugin/0.1.0/net.wooga.snyk-wdk-java.gradle.plugin-0.1.0.pom.

Hello,

Thanks for reporting this. We made a mistake in the caching time to leave which we will update. This should reduce the window of such events to 1h instead of longer. We are also working on proper invalidation at publication time.

However to hit a cached 303, it means a request was made to the plugin portal prior to the version being available.
Is that something that you can explain in your setup?

Well yes. I published a new plugin and forgot that it needs to went through veryfication and triggered a build on CI with said new plugin. That resulted in an error and I then saw that I have to wait for the mail. After I received the mail I checked locally if it can resolve the plugin and triggered another CI build. This is then where my story started.

Thanks for looking into this.