-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Hello,
i'm having an issue with the JCASC plugin googleRobotPrivateKey. When jenkins is loading the key i got the error mentioned in the subject in jenkins logs.
If i add the key directly in the jenkins interface using this kind of key i don't have any error.
After adding the key directly into the jenkins interface, the code generated by JCASC for this key, is similar with the one i added in the jcasc manifest:
credentials:
system:
domainCredentials:
- credentials:
- googleRobotPrivateKey:
projectId: "it-ops-staging"
serviceAccountConfig:
json:
filename: "gcr_admin.json"
secretJsonKey: "${GOOGLE_ROBOT_PRIV_KEY}"
The error generated running the job i got the error AccountIdNotSetException:
com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials$AccountIdNotSetException
at com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials.getGoogleCredential(GoogleRobotPrivateKeyCredentials.java:185)
at com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials.getGoogleCredential(GoogleRobotPrivateKeyCredentials.java:43)
at com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials.getAccessToken(GoogleRobotCredentials.java:85)
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:222)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:295)
at org.jenkinsci.plugins.docker.workflow.RegistryEndpointStep$Execution2.newKeyMaterialFactory(RegistryEndpointStep.java:95)
at org.jenkinsci.plugins.docker.workflow.AbstractEndpointStepExecution2.doStart(AbstractEndpointStepExecution2.java:52)
at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)`
but there is no such parameter for this key:

the pipeline:
` stage("Push image") {
steps {
script {
docker.withRegistry('https://gcr.io', 'gcr:iXXX') {
myapp.push("latest")
myapp.push("${env.BUILD_ID}")
}
}
}
}`
Can you please check and advice?
Thank you