{"record":{"id":"f8931312ad830674","repo":"BoundaryML/baml","slug":"baml-profile-dir-points-at-which-is-not-a-baml-profiles-v1","errorCode":null,"errorMessage":"BAML_PROFILE_DIR points at {}, which is not a `.baml/profiles-v1` store; remove it manually","messagePattern":"BAML_PROFILE_DIR points at (.+?), which is not a `\\.baml/profiles-v1` store; remove it manually","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"baml_language/crates/baml_cli/src/clean_command.rs","lineNumber":44,"sourceCode":"        match bex_events::prof::backend::clean_profiles_v1(&profiles_root) {\n            Ok(removed) => {\n                let reporter = crate::reporter::Reporter::new();\n                reporter.status(\n                    if removed { \"Removed\" } else { \"Clean\" },\n                    profiles_root.display().to_string(),\n                );\n                Ok(crate::ExitCode::Success)\n            }\n            Err(bex_events::prof::backend::CleanProfilesError::InUse) => {\n                bail!(\"profiling store is in use: {}\", profiles_root.display())\n            }\n            // Cleanup refuses any root not shaped `.../.baml/profiles-v1`,\n            // so it cannot delete an arbitrary BAML_PROFILE_DIR. Say so\n            // instead of surfacing the bare `InvalidRoot`.\n            Err(bex_events::prof::backend::CleanProfilesError::InvalidRoot)\n                if std::env::var_os(\"BAML_PROFILE_DIR\").is_some() =>\n            {\n                bail!(\n                    \"BAML_PROFILE_DIR points at {}, which is not a `.baml/profiles-v1` store; \\\n                     remove it manually\",\n                    profiles_root.display()\n                )\n            }\n            Err(error) => Err(anyhow::Error::new(error).context(format!(\n                \"failed to clean segmented profiler data at {}\",\n                profiles_root.display()\n            ))),\n        }\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":57,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/clean_command.rs#L26-L57","documentation":"baml's profile cleanup deliberately refuses any root not shaped `.../.baml/profiles-v1`, so it will not delete an arbitrary directory pointed to by BAML_PROFILE_DIR. When cleanup returns InvalidRoot and BAML_PROFILE_DIR is set, this error tells you to remove that directory manually.","triggerScenarios":"Running `baml clean` with BAML_PROFILE_DIR set to a path that is not a `.baml/profiles-v1` store, so CleanProfilesError::InvalidRoot is returned and matched by the BAML_PROFILE_DIR guard.","commonSituations":"Pointing BAML_PROFILE_DIR at a custom/experimental location (or a typo'd path) and later trying to clean it; older profile store layouts from previous baml versions left behind.","solutions":["Manually delete the directory: rm -rf \"$BAML_PROFILE_DIR\" (verify contents first).","Unset BAML_PROFILE_DIR and run `baml clean` so it operates on the default `.baml/profiles-v1` store.","Point BAML_PROFILE_DIR at a properly-shaped `<something>/.baml/profiles-v1` directory if you want it managed by clean."],"exampleFix":"# before\nBAML_PROFILE_DIR=/tmp/my-profiles baml clean  # refuses\n# after\nrm -rf /tmp/my-profiles\nunset BAML_PROFILE_DIR && baml clean","handlingStrategy":"validation","validationCode":"# guard before running clean with a custom profile dir\n[ -n \"$BAML_PROFILE_DIR\" ] && [[ \"$BAML_PROFILE_DIR\" == *\".baml/profiles-v1\" ]] || echo \"BAML_PROFILE_DIR must end in .baml/profiles-v1; clean will refuse it\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only point BAML_PROFILE_DIR at paths shaped <root>/.baml/profiles-v1","Unset BAML_PROFILE_DIR when you want default-store cleanup","Treat custom profile dirs as manual-lifecycle artifacts"],"tags":["cli","env-var","profiling","cleanup"],"backgroundTag":"invalid-config-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}