Closed absolut-swedish closed 2 years ago
put the google artifactregistry plugin at the top of the list and you should be good.
It will not help. It just happened to me yesterday without any changes to code. I tried to reconfigure gcloud but it didn't help. Sometime deleting the whole ~/.gradle folder helps but in less then 1 hour it breaks again. And not only me it happend for all my teammates also without any changes to code/gradle/config. So I think there's a bug or google did something yesterday to all our accounts or everybody. There's no way to make it work at least with Application Default Credentials. If I launch it with --info I can see the error:
Failed to get access token from gcloud or Application Default Credentials com.google.api.client.http.HttpResponseException: 400 Bad Request POST https://oauth2.googleapis.com/token { "error": "invalid_grant", "error_description": "reauth related error (invalid_rapt)", "error_subtype": "invalid_rapt" } at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1116) at com.google.auth.oauth2.UserCredentials.doRefreshAccessToken(UserCredentials.java:273) at com.google.auth.oauth2.UserCredentials.refreshAccessToken(UserCredentials.java:190) at com.google.auth.oauth2.OAuth2Credentials$1.call(OAuth2Credentials.java:243) at com.google.auth.oauth2.OAuth2Credentials$1.call(OAuth2Credentials.java:240) at java.base@17/java.util.concurrent.FutureTask.run(FutureTask.java:264) at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) at com.google.auth.oauth2.OAuth2Credentials$AsyncRefreshResult.executeIfNew(OAuth2Credentials.java:567) at com.google.auth.oauth2.OAuth2Credentials.asyncFetch(OAuth2Credentials.java:206) at com.google.auth.oauth2.OAuth2Credentials.refreshIfExpired(OAuth2Credentials.java:177) at com.google.cloud.artifactregistry.gradle.plugin.ArtifactRegistryGradlePlugin.apply(ArtifactRegistryGradlePlugin.java:89)
we are no longer using this plugin and write out the credentials to a gradle.properties file. basically something like this:
echo "artifactRegistryMavenSecret=$$GRADLE_ACCESS_TOKEN" >> gradle.properties
Hi all sorry for the delay in response.
If y'all are still interested can you try this https://github.com/GoogleCloudPlatform/artifact-registry-maven-tools/issues/40#issuecomment-885927526 (make sure to change the plugin version to 2.1.4)
@denis111 I think your problem should have been fixed in https://github.com/GoogleCloudPlatform/artifact-registry-maven-tools/pull/67 and released in 2.1.5. This was a bug that when the plugin did not detect credentials from the environment it failed to tell gradle what protocol artifactregistry
is.
I'm going to close it here but it still doesn't work feel free to let me know.
we have this issue,
echo $GOOGLE_APPLICATION_CREDENTIALS is set to a working ../.config/gcloud/application_default_credentials.json for the correct project where the artifact registry resides
version is 2.2.1
and my user definitly is in a group which has role roles/artifactregistry.writer
Hi,
I'm running into a "Not a supported repository protocol 'artifactregistry': valid protocols are [http, https, file, gcs, s3, sftp]" issue. I've logged in to gcloud auth application-default login, then execute gradlew build and see the above error.
My gradle.build file contains: plugins { ... id("maven-publish") id("com.google.cloud.artifactregistry.gradle-plugin") version "2.1.2" ... }
repositories { mavenCentral() maven { url "artifactregistry://us-maven.pkg.dev/lpgprj-sbo-n-lpvser-gl-01/lp-voice-libraries" } }
My environment: ./gradlew --version
Gradle 7.2
Build time: 2021-08-17 09:59:03 UTC Revision: a773786b58bb28710e3dc96c4d1a7063628952ad
Kotlin: 1.5.21 Groovy: 3.0.8 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 11.0.12 (GraalVM Community 11.0.12+6-jvmci-21.2-b08) OS: Mac OS X 11.4 x86_64
The error: ./gradlew build
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'lp-voice-media-service'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
There seem to be others running into a similar issue: https://stackoverflow.com/questions/65261439/google-cloud-artifact-registry-for-gradle-plugins https://githubmemory.com/repo/GoogleCloudPlatform/artifact-registry-maven-tools/issues/40
Perhaps I'm just missing something here. Any help would be greatly appreciated!
Thanks, Thor