Unable to find finalize.sh file inside jibri container - jitsi

I'm trying to use finalize.sh file to rename the recording once the recording is completed. I'm running jibri docker container. for testing purpose I'm just printing the value of RECORDINGS_DIR to check whether the finalize.sh script works or not. it didn't work and I'm getting below error in jibri container logs:
2020-08-23 20:37:25.679 INFO: [40] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Quitting selenium
2020-08-23 20:37:25.707 INFO: [40] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Participants in this recording: []
2020-08-23 20:37:25.764 INFO: [40] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Leaving call and quitting browser
2020-08-23 20:37:25.764 INFO: [40] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Recurring call status checks cancelled
2020-08-23 20:37:25.775 INFO: [40] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Got 8 log entries for type browser
2020-08-23 20:37:25.831 INFO: [40] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Got 695 log entries for type driver
2020-08-23 20:37:25.912 INFO: [40] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Got 0 log entries for type client
2020-08-23 20:37:25.912 INFO: [40] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Leaving web call
2020-08-23 20:37:26.059 INFO: [40] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Quitting chrome driver
2020-08-23 20:37:26.138 INFO: [40] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Chrome driver quit
2020-08-23 20:37:26.139 INFO: [40] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Finalizing the recording
2020-08-23 20:37:26.142 SEVERE: [40] org.jitsi.jibri.service.impl.FileRecordingJibriService.finalize() Failed to run finalize script: java.io.IOException: Cannot run program "/config/jibri/finalize.sh": error=2, No such file or directory with stack:
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
org.jitsi.jibri.util.ProcessWrapper.start(ProcessWrapper.kt:87)
org.jitsi.jibri.service.impl.FileRecordingJibriService.finalize(FileRecordingJibriService.kt:207)
org.jitsi.jibri.service.impl.FileRecordingJibriService.stop(FileRecordingJibriService.kt:192)
org.jitsi.jibri.JibriManager.stopService(JibriManager.kt:257)
org.jitsi.jibri.api.xmpp.XmppApi.handleStopJibriIq(XmppApi.kt:256)
org.jitsi.jibri.api.xmpp.XmppApi.handleJibriIq(XmppApi.kt:162)
org.jitsi.jibri.api.xmpp.XmppApi.handleIq(XmppApi.kt:146)
org.jitsi.xmpp.mucclient.MucClient.handleIq(MucClient.java:547)
org.jitsi.xmpp.mucclient.MucClient.access$500(MucClient.java:50)
org.jitsi.xmpp.mucclient.MucClient$2.handleIQRequest(MucClient.java:511)
org.jivesoftware.smack.AbstractXMPPConnection$4.run(AbstractXMPPConnection.java:1188)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
2020-08-23 20:37:26.144 INFO: [40] org.jitsi.jibri.status.JibriStatusManager.log() Busy status has changed: BUSY -> IDLE
2020-08-23 20:37:26.145 INFO: [40] org.jitsi.jibri.api.xmpp.XmppApi.updatePresence() Jibri reports its status is now JibriStatus(busyStatus=IDLE, health=OverallHealth(healthStatus=HEALTHY, details={})), publisshing presence to connections
2020-08-23 20:37:26.146 FINE: [40] org.jitsi.xmpp.mucclient.MucClientManager.log() Setting a presence extension: org.jitsi.xmpp.extensions.jibri.JibriStatusPacketExt#531027d0
2020-08-23 20:37:26.146 FINE: [40] org.jitsi.xmpp.mucclient.MucClientManager.log() Replacing presence extension: org.jitsi.xmpp.extensions.jibri.JibriStatusPacketExt#30f60b25
2020-08-23 20:37:26.154 INFO: [56] org.jitsi.jibri.JibriManager.stopService() No service active, ignoring stop
But when I checked the finalize.sh script inside the container, it is there.
root#e18b455c2622:/# cat /config/jibri/finalize.sh
#! /usr/bin/bash
RECORDINGS_DIR=$1
echo "Recording dir is: $RECORDINGS_DIR"
Jibri compose file snippet
JIBRI_FINALIZE_RECORDING_SCRIPT_PATH: "/config/jibri/finalize.sh"
I tried to change the file permission too but it didn't work.
Please help.

Related

Timed out connecting to Chrome, giving up error - EC2 instance jenkins running selenium tests

