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

IllegalArgumentException caused by UnsupportedOperationException when getCluster called #199

Open
pawoolley opened this issue Jun 22, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@pawoolley
Copy link

Version report

  • Jenkins and plugins versions:

Jenkins 2.263.2
Google Kubernetes Engine Plugin 0.8.3

  • What Operating System are you using (both controller, and any agents involved in the problem)?

Red Hat Enterprise Linux release 8.3 (Ootpa)

Reproduction steps

Trying to perform a deployment to GKE using this pipeline:

pipeline {
    agent any
    environment {
        PROJECT_ID = 'my-google-cloud-project-id'
        CLUSTER_NAME = 'my-gke-cluster-name'
        LOCATION = 'us-central1-a'
        CREDENTIALS_ID = 'my-service-account-creds-id'
    }
    stages {
        stage('Deploy to GKE') {
            steps{
                step([
                        $class: 'KubernetesEngineBuilder',
                        projectId: env.PROJECT_ID,
                        clusterName: env.CLUSTER_NAME,
                        location: env.LOCATION,
                        manifestPattern: 'gke-deployment.yaml',
                        credentialsId: env.CREDENTIALS_ID,
                        verifyDeployments: true])
            }
        }
    }
}

Results

  • Expected result:

The deployment works, with no stacktraces in the logs.

  • Actual result:

The deployment works, the build succeeds, but there is the following stacktrace repeated in the logs:

2021-06-22 14:07:35.807+0000 [id=53]	WARNING	o.j.p.s.d.DescribableParameter#uncoerce: failed to uncoerce com.google.jenkins.plugins.k8sengine.KubernetesEngineBuilder@6f354e72
java.lang.IllegalArgumentException
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:72)
	at com.google.jenkins.plugins.k8sengine.ClusterUtil.toNameAndLocation(ClusterUtil.java:45)
	at com.google.jenkins.plugins.k8sengine.KubernetesEngineBuilder.getCluster(KubernetesEngineBuilder.java:161)
Caused: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jenkinsci.plugins.structs.describable.DescribableParameter.getValue(DescribableParameter.java:154)
Caused: java.lang.UnsupportedOperationException
	at org.jenkinsci.plugins.structs.describable.DescribableParameter.getValue(DescribableParameter.java:166)
	at org.jenkinsci.plugins.structs.describable.DescribableParameter.inspect(DescribableParameter.java:142)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2(DescribableModel.java:682)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2_(DescribableModel.java:752)
	at org.jenkinsci.plugins.structs.describable.DescribableParameter.uncoerce(DescribableParameter.java:196)
	at org.jenkinsci.plugins.structs.describable.DescribableParameter.inspect(DescribableParameter.java:142)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2(DescribableModel.java:655)
	at org.jenkinsci.plugins.workflow.actions.ArgumentsAction.resolve(ArgumentsAction.java:306)
	at org.jenkinsci.plugins.workflow.actions.ArgumentsAction.getResolvedArguments(ArgumentsAction.java:293)
	at com.cloudbees.analytics.build_completed.PipelinePropertyCollector$PipelineVisitor.visit(PipelinePropertyCollector.java:154)
	at org.jenkinsci.plugins.workflow.graphanalysis.AbstractFlowScanner.visitAll(AbstractFlowScanner.java:364)
	at org.jenkinsci.plugins.workflow.graphanalysis.AbstractFlowScanner.visitAll(AbstractFlowScanner.java:373)
	at com.cloudbees.analytics.build_completed.PipelinePropertyCollector.processFlowNodes(PipelinePropertyCollector.java:127)
	at com.cloudbees.analytics.build_completed.PipelinePropertyCollector.addProperties(PipelinePropertyCollector.java:75)
	at com.cloudbees.analytics.gatherer.BuildCompletedEvent.getData(BuildCompletedEvent.java:55)
	at com.cloudbees.analytics.Queue.lambda$enqueue$0(Queue.java:262)
	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)
@pawoolley pawoolley added the bug Something isn't working label Jun 22, 2021
@shubhamgoel4aug
Copy link

Did you find any workaround to this?

@pawoolley
Copy link
Author

Did you find any workaround to this?

No, I did not, but at the time I wasn't in a position to dig in to it either. I raised the bug and had to move on to something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants