-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir #1155
Comments
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
No matter how uniquely I regenerate --user-data-dir, I keep encountering an error saying "already in use" when making a POST request to http://localhost:9515/session. chromedriver version : ChromeDriver 132.0.6834.84 (c1a6c2d428b5b484febdecda9475aba38de5a502-refs/branch-heads/6834@{#3391}) When I run dusk:chrome-driver --detect, it installs version 83, and even after updating to the latest version, the issue persists. but The same source works fine when run on another Mac machine. chrom |
Can you try using Chrome for Testing: https://developer.chrome.com/blog/chrome-for-testing It would be impossible to solve this without a reliable way to replicate the issue. |
I'm facing the same issue. Have you figured it out yet? |
Ok i solved it by adding 'no-sandbox' to the driver options: # DuskTestCase.php
/**
* Create the RemoteWebDriver instance.
*/
protected function driver(): RemoteWebDriver
{
$options = (new ChromeOptions)->addArguments(collect([
$this->shouldStartMaximized() ? '--start-maximized' : '--window-size=1920,1080',
'--disable-search-engine-choice-screen',
])->unless($this->hasHeadlessDisabled(), function (Collection $items) {
return $items->merge([
'--disable-gpu',
'--headless=new',
'--no-sandbox',
]);
})->all());
return RemoteWebDriver::create(
$_ENV['DUSK_DRIVER_URL'] ?? env('DUSK_DRIVER_URL') ?? 'http://127.0.0.1:9515',
DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY, $options
)
);
} |
The permission issue arose due to installing the Dracula theme for oh-my-zsh. |
Dusk Version
10.48.25
Laravel Version
10.4
PHP Version
8.3.14
PHPUnit Version
10.0.1
Database Driver & Version
Mysql 8.0
Description
Error message : session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
protected function driver(): RemoteWebDriver
{
$options = (new ChromeOptions)->addArguments(collect([
$this->shouldStartMaximized() ? '--start-maximized' : '--window-size=1920,1080',
])->unless($this->hasHeadlessDisabled(), function (Collection $items) {
return $items->merge([
'--disable-gpu',
'--headless=new',
'--no-sandbox'
]);
})->all());
}
Steps To Reproduce
The text was updated successfully, but these errors were encountered: