I have test cases in
/home/name/Develop/myproject/gateway path. I am running tests without any error this path with gulp protractor qa command.
I install jenkins and setted a job. Just name, description and shell command. Here is shell command for build:
cd /home/name/Develop/myproject/gateway && gulp protractor qa
When I try to run this jenkins job I am getting this error on jenkins job console output:
Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/deneme2
[deneme2] $ /bin/sh -xe /tmp/hudson4619805372336742976.sh
+ cd /home/name/Develop/myproject/gateway
+ gulp protractor qa
[14:02:54] Using gulpfile /home/name/Develop/myproject/gateway/gulpfile.js
[14:02:54] Starting 'protractor'...
[14:02:54] Starting 'qa'...
[14:02:54] Finished 'qa' after 93 μs
Using ChromeDriver directly...
[launcher] Running 1 instances of WebDriver
/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/atoms/error.js:108
var template = new Error(this.message);
^
UnknownError: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 4.4.0-47- generic x86_64)
at new bot.Error (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/atoms/error.js:108:18)
at Object.bot.response.checkResponse (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/atoms/response.js:109:9)
at /home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:160:24
at [object Object].promise.Promise.goog.defineClass.invokeCallback_ (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21)
at goog.async.run.processWorkQueue (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/goog/async/run.js:124:15)
at process._tickCallback (node.js:368:9)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)
at new Driver (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/chrome.js:810:36)
at [object Object].DirectDriverProvider.getNewDriver (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/driverProviders/direct.js:68:16)
at [object Object].Runner.createBrowser (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:186:37)
at /home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:276:21
at _fulfilled (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/q/q.js:759:13)
at /home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/q/q.js:525:49
[launcher] Process exited with error code 1
[14:03:55] gulp-notify: [JHipster Gulp Build] Error: protractor exited with code 1
[14:03:55] Finished 'protractor' after 1 min
[14:03:55] E2E Tests failed
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I searched but I couldnt find any solution. Where I am wrong?
Thanks for answers.
I would write a comment, but i'm not allowed to xD
It could be a rights problem. Jenkins does probably not have the rights to access a global installation of gulp or protractor.
Try something like this: ./node_modules/gulp/gulp.js protractor qa
Related
I need to build apache beam using gradle . ./gradlew build . However, I got the following error :
Execution failed for task ':website:buildDockerImage'. > A problem occurred starting process 'command 'docker''
java version : openjdk version "1.8.0_265"
gradle version : Gradle 5.4
By using --info , I got the following :
Caching disabled for task ':website:buildDockerImage' because:
Caching has not been enabled for the task
Task ':website:buildDockerImage' is not up-to-date because:
Task has not declared any outputs despite executing actions.
Starting process 'command 'docker''. Working directory: /home/namenode/beam/website Command: docker build -t beam-website .
:website:buildDockerImage (Thread[Daemon worker Thread 20,5,main]) completed. Took 0.018 secs.
Closing Git repo: /home/namenode/beam/.git
Closing Git repo: /home/namenode/beam/.git
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':website:buildDockerImage'.
> A problem occurred starting process 'command 'docker''
while --stacktrace outputs :
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':website:buildDockerImage'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:200)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:198)
at org.gradle.process.internal.ExecHandleRunner.startProcess(ExecHandleRunner.java:98)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:71)
... more
Caused by: java.io.IOException: Cannot run program "docker" (in directory "/home/namenode/beam/website"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
... 8 more
BUILD FAILED in 1s
1 actionable task: 1 executed
[root#namenode beam]# ./gradlew build
Watching the file system is not supported on this operating system.
Configuration on demand is an incubating feature.
> Task :website:buildDockerImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':website:buildDockerImage'.
> A problem occurred starting process 'command 'docker''
how can I proceed ?
As I'm trying to run a sample jenkins project from my machine. However, I it won't build my project locally.
I outline the set up in this jing video
What did I do wrong?
What specific steps should I use to fix it.
Error message from jenkins
Started by user Jacqueline George
Building in workspace /Users/jacquelinegeorge/.jenkins/$(JENKINS_HOME)/LocatorTraining
[LocatorTraining] $ cmd /c call /var/folders/2s/d8lh31wd3_7dx65htqzvpcv80000gn/T/jenkins6260102670441278278.bat
FATAL: command execution failed
java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
Caused: java.io.IOException: Cannot run program "cmd" (in directory "/Users/jacquelinegeorge/.jenkins/$(JENKINS_HOME)/LocatorTraining"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:249)
at hudson.Proc$LocalProc.<init>(Proc.java:218)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:935)
at hudson.Launcher$ProcStarter.start(Launcher.java:454)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
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:1819)
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 'Execute Windows batch command' marked build as failure
Finished: FAILURE
Build configuration
How I am executing the build
Code after using npm run protractor in shell
Started by user Jacqueline George
Building in workspace /Users/jacquelinegeorge/.jenkins/$(JENKINS_HOME)/LocatorTraining
[LocatorTraining] $ /bin/sh -xe /var/folders/2s/d8lh31wd3_7dx65htqzvpcv80000gn/T/jenkins563599888073808645.sh
+ npm run protractor
npm ERR! path /Users/jacquelinegeorge/.jenkins/$(JENKINS_HOME)/LocatorTraining/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/jacquelinegeorge/.jenkins/$(JENKINS_HOME)/LocatorTraining/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jacquelinegeorge/.npm/_logs/2018-11-13T10_38_04_562Z-debug.log
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I made a modification to the build. I selected 'shell' (as I'm a mac user) not windows batch (as my tutor instructed). I also removed customer workspace from my configuration
Added the following command in 'build'
/Users/JacquelineGeorge/Documents/Jenkins/LocatorTraining&&npm run
protractor
It still failed but this message was at least different.
I also tried this with and without ${JENKINS_HOME} under
General>Advanced>use custom workspace
Building in workspace /Users/jacquelinegeorge/.jenkins/workspace/Protractor
[Protractor] $ /bin/sh -xe /var/folders/2s/d8lh31wd3_7dx65htqzvpcv80000gn/T/jenkins8556486662152409824.sh
+ /Users/jacquelinegeorge/Documents/Jenkins/LocatorTraining
/var/folders/2s/d8lh31wd3_7dx65htqzvpcv80000gn/T/jenkins8556486662152409824.sh: line 2: /Users/jacquelinegeorge/Documents/Jenkins/LocatorTraining: is a directory
Build step 'Execute shell' marked build as failure
Finished: FAILURE
The failure is due to you choose build step of Execute window batch command. But your Jenkins slave machine (where your test script resides) is a linux.
You should choose Execute shell for that build step.
Ok, I'm going to to do a summary of this conversation.
From your project page select configure
Scroll down to build
Under build select shell
enter cd /Users/YourUserNameHere/YourProjectWorkSpace/ProjectFolder/FileName&&npm run protractor
Save
When you click build now. Your project should now build locally from your machine.
When I start the Jenkins build, on arriving on ant-build-step the build is canceled immediately with the following stack:
...
[PROJECT] $ cmd.exe /C "D:\jenkins\tools\hudson.tasks.Ant_AntInstallation\Ant\bin\ant.bat -file build-jenkins.xml -Djenkins.result.dir=${JENKINS.WORKSPACES}/Results "-Dbranch=*/develop" -Djenkins.result.dir=C:/Tools/Jenkins/Results -Djenkins.workspace.dir=C:\Tools\Jenkins\Project-SNAPSHOT\workspace/PRO_56/PRO/java/Project -Dproject.path=C:\Tools\Jenkins\Project-SNAPSHOT\workspace clean.compile.jar.server.snapshot -v && exit %%ERRORLEVEL%%"
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
...
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
I get no debug messages, nothing.
I've got other project with a similar/equal config which work. I think it could be a incompatibility of my plugins.
Has anyone experienced this bug before?
In my case the problem was a big M in the java options of the ant-build-step.
Here no m for Megabit und M für Megabyte.
-Xmx1024M
-Xms1024m
Could you please help with the follow?
Running the protractor test.
Jenkins plugin is not able to generate report.
Error: 404 not found.
Allure plugin: 2.19
Allure commandline: 1.54
Protractor: 5.1.2
Jenkins is run locally: 2.60.1
NodeJS: 6.9.4
NPM: 4.0.5
Error stack trace: allure-report for the report is already in use, add a '--clean' option to overwrite.
Stack trace:
[11:56:19] I/launcher - 0 instance(s) of WebDriver still running
[11:56:19] I/launcher - chrome #01 failed 1 test(s)
[11:56:19] I/launcher - overall: 1 failed spec(s)
[11:56:19] E/launcher - Process exited with error code 1
npm ERR! Test failed. See above for more details.
Build step 'Execute Windows batch command' marked build as failure
[protractor-allure-reporting-example] $ D:\Jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\allure-commandline\allure-2.2.1\bin\allure.bat generate
D:\Jenkins\workspace\protractor-allure-reporting-example\first-result -o
D:\Jenkins\workspace\protractor-allure-reporting-example\allure-report
Allure: Target directory D:\Jenkins\workspace\protractor-allure-reporting-
example\allure-report for the report is already in use, add a '--clean' option to overwrite
ERROR: Build step failed with exception ru.yandex.qatools.allure.jenkins.exception.AllurePluginException: Can not generate Allure Report, exit code: 1
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:173)
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:94)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621)
at hudson.model.Run.execute(Run.java:1760)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:405)
Build step 'Allure Report' marked build as failure
Finished: FAILURE
Seems like you need to clean your workspace before build. Or you can add one more step before report generation that will remove allure-report directory.
Add it in package.json scripts
"posttest": "allure generate allure-results --clean -o allure-report || true && allure report open -o allure-report"
try to check that in the docker container where your allure report generated not able to detect java_home. So try to set your report path where your container ends and then your allure report will able to find java_home.
and able to generate report.
Use below command to check the same:
sh "/var/lib/.../ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/../bin/allure --version"
The Jenkins build job fails every now and then when trying to update the workspace with latest in CVS with the following error:
[EnvInject] - Loading node environment variables.
Building on master in workspace
Using locally configured password for connection to :pserver:myuser#server:/export/home/cvsroot
cvs update -d -P -r HEAD -D 08 Jan 2013 06:29:03 -0500 prjname
ERROR: CVS Command aborted: Aborted during request processing
org.netbeans.lib.cvsclient.command.CommandAbortedException: Aborted during request processing
at org.netbeans.lib.cvsclient.Client.handleResponse(Client.java:673)
at org.netbeans.lib.cvsclient.Client.processRequests(Client.java:598)
at org.netbeans.lib.cvsclient.command.update.UpdateCommand.execute(UpdateCommand.java:347)
at org.netbeans.lib.cvsclient.Client.executeCommand(Client.java:710)
at hudson.scm.AbstractCvs$1.invoke(AbstractCvs.java:243)
at hudson.scm.AbstractCvs$1.invoke(AbstractCvs.java:223)
at hudson.FilePath.act(FilePath.java:842)
at hudson.FilePath.act(FilePath.java:824)
at hudson.scm.AbstractCvs.perform(AbstractCvs.java:223)
at hudson.scm.AbstractCvs.checkout(AbstractCvs.java:140)
at hudson.scm.CVSSCM.checkout(CVSSCM.java:318)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1256)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494)
at hudson.model.Run.execute(Run.java:1502)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
ERROR: Cvs task failed
If I restart the build the update goes through fine.
Jenkins Version : 1.478
Jenkins-CVS Plugin Version : 2.7
The CommandAbortedException you're seeing is being thrown because the code received an InterruptedIOException.
This signifies that the thread threw an InterruptedException whilst trying to communicate with your CVS Server, so either someone has hit the cancel button on your job, or you have a process that's trying to end Java threads.