Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't handle class com.google.jenkins.plugins.credentials.oauth.JsonServiceAccountConfig#jsonKeyFileUpload: type is abstract but not Describable. #101

Open
juliensap1 opened this issue Jan 28, 2021 · 1 comment

Comments

@juliensap1
Copy link

juliensap1 commented Jan 28, 2021

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:
image

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

@klei-chante
Copy link

I have this same issue. Any help would be super appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants