Skip to content

IllegalArgumentException caused by UnsupportedOperationException when getCluster called #199

@pawoolley

Description

@pawoolley

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions