Build step failed with exception using build timeout plugin - jenkins

I have requirement to implement CI.Following are jenkins configuation details:
Jenkins server 32-bit (window 7)
Maven Integration plugin(version3.0)
Ant Plugin(Version 1.7)
Build Timeout(Version 1.19)
SQLPlus Script Runner( version 1.0.9)
Subversion Plug-in (Version 2.9)
I have following job configutaion:
Configure SVN Repository in Source Code Management step
On Build Environment ->Pre Steps -> using build timeout plugin->Sql script runner for oracle database.
When I executed the job i received following error but if i tried to excute Sql script runner without using build timeout it run smoothly :
ERROR: Build step failed with exception
java.lang.ClassCastException: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build
at hudson.plugins.build_timeout.BuildStepWithTimeout.perform(BuildStepWithTimeout.java:73)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:945)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:683)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
at hudson.model.Run.execute(Run.java:1737)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Build step 'Run with timeout' marked build as failure
Finished: FAILURE
I have tried build timeout with ant script same error message is coming.Please suggest.
Thank you.

Related

Xray for JIRA Jenkins Plugin, TestNG XML Results Import task failure

this is my 1st question, any help will be greatly appreciated.
I need to import test results from Jenkins to Xray.
To do so I:
set up Xray for JIRA Jenkins Plugin;
configured Xray Server/DC integration with Jenkins;
tested connection and it's successful;
went to my Jenkins project configuration and set up post-build Action 'Xray:Result Import Task';
under parameters of 'Xray:Result Import Task' I was trying to specify Execution Report File (file path with file name).
AND here is my question: what exact input is supposed to be here?
I tried URL to my test execution issue already created in Xray, testng.xml. myTestExecution.xml file - nope. Doesn't work. I'm missing smthng here((
Can't get what is meant by:
file path with file name.
My Results Import task fails with error below.
Starting XRAY: Results Import Task...
##########################################################
#### Xray is importing the execution results ####
##########################################################
0 files found. Please make sure the path provided is valid and is not a directory
ERROR: Build step failed with exception
com.xpandit.plugins.xrayjenkins.exceptions.XrayJenkinsGenericException: 0 files found. Please make sure the path provided is valid and is not a directory
at com.xpandit.plugins.xrayjenkins.Utils.FileUtils.getFiles(FileUtils.java:180)
at com.xpandit.plugins.xrayjenkins.task.XrayImportBuilder.perform(XrayImportBuilder.java:563)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:112)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
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:1919)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)
Build step 'Xray: Results Import Task' marked build as failure
Finished: FAILURE
set up Xray for JIRA Jenkins Plugin;
configured Xray Server/DC integration with Jenkins;
tested connection and it's successful;
went to my Jenkins project configuration and set up 2 post-build Actions:
'Publish TestNG Results'
TestNG XML report pattern: **/target/surefire-reports/testng-results.xml
'Xray:Result Import Task':
Jira Instance: Jira Instance;
Format: TestNG XML;
Execution Report File (file path with file name): **/testng-results.xml (generated by 'Publish TestNG Results' action);
Test Execution Key: JIRA-123 (Jira Test execution issue);

Issue in Jenkins integration with GitHub and Ionic project

I am trying to integrate ionic application with Jenkins and i am using GitHub as a repository. When i run the Multibranch pipeline job manually, the Jenkin is displaying below error.
Does anyone know what can be possible issue ? I am trying to learn how CI/CD works with this demo experiment.
I am referring this Youtube video : https://www.youtube.com/watch?v=q5voVJb3rHI&t=605s
Started by user admin
13:42:45 Connecting to https://api.github.com using PrashobThekkyal/*****
Obtained Jenkinsfile from a85fffb01a96c5c5d550326873047c6071557aff
Running in Durability level: MAX_SURVIVABILITY
GitHub has been notified of this commit’s build result
java.lang.IllegalArgumentException: Unsupported class file major version 57
at org.kohsuke.asm6.ClassReader.<init>(ClassReader.java:176)
at org.kohsuke.asm6.ClassReader.<init>(ClassReader.java:158)
at org.kohsuke.asm6.ClassReader.<init>(ClassReader.java:146)
at org.jenkinsci.bytecode.helper.ClassLoadingReferenceTypeHierachyReader.reader(ClassLoadingReferenceTypeHierachyReader.java:64)
at org.jenkinsci.bytecode.helper.TypeHierarchyReader.hierarchyOf(TypeHierarchyReader.java:176)
at org.jenkinsci.bytecode.helper.ClassLoadingReferenceTypeHierachyReader.hierarchyOf(ClassLoadingReferenceTypeHierachyReader.java:39)
at org.jenkinsci.bytecode.helper.TypeHierarchyReader$TypeHierarchy.isAssignableFrom(TypeHierarchyReader.java:321)
at org.jenkinsci.bytecode.helper.TypeHierarchyReader$TypeHierarchy.isAssignableFromAnyInterfaceImplementedBy(TypeHierarchyReader.java:329)
at org.jenkinsci.bytecode.helper.TypeHierarchyReader$TypeHierarchy.isAssignableFrom(TypeHierarchyReader.java:311)
at org.jenkinsci.bytecode.helper.TypeHierarchyReader.isAssignableFrom(TypeHierarchyReader.java:124)
at org.jenkinsci.bytecode.helper.ClassLoadingReferenceTypeHierachyReader.isAssignableFrom(ClassLoadingReferenceTypeHierachyReader.java:39)
at org.jenkinsci.bytecode.helper.TypeHierarchyReader.getCommonSuperClass(TypeHierarchyReader.java:131)
at org.jenkinsci.bytecode.helper.ClassLoadingReferenceTypeHierachyReader.getCommonSuperClass(ClassLoadingReferenceTypeHierachyReader.java:39)
at org.jenkinsci.bytecode.NonClassLoadingClassWriter.getCommonSuperClass(NonClassLoadingClassWriter.java:72)
at org.kohsuke.asm6.SymbolTable.addMergedType(SymbolTable.java:1209)
at org.kohsuke.asm6.Frame.merge(Frame.java:1293)
at org.kohsuke.asm6.Frame.merge(Frame.java:1238)
at org.kohsuke.asm6.MethodWriter.computeAllFrames(MethodWriter.java:1604)
at org.kohsuke.asm6.MethodWriter.visitMaxs(MethodWriter.java:1540)
at org.kohsuke.asm6.tree.MethodNode.accept(MethodNode.java:807)
at org.kohsuke.asm6.commons.JSRInlinerAdapter.visitEnd(JSRInlinerAdapter.java:150)
at org.jenkinsci.bytecode.Transformer$1$1.visitEnd(Transformer.java:109)
at org.kohsuke.asm6.MethodVisitor.visitEnd(MethodVisitor.java:783)
at org.kohsuke.asm6.ClassReader.readMethod(ClassReader.java:1278)
at org.kohsuke.asm6.ClassReader.accept(ClassReader.java:679)
at org.kohsuke.asm6.ClassReader.accept(ClassReader.java:391)
at org.jenkinsci.bytecode.Transformer.transform(Transformer.java:115)
at hudson.ClassicPluginStrategy$AntClassLoader2.defineClassFromData(ClassicPluginStrategy.java:706)
at jenkins.util.AntClassLoader.getClassFromStream(AntClassLoader.java:1310)
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1363)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.jenkinsci.plugins.workflow.cps.CpsScript.<init>(CpsScript.java:69)
at WorkflowScript.<init>(WorkflowScript)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:166)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:404)
at java.base/java.lang.Class.newInstance(Class.java:591)
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:434)
Caused: groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class WorkflowScript. Reason
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:466)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:327)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
Jenkinsfile
pipeline {
agent any
stages {
stage ('Build') {
steps {
echo "Building Multibranch Pipeline"
}
}
stage ('Testing') {
steps {
echo "Testing Multibranch Pipeline"
}
}
stage ('Deployment') {
steps {
echo "False Deploying Multibranch Pipeline"
}
}
}
}
Jenkins Job configuration:
After days of analysis finally I have found the solution. I have did a very basic mistake of not reading version requirement to run Jenkins.
Java requirement to run Jenkins job
As mentioned in above URL, under the section 'Running Jenkins', they have clearly mentioned the support versions of java to run Jenkins job. So I checked java version and it was running on Java 13-a, yes that was stupid, because the Jenkins job will only run with java version 8 and 11.
So degrade your java version to 8 or 11 and it will work smoothly.
Proof
I thought to delete my stupid question, but later I thought to keep it, if in case it could help somebody. Kindly please don't give any kind of (+ve or -vew) points to this post, as it doesn't make any sense.

Jenkins 2.89 SVN Checkout FAILURE java.nio.channels.NonWritableChannelException

All jobs using SVN Checkout are now failing.
Running Jenkins 2.89, SVN 1.92, SUSE 12-SP2
Running Master only
SVN Checkout from a command line window is successful.
Jenkins job receives:
Building in workspace /var/devops/jenkins/jobs/svn test/workspace
Cleaning local Directory CCUMMINGS_TEST_PHASE2
Checking out https://99.999.88.111/MAIN/branches/CCUMMINGS_TEST_PHASE2 at revision '2018-06-12T11:04:05.109 -0700'
FATAL: null
java.nio.channels.NonWritableChannelException
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1127)
at org.tmatesoft.sqljet.core.internal.fs.SqlJetFileLockManager$1.createLock(SqlJetFileLockManager.java:57)
at org.tmatesoft.sqljet.core.internal.fs.SqlJetFileLockManager.createLock(SqlJetFileLockManager.java:81)
at org.tmatesoft.sqljet.core.internal.fs.SqlJetFileLockManager.tryLock(SqlJetFileLockManager.java:102)
at org.tmatesoft.sqljet.core.internal.fs.SqlJetFile.checkReservedLock(SqlJetFile.java:714)
at org.tmatesoft.sqljet.core.internal.pager.SqlJetPager.hasHotJournal(SqlJetPager.java:2484)
at org.tmatesoft.sqljet.core.internal.pager.SqlJetPager.sharedLock(SqlJetPager.java:1251)
at org.tmatesoft.sqljet.core.internal.pager.SqlJetPager.acquirePage(SqlJetPager.java:1020)
at org.tmatesoft.sqljet.core.internal.btree.SqlJetBtree.getMeta(SqlJetBtree.java:2196)
at org.tmatesoft.sqljet.core.internal.table.SqlJetOptions.readSchemaCookie(SqlJetOptions.java:213)
at org.tmatesoft.sqljet.core.internal.table.SqlJetOptions.readMeta(SqlJetOptions.java:148)
at org.tmatesoft.sqljet.core.internal.table.SqlJetOptions.<init>(SqlJetOptions.java:104)
at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine$2.runSynchronized(SqlJetEngine.java:281)
at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.runSynchronized(SqlJetEngine.java:217)
at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.readSchema(SqlJetEngine.java:276)
at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.getOptions(SqlJetEngine.java:299)
at org.tmatesoft.svn.core.internal.wc17.db.SVNWCDbRoot.<init>(SVNWCDbRoot.java:74)
at org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb.parseDir(SVNWCDb.java:1984)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.isVersionedDirectory(SvnOperationFactory.java:1502)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.isVersionedDirectory(SvnOperationFactory.java:1480)
at org.tmatesoft.svn.core.wc.SVNWCUtil.isVersionedDirectory(SVNWCUtil.java:296)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.getImplementation(SvnOperationFactory.java:1318)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1227)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:121)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:168)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:1041)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1017)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:990)
at hudson.FilePath.act(FilePath.java:997)
at hudson.FilePath.act(FilePath.java:975)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:937)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:864)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1724)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Finished: FAILURE
I suspect a password or a credential may be off, but none of them have changed.
a jenkins pipeline job with a script from SVN can be checked out and run but gets the same error.
Any help in debugging or direction to look in would be helpful
Jenkins .xml files had been placed under SVN control using command line svn. Removed .svn files from Jenkins directory and var/devops/jenkins/jobs directory and ../jenkins/jobs directory to resolve the error

hudson.AbortException: No files found in path with configured filemask: output.xml

I was running a RobotFramework script using Jenkins and everything was working fine until I accidentally wiped out my current workspace. I don't know how to restore it and now I'm getting the following error:
Robot results publisher started...
-Parsing output xml:
Failed!
hudson.AbortException: No files found in path C:\Users\EEMIZHA\.jenkins\jobs\3PI RF2\workspace with configured filemask: output.xml
at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:77)
at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:54)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.robot.RobotParser.parse(RobotParser.java:49)
at hudson.plugins.robot.RobotPublisher.parse(RobotPublisher.java:217)
at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:239)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Publish Robot Framework test results' changed build result to FAILURE
Finished: FAILURE
I have the robot plugin installed, I've enabled a "Publish Robot Framework test results" post build action, and I'm executing a very simple Windows Batch Command as follows:
cd C:\Users\EEMIZHA\Documents\3PIManager\Testing\
pybot jenkinsConnectionTest.robot
Any ideas?
Fixed by using a custom workspace in Jenkins set to my \path\to\test (under Advanced Project Options/Advanced...). Run pybot command with -d \path\to\test\output-folder parameter and set output-folder as "Directory of Robot output" in Robot Framework post build action.

Jenkins Post Build Task does not work when job is aborted

I have an issue about Post Build Task after an job abort (manual or timeout): the abort generates a java.lang.InterruptedException which seems to be normal. But as Jenkins java machine is stucked how can you run a post task script? I can't.
here is the java exception:
#174 aborted
java.lang.InterruptedException
at java.lang.ProcessImpl.waitFor(Native Method)
at hudson.Proc$LocalProc.join(Proc.java:319)
at hudson.Launcher$ProcStarter.join(Launcher.java:345)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:82)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at
hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)
at hudson.model.Run.run(Run.java:1438)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)
Here is my jenkins output:
Build was aborted
Aborted by admin
Performing Post build task...
Match found for :. : True
Logical operation result is TRUE
Running script : dir
[workspace] $ cmd /c call C:\Users\xxxx\AppData\Local
\Temp\2hudson5872719646331136420.bat
Exception when executing the batch command : null
Build step 'Post build task' marked build as failure
Finished: ABORTED
I ran a bat script on the server that copied all hudson****.bat from the folder (which is cleaned after the job) during the job execution/aborting so I've been able to run cmd /c call C:\xxxx\hudson5872719646331136420.bat manually from the windows run, it worked fine.
thanks for your help

Resources