I'm receiving the following error when trying to run my selenium tests through an ec2 instance using Jenkins.
Running the tests locally works fine.
The output of the logs:
[[1;34mINFO[m] -------------------------------------------------------
[[1;34mINFO[m] T E S T S
[[1;34mINFO[m] -------------------------------------------------------
[[1;34mINFO[m] Running [1mTestSuite[m
[main] INFO com.DefaultTest - BeforeClass start
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 106.0.5249.61 (resolved driver for Chrome 106)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /var/lib/jenkins/.cache/selenium/chromedriver/linux64/106.0.5249.61/chromedriver
Starting ChromeDriver 106.0.5249.61 (511755355844955cd3e264779baf0dd38212a4d0-refs/branch-heads/5249#{#569}) on port 42525
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Oct 11, 2022 11:13:53 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Oct 11, 2022 11:13:55 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 106, so returning the closest version found: a no-op implementation
Oct 11, 2022 11:13:55 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Unable to find CDP implementation matching 106.
Oct 11, 2022 11:13:55 PM org.openqa.selenium.chromium.ChromiumDriver lambda$new$3
WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.1.3` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
[main] INFO com.page.MainApp - URL: data:,
[main] INFO com.DefaultTest - AfterClass start
[main] INFO com.DefaultTest - BeforeClass start
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 106.0.5249.61 (resolved driver for Chrome 106)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /var/lib/jenkins/.cache/selenium/chromedriver/linux64/106.0.5249.61/chromedriver
Starting ChromeDriver 106.0.5249.61 (511755355844955cd3e264779baf0dd38212a4d0-refs/branch-heads/5249#{#569}) on port 50463
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[1665530123.403][WARNING]: Timed out connecting to Chrome, retrying...
[1665530132.591][WARNING]: Timed out connecting to Chrome, retrying...
[1665530149.634][WARNING]: Timed out connecting to Chrome, giving up.
[1665530156.893][WARNING]: Timed out connecting to Chrome, retrying...
[1665530166.364][WARNING]: Timed out connecting to Chrome, retrying...
[1665530186.944][WARNING]: Timed out connecting to Chrome, giving up.
Build timed out (after 3 minutes). Marking the build as failed.
[[1;34mINFO[m]
[[1;34mINFO[m] Results:
[[1;34mINFO[m]
[[1;34mINFO[m] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[[1;34mINFO[m]
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] [1;31mBUILD FAILURE[m
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] Total time: 03:07 min
[[1;34mINFO[m] Finished at: 2022-10-11T23:16:40Z
I'm not sure how to resolve this.
I have google chrome and chromedriver on the same version (v106).
I've attempted adding countless arguments that people have suggested, but still can't get it to run successfully

Having problem when running Selenium Maven project via Jenkins

Same project works fine locally.
Error details:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dorg.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator.websocketConnectionTimeout=60
Running TestSuite
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Sep 22, 2021 1:46:44 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
/home/jenkins/.cache/selenium/chromedriver/linux64/x.x.x.x/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
Sep 22, 2021 1:47:05 PM org.openqa.selenium.os.OsProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127)
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 31.459 sec <<< FAILURE! - in TestSuite
Test1(test.newTest) Time elapsed: 30.295 sec <<< FAILURE!
org.openqa.selenium.WebDriverException:
Timed out waiting for driver server to start.
Build info: version: '3.141.59', revision: 'XXX', time: '2018-11-14T08:17:03'
System info: host: 'xxx', ip: 'x.x.x.x', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-1160.6.1.el7.x86_64', java.version: '11.0.10'
Driver info: driver.version: ChromeDriver
at test.newTest.Test1(newTest.java:48)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:27178/status] to be available after 20007 ms
at test.newTest.Test1(newTest.java:48)
Caused by: java.util.concurrent.TimeoutException
at test.newTest.Test1(newTest.java:48)
Results :
Failed tests:
newTest.Test1:48 ยป WebDriver Timed out waiting for driver server to start.
Bui...
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
Question:
Using chromedriver as Maven dependency in pom.xml file. Do I need to install Chrome browser on machine where Jenkins (on Linux) is installed ? I would really appreciate help on this.

getting error when executing the selenium testng tests in jenkins job in centos7.6 VM

I am able to execute the tests in windows properly, but when I create the jenkins job in centos7.6 VM and the jenkins job console output shows the below error.
This is what I have defined in the code:
{
System.setProperty("webdriver.chrome.driver", "/tmp/chromedriver_linux");
}
driver = new ChromeDriver();
Below is the error:
enter code here Test01(com.training.multi.browser.testing.MultiTests) Time elapsed: 2.164 sec <<< FAILURE!
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=75.0.3770.140 (2d9f97485c7b07dc18a74666574f19176731995c-refs/branch-heads/3770#{#1155}),platform=Linux 3.10.0-957.27.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.66 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.27.2.el7.x86_64', java.version: '1.8.0_222'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at com.training.multi.base.BaseTest.getDriver(BaseTest.java:19)
at com.training.multi.browser.testing.MultiTests.Test01(MultiTests.java:36)`
There are a couple of additional steps you need to take in order to make test running in Jenkins on Linux via setting extra ChromeOptions
Make sure to add --headless argument as systems running Jenkins normally don't have GUI
If you're running Jenkins as root user you also need to set --no-sandbox option
Something like:
ChromeOptions options = new ChromeOptions();
options.addArguments(Arrays.asList("--headless", "--no-sandbox"));
options.setBinary("/path/to/chromedriver");
ChromeDriver driver = new ChromeDriver(options);
Also make sure that the user has appropriate permissions in order to launch the chromedriver binary, if not - grant them using chmod command like:
chmod +x /tmp/chromedriver_linux
More information: How to use Jenkins pipeline to launch Selenium tests
(unknown error: DevToolsActivePort file doesn't exist)
This error is caused when there is incompatibility in version of chrome and chromedriver you are using. Upgrade chrome browser on your centos machine and download the new chrome version compatible chromedriver.

How to fix this Selenium Error: bind() failed: Cannot assign requested address (99)

I've installed the latest version of selenium via Docker:
docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:latest
and then ran this in my python console:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = webdriver.Remote("http://127.0.0.1:4444/wd/hub", DesiredCapabilities.CHROME)
and finally checked the docker logs:
2019-04-24 19:09:26,880 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
2019-04-24 19:09:26,881 INFO supervisord started with pid 8
2019-04-24 19:09:27,865 INFO spawned: 'xvfb' with pid 11
2019-04-24 19:09:27,867 INFO spawned: 'selenium-standalone' with pid 12
19:09:28.038 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
2019-04-24 19:09:28,039 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-04-24 19:09:28,039 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
19:09:28.093 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2019-04-24 19:09:28.126:INFO::main: Logging initialized #247ms to org.seleniumhq.jetty9.util.log.StdErrLog
19:09:28.289 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
19:09:28.349 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
19:09:43.631 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "chrome",
"version": ""
}
19:09:43.633 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29}) on port 22103
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1556132983.659][SEVERE]: bind() failed: Cannot assign requested address (99)
19:09:44.266 INFO [ProtocolHandshake.createSession] - Detected dialect: OSS
19:09:44.490 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session cedc7067c0133f6492ff65dda5c7dd88 (org.openqa.selenium.chrome.ChromeDriverService)
In particular, I'm unsure of how to fix this error:
[1556132983.659][SEVERE]: bind() failed: Cannot assign requested address (99)
I'm running this on my macbook pro using Mojave with the latest version of docker, python, and selenium. I also tried using other ports aside from 4444, same result. Thanks!
We have seen that entry in the logs for a long time, however, there is no evidence it affects your tests. The message comes directly from ChromeDriver/Chrome. It is safe to ignore it.

Chrome Selenium WebDriver failing with timeouts

I have a windows service that periodically runs through a bunch of pages to collect information.
Things are more or less working however a large number of them have been getting timeout errors.
About 70 run at a time on a machine with 24 logical processors and more than enough memory.
I am using Chrome 51.0.2704.84 (64-bit) with ChromeDriver 2.22.397933.
The error is:
2016-06-17 09:26:11.3590|ERROR|11548|117|Unable to execute work request|MessageHandlerException: timeout: cannot determine loading status
from timeout: Timed out receiving message from renderer: -0.006
(Session info: chrome=51.0.2704.84)
(Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64) ---> OpenQA.Selenium.WebDriverTimeoutException: timeout: cannot determine loading status
from timeout: Timed out receiving message from renderer: -0.006
(Session info: chrome=51.0.2704.84)
(Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.set_Url(String value)
Any thoughts?
Use setTimePageLoadTimeOut(TimeSpan.Minvalue);
My Config is 2.53 selenium and chrome 51 and windows server 2012
Had issue with timeout(My test site is very slow)
Used this so far its working