xvfb-run: line 171: kill: (25939) - No such process
Asked Answered
I

2

12

All automated test runs successfully. but xvfb issue causes the build failure in Jenkins.

I have used below commnad in ExecuteShell option available under Jenkins to run my test cases on headless browser

/usr/bin/xvfb-run /usr/local/apache-maven-3.3.1/bin/mvn clean test -Dbrowser=firefox 

Getting the below output:

Results :

Tests run: 22, Failures: 0, Errors: 0, Skipped: 0


[INFO] BUILD SUCCESS

[INFO] Total time: 10:19 min

[INFO] Final Memory: 20M/47M


/usr/bin/xvfb-run: line 171: kill: (25939) - No such process

Build step 'Execute shell' marked build as failure

As we can see in the output [INFO] BUILD SUCCESS. But /usr/bin/xvfb-run: line 171: kill: (25939) - No such process causes the builld failure.

Could anybody please provide some workaround for this?

Inequitable answered 28/5, 2015 at 10:42 Comment(6)
What is line 171 of xvfb-run? Is the script online somewhere it can be seen?Mauramauralia
xvfb-run is running a bunch of code. Dont know which line it taking as 171.Inequitable
Does it look roughly like this? The problem is that, for some reason, Xvfb has already died by the time the script tries to kill it and so kill fails. I don't know why that would be. You could modify the script to handle that case but it clearly doesn't think that's something that should generally happen.Mauramauralia
Add "-e /tmp/xvfb.log" to get a log from xvfb. This might help isolate the problem.Fetus
I have this same issue interacting with wkhtmltopdfBroomrape
I have the same problem with bamboo and slimerjsCherri
M
14

I had this same problem when trying to run wkhtmltopdf thru xvfb-run.

In my PHP script, I executed /usr/bin/xvfb-run /usr/bin/wkhtmltopdf ... several times in the same script. The first one always worked, but the second one failed consistently with the same error you posted about.

Adding -e /tmp/xvfb.log to the second command revealed this in the log:

Fatal server error: (EE) Server is already active for display 99 If this server is no longer running, remove /tmp/.X99-lock and start again.

The solution in my case was to add the -a flag to the command:

/usr/bin/xvfb-run -a /usr/bin/wkhtmltopdf ...

Which will tell xvfb-run to "try to get a free server number, starting at --server-num".

Malapert answered 10/2, 2016 at 15:57 Comment(2)
thanks @brian , just for comment .. now that option seems deprecated, the new one is option -d / --auto-displayBroomrape
Oh, didn't know that. What does it change? Thank you.Prorate
R
-3

I could skip the same error using a little trick:

sleep(10);

on my code... after ends a task and slept my PHP code I could run another task without any errors... following my PHP script...

hope it helps

Rorry answered 6/6, 2017 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.