-1

When trying to run selenium via jenkins im getting this error: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: No space left on device (os error 28) at path "/tmp/rust_mozprofileO0WZJN" Build info: version: '4.3.0', revision: 'a4995e2c09*' System info: host: 'pic-01-vm-nubo11picmolecule02-01-selenium.novalocal', ip: '172.18.0.39', os.name: 'Linux', os.arch: 'amd64', os.version: '5.14.0-284.18.1.el9_2.x86_64', java.version: '17.0.8'

i tried to chaange the path on the driver

  • 1
    Does this answer your question? [ubuntu "No space left on device" but there is tons of space](https://stackoverflow.com/questions/18706398/ubuntu-no-space-left-on-device-but-there-is-tons-of-space) – Progman Jul 26 '23 at 21:09
  • 1
    Have you actually tried to check if there was space left on your device ? – l -_- l Jul 26 '23 at 21:10

1 Answers1

0

The error message "No space left on device (os error 28)" is pretty straightforward.

The messaage indicates that the /tmp directory does not have enough space left. Selenium uses the /tmp directory to create temporary profiles when it runs tests, as indicated in the error message (os error 28) at path "/tmp/rust_mozprofileO0WZJN".

Carry out command df -h to see the disk usage of your file systems and check the usage of the /tmp directory. If this is indeed teh case, see if you can free up some space.

There is another alternative, as you are using a Firefox browser, you can set the options property to make Selenium use a different path.

The question does not indicate what Selenium language you are using, but below is an illustration for Chrome & Firefox, using Java or Python

Chrome - Java

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class Main {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("user-data-dir=/path/to/your/directory");
        ChromeDriver driver = new ChromeDriver(options);
    }
}

Chrome Python

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("user-data-dir=/path/to/your/directory")

driver = webdriver.Chrome(options=options)

Firefox Java

import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;

public class Main {
    public static void main(String[] args) {
        FirefoxOptions options = new FirefoxOptions();
        options.addPreference("browser.download.dir", "/path/to/your/directory");
        FirefoxDriver driver = new FirefoxDriver(options);
    }
}

Firefox Python

from selenium import webdriver
from selenium.webdriver.firefox.options import Options

options = Options()
options.profile = "/path/to/your/directory"

driver = webdriver.Firefox(options=options)

The above examples should redirect Selenium to store it's temporary profiles to the path specified other than /tmp

N.B. Make sure that the directory specified exists and that Selenium has the necessary permissions to write to it.

djmonki
  • 3,020
  • 7
  • 18