GoogleRobotPrivateKeyCredentials AccountIdNotSetException

690 views
Skip to first unread message

Andreas Schuldei

unread,
Sep 16, 2015, 8:16:04 AM9/16/15
to Jenkins Users
hi,

i am setting up a CI pipeline that creates docker images, uploads them to my google docker registry/repository and then redeploys my webapp. 

Right now I work on the docker push step, which fails with this stack trace:

 ERROR: Build step failed with exception
com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials$AccountIdNotSetException
        at com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials.getGoogleCredential(GoogleRobotPrivateKeyCredentials.java:181)
        at com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials.getGoogleCredential(GoogleRobotPrivateKeyCredentials.java:45)
        at com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials.getAccessToken(GoogleRobotCredentials.java:100)
        at com.google.jenkins.plugins.googlecontainerregistryauth.GoogleContainerRegistryCredentialModule.getToken(GoogleContainerRegistryCredentialModule.java:73)
        at com.google.jenkins.plugins.googlecontainerregistryauth.GoogleContainerRegistryCredential.getPassword(GoogleContainerRegistryCredential.java:224)
        at com.google.jenkins.plugins.googlecontainerregistryauth.GoogleContainerRegistryTokenSource.convert(GoogleContainerRegistryTokenSource.java:48)
        at com.google.jenkins.plugins.googlecontainerregistryauth.GoogleContainerRegistryTokenSource.convert(GoogleContainerRegistryTokenSource.java:32)
        at jenkins.authentication.tokens.api.AuthenticationTokens.convert(AuthenticationTokens.java:148)
        at jenkins.authentication.tokens.api.AuthenticationTokens.convert(AuthenticationTokens.java:110)
        at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getToken(DockerRegistryEndpoint.java:179)
        at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:201)
        at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:193)
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:381)
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:359)
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:305)
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:252)
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:233)
        at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:208)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
        at hudson.model.Build$BuildExecution.build(Build.java:205)
        at hudson.model.Build$BuildExecution.doRun(Build.java:162)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
        at hudson.model.Run.execute(Run.java:1741)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:408)


This started happening after i deleted some unused and unrelated credentials from the global credentials. 

I am speculating that the credentials store got confused because the AccountID is encoded in the credentials, isnt it? if not, where can i supply it?

(Before I got this error: 

The push refers to a repository [eu.gcr.io/founderschair-website-01-981/website-image] (len: 1)
Sending image list
Error: Status 403 trying to push repository founderschair-website-01-981/website-image: "Access denied."

but i do hope I created the proper OAuth credentials by now. -- is there a tutorial for that part with both the google and the jenkins side explained? i followed  https://groups.google.com/forum/#!searchin/jenkinsci-users/docker$20container/jenkinsci-users/3DiEV7qQ7CM/1wHn3XzKrD4J - is that state-of-the-art?)

/andreas

Andreas Schuldei

unread,
Sep 17, 2015, 1:45:46 AM9/17/15
to Jenkins Users
aparently i had created the wrong type of credential for this kind of interaction. selecting an other credential helped over this hurdle.

work monitored

unread,
Feb 3, 2017, 10:57:56 AM2/3/17
to Jenkins Users, and...@founderschair.com
I am having trouble with Jenkins Google Oauth Credentials Plugin. I have created a storage account service account and downloaded the JSON but I am getting an accountIdNotSetException. What was the credential you picked to fix it?

work monitored

unread,
Feb 3, 2017, 11:14:48 AM2/3/17
to Jenkins Users, and...@founderschair.com
I have verified that the json file contains the client_email key and the private key so I am a bit clueless at this point about why it is complaining about the accountIdNotSetException. Is there a debug flag I can use to see what's going behind the scenes?
Reply all
Reply to author
Forward
0 new messages