windmill-labs/windmill · error

could not create initial worker dir

Error message

could not create initial worker dir

What it means

Startup panic in run_workers: DirBuilder::create().expect() failed while creating one of the language cache directories (PY312/PY313/BUN/GO/RUST/CSHARP/NU/HUB/POWERSHELL/JAVA/RUBY/R caches, etc.). It is a fatal, process-aborting environment error — the cache root is unwritable or the filesystem refuses directory creation — not a per-job failure.

Source

Thrown at backend/src/main.rs:2332

        &*PY312_CACHE_DIR,
        &*PY313_CACHE_DIR,
        &*BUN_BUNDLE_CACHE_DIR,
        &*GO_CACHE_DIR,
        &*GO_BIN_CACHE_DIR,
        &*RUST_CACHE_DIR,
        &*CSHARP_CACHE_DIR,
        &*NU_CACHE_DIR,
        &*HUB_CACHE_DIR,
        &*POWERSHELL_CACHE_DIR,
        &*JAVA_CACHE_DIR,
        &*RUBY_CACHE_DIR,
        &*R_CACHE_DIR,
        &*TAR_JAVA_CACHE_DIR, // for related places search: ADD_NEW_LANG
    ] {
        DirBuilder::new()
            .recursive(true)
            .create(x)
            .expect("could not create initial worker dir");
    }

    tracing::info!(
        "Starting {num_workers} workers and SLEEP_QUEUE={}ms",
        windmill_worker::sleep_queue()
    );

    for i in 1..(num_workers + 1) {
        let wk_conf = &workers[i as usize - 1];
        let conn1 = wk_conf.conn.clone();
        let worker_name = wk_conf.worker_name.clone();
        WORKERS_NAMES.write().await.push(worker_name.clone());
        let rx = killpill_rxs.pop().unwrap();
        let tx = tx.clone();
        let base_internal_url = base_internal_url.clone();
        let hostname = hostname.clone();

        handles.push(tokio::spawn(async move {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Verify the worker's cache base dir (e.g. /tmp/windmill-cache or the configured BASE_CACHE_DIR env) is writable by the worker user
  2. Check disk space and inode availability on that filesystem
  3. In containers, ensure the cache path is a writable volume and the user has mkdir permissions
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at backend/src/main.rs:2332 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/e85ef7cf2d8559b3. Report an issue: GitHub.