From 658c9fecf67242f01ce3fddbc53e1bdbdd520d3d Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Mon, 11 Aug 2025 14:29:35 +0200 Subject: [PATCH] Changed profile folder + catch connection error --- app/Browser/BrowserJob.php | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/app/Browser/BrowserJob.php b/app/Browser/BrowserJob.php index 3ee5976..802a81d 100644 --- a/app/Browser/BrowserJob.php +++ b/app/Browser/BrowserJob.php @@ -161,23 +161,29 @@ abstract class BrowserJob implements ShouldQueue '--disable-setuid-sandbox', '--whitelisted-ips=""', '--disable-dev-shm-usage', - '--user-data-dir=/home/seluser/profile/nigga', // seems that selenium doesn't like docker having a volume on the exact same folder ("session not created: probably user data directory is already in use") + '--user-data-dir=/home/seluser/profile', // seems that selenium doesn't like docker having a volume on the exact same folder ("session not created: probably user data directory is already in use"). Does not seems like it, maybe whn the browser change version ? ])->all()); - return RemoteWebDriver::create( - config("dusk.driver.url", 'http://localhost:9515'), - DesiredCapabilities::chrome()->setCapability( - ChromeOptions::CAPABILITY, - $options - ) - ->setCapability('timeouts', [ - 'implicit' => 20000, // 20 seconds - 'pageLoad' => 300000, // 5 minutes - 'script' => 30000, // 30 seconds - ]), - 4000, - $this->timeout * 1000 - ); + try { + return RemoteWebDriver::create( + config("dusk.driver.url", 'http://localhost:9515'), + DesiredCapabilities::chrome()->setCapability( + ChromeOptions::CAPABILITY, + $options + ) + ->setCapability('timeouts', [ + 'implicit' => 20000, // 20 seconds + 'pageLoad' => 300000, // 5 minutes + 'script' => 30000, // 30 seconds + ]), + 4000, + $this->timeout * 1000 + ); + } catch (Exception $e) { + Log::error("Failed to create RemoteWebDriver: " . $e->getMessage()); + AllNotification::send(new JobDebugNotification($this->jobId, "Failed to create RemoteWebDriver: " . $e->getMessage())); + throw $e; + } } public function terminate() {