samrocketman / jenkins-bootstrap-jervis

An automated Jenkins CI environment which provisions agent infrastructure on the fly per build.
Apache License 2.0
75 stars 30 forks source link

Error at the end of Jervis build #21

Closed byjg closed 6 years ago

byjg commented 6 years ago

I sucessfully installed the Jenkis Bootstrap on my local machine and already generate the image jervis-docker-jvm. I setup the build nodes to run as much as possible.

I setup a public project (https://github.com/byjg/demojervis) with the follow .jervis.yml:

language: java  

install:
  - mvn install -DskipTests=true

Apparently everything is working because the build download my master branch and build correctly the project.

But the last log lines are:

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hello-world-war ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ hello-world-war ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.929 s
[INFO] Finished at: 2018-04-10T00:06:58+00:00
[INFO] Final Memory: 9M/212M
[INFO] ------------------------------------------------------------------------
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline

GitHub has been notified of this commit’s build result

java.lang.NullPointerException: Cannot invoke method keySet() on null object
    at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
    at net.gleske.jervis.lang.pipelineGenerator.getPublishableItems(pipelineGenerator.groovy:292)
    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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1850)
    at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3758)
    at net.gleske.jervis.lang.pipelineGenerator.getProperty(pipelineGenerator.groovy)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
    at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:34)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
    at buildViaJervis.call(/home/jg/Projetos/crossover/my_jenkins_home/jobs/byjg/jobs/demojervis/branches/master/builds/4/libs/Jervis Global Library/vars/buildViaJervis.groovy:292)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
    at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
    at sun.reflect.GeneratedMethodAccessor301.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
    at com.cloudbees.groovy.cps.Next.step(Next.java:83)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
    at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
    at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:331)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:82)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:243)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:231)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    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)
Finished: FAILURE

Questions:

Thank you.

samrocketman commented 6 years ago

The current master branch of example code depends on jervis-1.1-SNAPSHOT.jar. I could modify the VM to utilize it. Right now I manually copy the jar to the /var/lib/jenkins/.groovy/grape/*/jervis-1.0.jar to "trick" the pipeline into using it. You can copy it there so the missing features become available. I plan to release so this will be less of an issue.

In general, Jervis is very much in flux at the moment. I just implemented full pipeline support and am working on enhancing it.

Your other alternative is to depend on the tags. Update the pipeline library in the global config to use the 1.0 tag. This is normal at the moment since master is considered unstable.

Recommended solution

Switch the global shared library to use the 1.0 tag. 1.1 will be out soon providing tons of better pipeline support. Refer to the CHANGELOG.md for a preview of what's to come in 1.1.

samrocketman commented 6 years ago

Actually, you hit a bug I just fixed.

Fixes critical bug where users who do not define collecting any artifacts in YAML will cause their job to fail to build.

You can work around it with collecting something like an artifact. Or at the very least make it non-null.

Example:

jenkins:
  collect: {}

Using 1.0 tag won't help. Will be fixed in 1.1.

samrocketman commented 6 years ago

I'll try to release 1.1 before Weds.

samrocketman commented 6 years ago

Next time I close this, it will be fixed.

byjg commented 6 years ago

Thank you for your quickly answer.

I implemented what you suggested as workaround. The Empty "collect" does not work at all for me, but I collected a real file:

jenkins:
  pipeline_jenkinsfile: Jenkinsfile  
  collect:
    artifacts: target/*.war

I'll wait for the version 1.1

samrocketman commented 6 years ago

1.1 is released. See release notes/changelog.

byjg commented 6 years ago

Great. I'll test it.

Em ter, 17 de abr de 2018 12:42, Sam Gleske notifications@github.com escreveu:

1.1 is released

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/samrocketman/jenkins-bootstrap-jervis/issues/21#issuecomment-382040053, or mute the thread https://github.com/notifications/unsubscribe-auth/AA77pMSyAixXaMbxvBHDwkGnF79C3x1Tks5tpg1SgaJpZM4TNatM .