lahsivjar/gcp-storage-wagon

Unable to download artifacts from GCS

ashkaps opened this issue · 0 comments

Hi @lahsivjar ,

I am facing a rather odd issue.
I am using this storage wagon plugin to manage dependency on one of my projects. Few of the dependencies are internal and created by us and hosted in GCS.
This works perfect for the most part. Although I am seeing some weird issue where sometimes the artifacts fail to download because of 401 error .
Unauthorized [ERROR] { [ERROR] "code" : 401, [ERROR] "errors" : [ { [ERROR] "domain" : "global", [ERROR] "location" : "Authorization", [ERROR] "locationType" : "header", [ERROR] "message" : "Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.", [ERROR] "reason" : "required" [ERROR] } ], [ERROR] "message" : "Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object." [ERROR] }

This happens only on a specific setup.
I have windows VM outside of my GCP network on which remote builds happen. I am using jenkins for the remote builds.
If there a new version of dependency deployed to my GCP maven repo, the consuming project fails to download that dependency.

I am able to have this resolved if I restart my jenkins slave as Admin on that server and still be logged into that server using RDP until the dependency is downloaded. Once downloaded, it works fine for all subsequent builds till a new version is deployed.

If i restart slave as admin and close RDP, dependency does not download and gives above error.
If I RDP into the server and retry mu build it works.

I am using a service account which has admin access to my private GCS maven repo.
Somehow ability to download a new version is linked to RDP.

Any thoughts or comments on what could be causing this and how to resolve would be appreciated. Thanks in advance.

I can provide more details if needed.