Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»unknown error: cannot create temp dir for unpacking extensions when trying to start Chrome from a LOCAL_SYSTEM service

    unknown error: cannot create temp dir for unpacking extensions when trying to start Chrome from a LOCAL_SYSTEM service

    July 2, 2024

    We are trying to get our automated webtests working independently of what version of Chrome we’re using. These automated tests work as follows:

    We have a Karaf container agent running as a service;
    Karaf starts an ant script, which in turn starts another ant script. The first ant script is part of the automation tool we use (our own product) and the second ant script is the actual script that starts our testng webtests;

    TestNg, during the startup, starts the ChromeDriver in the following way using the bonigarcia Webdrivermanager library:

    WebDriverManager.chromedriver().setup();
    // webDriver = new ChromeDriver();
    ChromeOptions options = new ChromeOptions();

    // ChromeDriver is just AWFUL because every version or two it breaks unless you pass cryptic arguments
    //AGRESSIVE: options.setPageLoadStrategy(PageLoadStrategy.NONE); // https://www.skptricks.com/2018/08/timed-out-receiving-message-from-renderer-selenium.html
    options.addArguments(“–enable-automation”); // https://stackoverflow.com/a/43840128/1689770
    options.addArguments(“–headless”); // only if you are ACTUALLY running headless
    options.addArguments(“–no-sandbox”); //https://stackoverflow.com/a/50725918/1689770
    options.addArguments(“–disable-infobars”); //https://stackoverflow.com/a/43840128/1689770
    options.addArguments(“–disable-dev-shm-usage”); //https://stackoverflow.com/a/50725918/1689770
    options.addArguments(“–disable-gpu”); //https://stackoverflow.com/questions/51959986/how-to-solve-selenium-chromedriver-timed-out-receiving-message-from-renderer-exc
    options.addArguments(“–window-size=1920,1080”);
    options.addArguments(“–start-maximized”);
    options.addArguments(“–disable-extensions”);
    options.setExperimentalOption(“useAutomationExtension”, false);
    options.addArguments(“–bwsi”);
    options.addArguments(“–user-data-dir=”+ System.getProperty(“test.web.chrome.data.dir”) +”/user-data-dir”);
    options.addArguments(“–disk-cache-dir=”+ System.getProperty(“test.web.chrome.data.dir”) +”/disk-cache-dir”);
    try {
    File logFile = new File(System.getProperty(“test.web.chrome.data.dir”).replace(“/”, “\”) + “\logs\chromedriver.log”);
    logFile.getParentFile().mkdirs();
    logFile.createNewFile();
    boolean verbose = System.getProperty(“test.web.webdriver.verbose”).equals(“true”);
    ChromeDriverService driverService = new Builder().withVerbose(verbose).withLogFile(logFile).build();

    webDriver = new ChromeDriver(driverService, options);
    } catch (IOException e) {
    LOGGER.error(e);
    webDriver = new ChromeDriver(options);
    }

    The problem we have is that if the Karaf agent is running as the LOCAL_SYSTEM account (which is the default user when creating a new service), the Chromedriver can’t start Chrome with the error:

    unknown error: cannot create temp dir for unpacking extensions

    After some googling and testing, I’ve found this is because when starting the ChromeDriver, it tries to create a temporary folder for unpacking extensions in the user temp directory, which fails because the LOCAL_SYSTEM account doesn’t have a user directory.

    I can work around the issue by making the service run as a LOCAL_SERVICE account, which does have a user directory, but we’ve found that some other scripts that run on this Karaf agent give problems when running as LOCAL_SERVICE (mainly older software integrations that we can’t easily upgrade), so ideally I’m hoping for a solution that makes LOCAL_SYSTEM work.

    Is there a way to fix the temp dir problem that the Chromedriver has when attempting to start Chrome from a LOCAL_SYSTEM service?

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleHow to get text of based on the ?
    Next Article FI-CBL: A Probabilistic Method for Concept-Based Machine Learning with Expert Rules

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 17, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-4831 – TOTOLINK HTTP POST Request Handler Buffer Overflow Vulnerability

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Bill Gates: AI will replace most human jobs within a decade

    Artificial Intelligence

    U.S. Treasury Hamas Spokesperson for Cyber Influence Operations

    Development

    Heatseeker – general-purpose fuzzy selector

    Development

    Unable to capture the alert in Selenium using Python

    Development

    Highlights

    Windows 11 24H2 now fully ready, downloads even if you don’t want it

    May 4, 2025

    Windows 11 version 24H2 will now show up for “download and install” automatically if you…

    Mixtures of In-Context Learners: A Robust AI Solution for Managing Memory Constraints and Improving Classification Accuracy in Transformer-Based NLP Models

    November 8, 2024

    A Comprehensive Review of Survey on Efficient Multimodal Large Language Models

    May 27, 2024

    The best Black Friday deals 2024: Early sales live now

    November 4, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.