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

Better error message when target cluster is misconfigured or missing functionality #63

Open
viglesiasce opened this issue May 1, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@viglesiasce
Copy link

When deploying to a cluster without client certs or legacy authentication enabled, the build results in an NPE rather than a helpful error message:

Started by user admin
Agent default-k398b is provisioned from template Kubernetes Pod Template
Agent specification [Kubernetes Pod Template] (default): 

Building remotely on default-k398b (default) in workspace /home/jenkins/workspace/test
No credentials specified
Cloning the remote Git repository
Cloning repository https://github.com/viglesiasce/sample-app
 > git init /home/jenkins/workspace/test # timeout=10
Fetching upstream changes from https://github.com/viglesiasce/sample-app
 > git --version # timeout=10
 > git fetch --tags --force --progress https://github.com/viglesiasce/sample-app +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://github.com/viglesiasce/sample-app # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://github.com/viglesiasce/sample-app # timeout=10
Fetching upstream changes from https://github.com/viglesiasce/sample-app
 > git fetch --tags --force --progress https://github.com/viglesiasce/sample-app +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 8834988fcdc3d6878b5ca6a4fcee4688da7c7597 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 8834988fcdc3d6878b5ca6a4fcee4688da7c7597 # timeout=10
Commit message: "Simplify Jenkinsfile"
 > git rev-list --no-walk 8834988fcdc3d6878b5ca6a4fcee4688da7c7597 # timeout=10
ERROR: Build step failed with exception
java.lang.NullPointerException: null value
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
	at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:139)
	at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:178)
	at com.google.jenkins.plugins.k8sengine.KubeConfig.user(KubeConfig.java:193)
	at com.google.jenkins.plugins.k8sengine.KubeConfig.fromCluster(KubeConfig.java:153)
	at com.google.jenkins.plugins.k8sengine.KubernetesEngineBuilder.perform(KubernetesEngineBuilder.java:196)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.model.Build$BuildExecution.build(Build.java:206)
	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1816)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Build step 'Deploy to Google Kubernetes Engine' marked build as failure
Finished: FAILURE
@craigdbarber craigdbarber added the enhancement New feature or request label Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants