There are 2 Jenkins A and B. I am triggering Job in A Jenkins and after the build is succeeded, it should trigger a Job in B Jenkins using Remote Parameterized Job (Parameterized Remote Trigger) plugin.
I am using the Jenkins and plugin version as follows:
Jenkins A version - 2.107.2
Jenkins B version - 2.73.3
Parameterized Remote Trigger version - 2.2.2
When i triggered build job in A Jenkins, it is triggering only 1 build job in B Jenkins (In that particular folder there will be 6 build jobs and all of them has to get triggered) and then it is failing with the below mentioned issue.
java.lang.NullPointerException
at java.io.Reader.<init>(Unknown Source)
at java.io.InputStreamReader.<init>(Unknown Source)
at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.sendHTTPCall(RemoteBuildConfiguration.java:980)
10:33:04 at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.sendHTTPCall(RemoteBuildConfiguration.java:799)
10:33:04 at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.perform(RemoteBuildConfiguration.java:556)
10:33:04 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
10:33:04 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
10:33:04 at hudson.model.Build$BuildExecution.build(Build.java:206)
10:33:04 at hudson.model.Build$BuildExecution.doRun(Build.java:163)
10:33:04 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
10:33:04 at hudson.model.Run.execute(Run.java:1727)
10:33:04 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
10:33:04 at hudson.model.ResourceController.execute(ResourceController.java:97)
10:33:04 at hudson.model.Executor.run(Executor.java:429)
10:33:04 Build step 'Trigger a remote parameterized job' marked build as failure
Any help would be really appreciated. Thank you.
The above issue got resolved once we have updated the plugin "Parameterized Remote Trigger" to 3.0.3 and provide the root URL of Jenkins B in Jenkins A configuration and provide the rest of the path till the Job is present in the Remote Job Name or URL parameter and hence the above issue got resolved.
Related
I have two Jenkins jobs, one called "UpStreamJob" and the other one is its downstream job called "GetUpstreamJob".
Upstream job is configured to kick-off downstream job as its post build action.
Downstream job is configured with "execute groovy script" option which points to a groovy script
whose main purpose is to get the upstream job name that triggered it and then write the job name to a property file(which I am yet to implement).
Groovy script :
#GrabResolver(name='jenkins', root='http://repo.jenkins-ci.org/public/')
#Grapes([
#Grab(group='org.jenkins-ci.main', module='jenkins-core', version='2.167')
])
import hudson.model.*
def writeToPropertyFile(){
def causes = Run.getCauses()
for (cause in causes)
{
printCausesRecursively(cause)
}
}
def printCausesRecursively(cause) {
if (cause.class.toString().contains("UpstreamCause")) {
println "This job was caused by " + cause.toString()
for (upCause in cause.upstreamCauses) {
printCausesRecursively(upCause)
}
} else {
println "Root cause : " + cause.toString()
}
}
writeToPropertyFile()
The error I get in Jenkins console log is :
Started by upstream project "UpStreamJob" build number 11
originally caused by:
Started by user xyz
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building remotely on Server123 in workspace D:\Jenkins\workspace\GetUpstreamJob
[GetUpstreamJob] $ D:\Jenkins\tools\hudson.plugins.groovy.GroovyInstallation\Groovy-2-5-7\bin\groovy.bat D:\Asif\getUpstreamJob.groovy
Caught: java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserException
java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserException
at hudson.util.XStream2.getDefaultDriver(XStream2.java:109)
at hudson.util.XStream2.<init>(XStream2.java:113)
at hudson.model.Run.<clinit>(Run.java:2471)
at getUpstreamJob.writeToPropertyFile(getUpstreamJob.groovy:10)
at getUpstreamJob.run(getUpstreamJob.groovy:32)
Caused by: java.lang.ClassNotFoundException: org.xmlpull.v1.XmlPullParserException
... 5 more
Build step 'Execute Groovy script' marked build as failure
Notifying upstream projects of job completion
Finished: FAILURE
EDIT 1 : START
Below is the error that the Jenkins console log shows, when I try running the script by copy-pasting the script's code in the "Execute System Groovy script":
Started by upstream project "UpStreamJob" build number 15
originally caused by:
Started by user Malick, Asif
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building remotely on SERVERNAMEXYZ123 in workspace D:\Jenkins\workspace\GetUpstreamJob
ERROR: Build step failed with exception
groovy.lang.MissingMethodException: No signature of method: java.lang.Class.getCauses() is applicable for argument types: () values: []
Possible solutions: getClasses(), getClass(), getName(), metaClass(groovy.lang.Closure), metaClass(groovy.lang.Closure), getFields()
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:153)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:158)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:162)
at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
at Script1.writeToPropertyFile(Script1.groovy:10)
at Script1$writeToPropertyFile.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:160)
at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:157)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:158)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:162)
at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
at Script1.run(Script1.groovy:32)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runScript(GroovySandbox.java:162)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:368)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:312)
at hudson.plugins.groovy.SystemGroovy.run(SystemGroovy.java:95)
at hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:59)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
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:1853)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:427)
Build step 'Execute system Groovy script' marked build as failure
Notifying upstream projects of job completion
Finished: FAILURE
EDIT 2 : END
Please let me know in case I missed out on any details. Part of the logic is taken from the internet.
I want an automated deploy to payara server with Jenkins, but I don't know how to achieve this. Could someone please help me?
Maybe I should use docker or any other application to make this job. I used the plugin "deploy war/ear" but this was the error:
C:\Program Files (x86)\Jenkins\workspace\pp1>exit 0
Deploying C:\Program Files (x86)\Jenkins\workspace\pp1\target\despliegue1-1.0-SNAPSHOT.war to container GlassFish 3.x Remote with context
ERROR: Build step failed with exception
org.glassfish.api.admin.InvalidCommandException: V3 cannot process this command at this time, please wait
at com.sun.enterprise.admin.remote.RemoteAdminCommand.fetchCommandModel(RemoteAdminCommand.java:1152)
at com.sun.enterprise.admin.remote.RemoteAdminCommand.getCommandModel(RemoteAdminCommand.java:330)
at com.sun.enterprise.admin.cli.remote.RemoteCommand.prepare(RemoteCommand.java:297)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:242)
at com.sun.enterprise.admin.cli.remote.RemoteCommand.executeAndReturnOutput(RemoteCommand.java:389)
at org.glassfish.deployment.client.RemoteDeploymentFacility$RemoteCommandRunner.run(RemoteDeploymentFacility.java:117)
Caused: java.lang.RuntimeException
at org.glassfish.deployment.client.RemoteDeploymentFacility$RemoteCommandRunner.run(RemoteDeploymentFacility.java:121)
at org.glassfish.deployment.client.AbstractDeploymentFacility.listReferencedTargets(AbstractDeploymentFacility.java:704)
Caused: java.lang.RuntimeException: error submitting remote command
at org.glassfish.deployment.client.AbstractDeploymentFacility.listReferencedTargets(AbstractDeploymentFacility.java:735)
at org.glassfish.deployment.client.AbstractDeploymentFacility.listTargets(AbstractDeploymentFacility.java:693)
at org.glassfish.deployapi.SunDeploymentManager.getTargets(SunDeploymentManager.java:169)
Caused: java.lang.IllegalStateException: error submitting remote command
at org.glassfish.deployapi.SunDeploymentManager.getTargets(SunDeploymentManager.java:171)
at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.findTargetModule(AbstractJsr88Deployer.java:439)
at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.redeploy(AbstractJsr88Deployer.java:197)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:1077)
at hudson.FilePath.act(FilePath.java:1060)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1840)
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 war/ear to a container' marked build as failure
Finished: FAILURE
I use a reportng format to publish the report to the Jira, but I am seeing the nullpointer exception:
java.lang.NullPointerException
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:424)
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:564)
at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:99)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1749)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Build step 'Publish test result to Zephyr for JIRA' marked build as failure
Finished: FAILURE
Do you know why? Or how to fix it?
It seems like an ongoing issue in the Jenkins community. You can subscribe to their JIRA feed for further updates.
I am getting below error while running my build. The build is triggering other builds also and creating and deploying RPMS.
Artifactory plugin version is 2.10.3
FATAL: org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.setConnectionRetries(Ljava/lang/Integer;)V
java.lang.NoSuchMethodError: org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.setConnectionRetries(Ljava/lang/Integer;)V
at org.jfrog.hudson.util.ExtractorUtils.setRetryParams(ExtractorUtils.java:400)
at org.jfrog.hudson.util.ExtractorUtils.setPublisherInfo(ExtractorUtils.java:313)
at org.jfrog.hudson.util.ExtractorUtils.getArtifactoryClientConfiguration(ExtractorUtils.java:155)
at org.jfrog.hudson.util.ExtractorUtils.addBuilderInfoArguments(ExtractorUtils.java:141)
at org.jfrog.hudson.maven3.extractor.MavenExtractorEnvironment.buildEnvVars(MavenExtractorEnvironment.java:139)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:931)
at hudson.maven.AbstractMavenBuild.getEnvironment(AbstractMavenBuild.java:56)
at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:169)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:635)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Please clear Jenkins cache and update
Artifactory-Jenkins-Plugin to the latest version v2.10.4.
I try to build my grails project with jenkins, i'm newbie on jenkins.
first step i get my project from bitbucket,
after i used the grail plugin to build but i have this error :
What's wrong with my configuration, it's not a jenkins user right issue as i could see in several tickets
[mycj] $ /var/jenkins_home/workspace/mycj/grailsw -Dgrails.work.dir=mycj cl
ean --non-interactive --plain-output
FATAL: command execution failed
java.io.IOException: Cannot run program "/var/jenkins_home/workspace/mycj/grailsw" (in directory "/var/jenkins_home/workspace/mycj"): error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:245)
at hudson.Proc$LocalProc.<init>(Proc.java:214)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:846)
at hudson.Launcher$ProcStarter.start(Launcher.java:384)
at hudson.Launcher$ProcStarter.join(Launcher.java:395)
at com.g2one.hudson.grails.GrailsBuilder.perform(GrailsBuilder.java:266)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 15 more
Build step 'Build With Grails' marked build as failure
Finished: FAILURE
It looks like the Jenkins user doesn't have write permission on the working directory.