{"record":{"id":"a29dcb5c01131433","repo":"BoundaryML/baml","slug":"vsix-file-was-not-created-at-expected-location","errorCode":null,"errorMessage":"VSIX file was not created at expected location","messagePattern":"VSIX file was not created at expected location","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/cli/init.rs","lineNumber":249,"sourceCode":"fn download_vsix(url: &str, filename: &str) -> Result<PathBuf> {\n    let temp_dir = std::env::temp_dir();\n    let vsix_path = temp_dir.join(filename);\n\n    baml_log::info!(\"Downloading BAML extension to: {}\", vsix_path.display());\n\n    // Use curl to download the file\n    let curl_args = vec![\"-L\", \"-o\", vsix_path.to_str().unwrap(), url];\n\n    let output = Command::new(\"curl\").args(&curl_args).output()?;\n\n    if !output.status.success() {\n        let stderr = String::from_utf8_lossy(&output.stderr);\n        anyhow::bail!(\"Failed to download extension: {}\", stderr);\n    }\n\n    // Verify the file was downloaded\n    if !vsix_path.exists() {\n        anyhow::bail!(\"VSIX file was not created at expected location\");\n    }\n\n    Ok(vsix_path)\n}\n\nconst BAML_MDC: &str = include_str!(\"initial_project/baml.mdc\");\n\nfn copy_cursor_rules(dest_path: &std::path::Path) {\n    let cursor_rules_dir = dest_path.join(\".cursor\").join(\"rules\");\n\n    // Create the .cursor/rules directory if it doesn't exist\n    if let Err(e) = fs::create_dir_all(&cursor_rules_dir) {\n        baml_log::info!(\"Could not create .cursor/rules directory: {}\", e);\n        return;\n    }\n\n    let cursor_rules_file = cursor_rules_dir.join(\"baml.mdc\");\n","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/cli/init.rs#L231-L267","documentation":"After curl reports success, download_vsix double-checks that the VSIX file actually exists at the expected path; if not, it bails with this message. This catches cases where curl exited 0 but wrote the file elsewhere (e.g. -o target path unwritable, path resolution issues).","triggerScenarios":"install_extension_manually -> download_vsix when `output.status.success()` is true but `vsix_path.exists()` returns false — target directory missing/unwritable or path mapping mismatch.","commonSituations":"Temp directory permission problems, unusual --dest configurations, sandboxed environments where the temp path isn't visible after the subprocess finishes, disk full with curl silently failing.","solutions":["Check the destination/temp directory exists and is writable (ls the parent directory, check permissions).","Run the curl command manually with the same arguments and inspect where the file lands.","Free disk space if the volume is full.","Install the VSIX manually via `code --install-extension <file>.vsix` as a workaround."],"exampleFix":"// before\nbaml init  // fails: VSIX not created in /tmp\n// after\nTMPDIR=/var/tmp baml init  // use a writable temp dir","handlingStrategy":"validation","validationCode":"# ensure temp dir is writable before init\ntouch \"$TMPDIR/.write_test\" && rm \"$TMPDIR/.write_test\"","typeGuard":null,"tryCatchPattern":"catch (e) {\n  if (String(e.message).includes('VSIX file was not created')) {\n    // check TMPDIR/disk space, then install extension manually\n  }\n}","preventionTips":["Keep default temp dirs writable; avoid exotic TMPDIR in sandboxes.","Monitor disk space in CI runners.","Install the VSIX via `code --install-extension` as a fallback."],"tags":["filesystem","vsix","vscode","cli"],"backgroundTag":"file-not-found","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"}