{"record":{"id":"0d26b2509442de63","repo":"BoundaryML/baml","slug":"profiling-store-contains-an-unsupported-file-type","errorCode":null,"errorMessage":"profiling store contains an unsupported file type","messagePattern":"profiling store contains an unsupported file type","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"baml_language/crates/bex_prof_store/src/prof/backend/store.rs","lineNumber":1638,"sourceCode":"                    io::ErrorKind::InvalidData,\n                    \"profiling store contains a symlink\",\n                ));\n            }\n            if file_type.is_dir() {\n                scan(&path, root, total)?;\n            } else if file_type.is_file() {\n                let relative = path.strip_prefix(root).map_err(io::Error::other)?;\n                if relative == Path::new(\"publish.lock\")\n                    || relative == Path::new(\"usage.state\")\n                    || relative == Path::new(\"tmp/usage-state.pending\")\n                {\n                    continue;\n                }\n                *total = total\n                    .checked_add(entry.metadata()?.len())\n                    .ok_or_else(|| io::Error::other(\"profiling usage overflow\"))?;\n            } else {\n                return Err(io::Error::new(\n                    io::ErrorKind::InvalidData,\n                    \"profiling store contains an unsupported file type\",\n                ));\n            }\n        }\n        Ok(())\n    }\n\n    let mut total = USAGE_STATE_BYTES;\n    scan(root, root, &mut total)?;\n    Ok(total)\n}\n\nfn read_usage_state(root: &Path) -> io::Result<u64> {\n    let usage_state_len = usize::try_from(USAGE_STATE_BYTES).expect(\"fixed usage state fits usize\");\n    let mut bytes = Vec::with_capacity(usage_state_len);\n    File::open(root.join(\"usage.state\"))?.read_to_end(&mut bytes)?;\n    if bytes.len() != usage_state_len || &bytes[..8] != USAGE_MAGIC {","sourceCodeStart":1620,"sourceCodeEnd":1656,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/bex_prof_store/src/prof/backend/store.rs#L1620-L1656","documentation":"The recursive store scan only understands directories (which it recurses into), regular files (whose length it adds to the usage total), and symlinks (rejected earlier); anything else hits the else branch and raises InvalidData 'profiling store contains an unsupported file type'. This covers FIFOs, sockets, device nodes, and other non-regular entries.","triggerScenarios":"Scanning a profiling store directory that contains a FIFO, unix socket, device file, or another special filesystem entry created by entry.file_type() that is neither dir, file, nor symlink.","commonSituations":"An in-process server created a socket inside the data directory; a test harness left a named pipe in the store path; a container/runtime mounted a device node into the store directory.","solutions":["Locate the special entry (`find <store-root> ! -type f ! -type d`) and remove it.","Recreate any socket/pipe the application needs in a different directory, outside the profiling store root.","If the entry is required, move the profiling store root to a clean dedicated directory.","Restart the store scan after cleaning; the usage accounting will then succeed."],"exampleFix":"// shell\n// before: store dir contains 'ipc.sock' (socket)\n// after\nrm <store-root>/ipc.sock && find <store-root> ! -type f ! -type d  # expect no output","handlingStrategy":"validation","validationCode":"fn store_has_special_files(root: &Path) -> io::Result<bool> {\n    for entry in walkdir(root) {\n        let ft = entry.file_type()?;\n        if !(ft.is_file() || ft.is_dir()) { return Ok(true); }\n    }\n    Ok(false)\n}","typeGuard":null,"tryCatchPattern":"match scan_store(&root) {\n    Err(e) if e.kind() == io::ErrorKind::InvalidData && e.to_string().contains(\"unsupported file type\") => {\n        remove_special_entries(&root)?; // sockets, fifos, devices\n        scan_store(&root)\n    }\n    other => other,\n}","preventionTips":["Create sockets/FIFOs in a runtime/temp directory, never inside the store root","Audit the store directory for non-regular files in health checks","Keep the profiling store in a dedicated directory no other subsystem writes to"],"tags":["rust","io","filesystem","profiling"],"backgroundTag":"unsupported-operation","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}