[Jenkins Kubernetes Plugin] Issues building plugin from source

42 views
Skip to first unread message

Andrew Douglas

unread,
Oct 17, 2019, 1:22:26 PM10/17/19
to Jenkins Users
Hi, I am trying to diagnose a potential issue with this plugin and have downloaded the source (from https://github.com/jenkinsci/kubernetes-plugin).

I am running Minikube and have the latest version of Maven. When I try to build the plugin with the command `mvn clean install -DconnectorHost=0.0.0.0` I always get at least one integration test failure and then the build fails. Failures typically look like:

```
[INFO] Running org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
[ERROR] Tests run: 27, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 592.425 s <<< FAILURE! - in org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
[ERROR] cascadingDelete(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)  Time elapsed: 180.127 s  <<< ERROR!
org.junit.runners.model.TestTimedOutException: test timed out after 180 seconds
        at java...@12.0.1/java.lang.Thread.sleep(Native Method)
        at app//org.jvnet.hudson.test.JenkinsRule.waitForCompletion(JenkinsRule.java:1430)
        at app//org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest.cascadingDelete(KubernetesPipelineTest.java:404)
        at java...@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java...@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java...@12.0.1/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java...@12.0.1/java.lang.reflect.Method.invoke(Method.java:567)
        at app//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at app//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at app//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at app//org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at app//org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
        at app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
        at app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
        at app//org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        at app//org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:600)
        at app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
        at app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
        at java...@12.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java...@12.0.1/java.lang.Thread.run(Thread.java:835)

[ERROR] computerCantBeConfigured(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)  Time elapsed: 0.493 s  <<< ERROR!
org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
        at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
        at jenkins.InitReactorRunner.run(InitReactorRunner.java:48)
        at jenkins.model.Jenkins.executeReactor(Jenkins.java:1152)
        at jenkins.model.Jenkins.<init>(Jenkins.java:959)
        at hudson.model.Hudson.<init>(Hudson.java:85)
        at org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:675)
        at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:402)
        at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:595)
        at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
        at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
        at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
        at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1118)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        ... 1 more
Caused by: java.lang.reflect.InvocationTargetException
        at jdk.internal.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
        ... 8 more
Caused by: java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
        at jenkins.model.Jenkins.get(Jenkins.java:772)
        at org.jenkinsci.plugins.workflow.cps.nodes.StepDescriptorCache.getPublicCache(StepDescriptorCache.java:48)
        at org.jenkinsci.plugins.workflow.cps.nodes.StepDescriptorCache.invalidateGlobalCache(StepDescriptorCache.java:55)
        ... 12 more
```

I'm building off the last good version (1.20.0), on a Mac, and have not changed anything.

Could someone give me a pointer to get started please?


Thanks
Andrew

Carlos Sanchez

unread,
Oct 21, 2019, 6:14:11 AM10/21/19
to Jenkins Users
you would need to check the pod logs, to see what happened 
probably the pods can't connect to jenkins and you may need to set the hot ip in maven
anyway if you submit a PR it will be tested in jenkins infra and will give you the test results

If your minikube is running in a VM (e.g. on virtualbox) and the host running mvn does not have a public hostname for the VM to access, you can set the jenkins.host.address system property to the (host-only or NAT) IP of your host:

mvn clean install -Djenkins.host.address=192.168.99.1

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e539da6c-7f67-4d67-8df2-77b3da4182e5%40googlegroups.com.

Andrew Douglas

unread,
Oct 21, 2019, 12:03:08 PM10/21/19
to Jenkins Users
Thanks Carlos,

"Some integration tests run a local jenkins" is it possible that this is not starting correctly? I can't see a copy of Jenkins running anywhere during testing.

I'm using minikube on hyperkit for testing


Andrew
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.

Carlos Sanchez

unread,
Oct 21, 2019, 12:22:46 PM10/21/19
to Jenkins Users
a jenkins server is started for each of those integration tests. 
the port used is printed in the logs 

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9e81b30a-1244-48ae-92ca-239b1478bf64%40googlegroups.com.

Andrew Douglas

unread,
Oct 23, 2019, 5:09:28 PM10/23/19
to Jenkins Users
I'm finding that I get the most passes when using the command:

mvn -DconnectorHost=0.0.0.0 -Djenkins.host.address=192.168.64.1 clean install

I know that pods in minikube can contact the host using 192.168.64.1 (tested), and as the docs say I don't really mind Jenkins being open for a short while.

I am still getting some failures (building unchanged code pulled from master branch), I have attached some logs. What setup do contributors usually use to build/package?


Thanks
Andrew
attempt_2.log
surefire-reports.zip
Reply all
Reply to author
Forward
0 new messages