<#22453 sandboxer failure with socket path exceeds...
# github-notifications
c
#22453 sandboxer failure with socket path exceeds ~108 characters Issue created by cburroughs Describe the bug The spiffy new sandboxer https://www.pantsbuild.org/blog/2025/06/29/introducing-the-sandboxer creates a socket at (by default)
<buildroot>/.pants.d/workdir/sandboxer/sandboxer.sock
. When I try to enable the sandboxer in my repo and run any goals I get
IntrinsicError: materialize_directory() request to sandboxer process failed: transport error
Digging details I can see in `.pants.d/workdir/sandboxer/sandboxer.log`:
Copy code
6559 2025-07-02T14:24:45.933Z [INFO] Starting up sandboxer with RUST_LOG=INFO and these options: Opt {
    socket_path: "/tmp/sand/oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo/example-python/.pants.d/workdir/sandboxer/sandboxer.sock",
    store_options: StoreCliOpt {
        local_store_path: Some(
            "/home/ecsb/.cache/pants/lmdb_store",
        ),
        cas_server: None,
        remote_instance_name: None,
        cas_root_ca_cert_file: None,
        cas_client_certs_file: None,
        cas_client_key_file: None,
        cas_oauth_bearer_token_path: None,
        upload_chunk_bytes: 3145728,
        store_rpc_retries: 3,
        store_rpc_concurrency: 128,
        store_batch_api_size_limit: 4194304,
        header: [],
    },
}
Error: Error { kind: InvalidInput, message: "path must be shorter than SUN_LEN" }
I could not figure out how to get a backtrace for the error, but from the paucity of search results for the error string I believe it is coming from: https://github.com/rust-lang/rust/blame/master/library/std/src/os/unix/net/addr.rs#L43
SUN_LEN
is not defined there, but from
unix(7)
on Linux: "The sun_family field always contains AF_UNIX. On Linux, sun_path is 108 bytes in size; see also BUGS, below." (And I think the limit on BSD and friends is 104 https://man.freebsd.org/cgi/man.cgi?unix(4)) Outline of a reproduction: Using
exempt-python
with:
Copy code
diff --git a/pants.toml b/pants.toml
index 3edccd3..a7d259f 100644
--- a/pants.toml
+++ b/pants.toml
@@ -2,7 +2,7 @@
 # Licensed under the Apache License, Version 2.0 (see LICENSE).
 
 [GLOBAL]
-pants_version = "2.26.0"
+pants_version = "2.27.0"
 backend_packages.add = [
   "pants.backend.build_files.fmt.black",  
   "pants.backend.python",
@@ -12,6 +12,7 @@ backend_packages.add = [
   "pants.backend.python.lint.isort",
   "pants.backend.python.typecheck.mypy",
 ]
+sandboxer=true
 
 [anonymous-telemetry]
 enabled = true
I can run
pants fmt
if the repo is in
/tmp/sand/example-python
but not if it is in
/tmp/sand/oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo/example-python
Copy code
$ pwd
/tmp/sand/oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo/example-python
 $ pants fmt ::
10:45:27.27 [INFO] Completed: Scheduling: Test binary /usr/bin/bash.
10:45:27.29 [ERROR] 1 Exception encountered:

Engine traceback:
  in `fmt` goal

IntrinsicError: materialize_directory() request to sandboxer process failed: transport error
Pants version 2.27.0 OS Linux. Additional info
.pants.d/workdir/sandboxer/sandboxer.sock
is already 41 characters, so there is not a lot of room left, particularly in CI environments that often have long checkout paths (actions/runner#1676) Initial suggestion: Move the
sandboxer.sock
to something like
/var/run/pants/<fixed-len-hash-of-buildroot>/sandboxer.sock
pantsbuild/pants