oven-sh/bun · error

Tried to delete root and stopped it

Error message

Tried to delete root and stopped it

What it means

Error "Tried to delete root and stopped it" thrown in oven-sh/bun.

Source

Thrown at src/install/extract_tarball.rs:514

                    directories::cached_github_folder_name_print(
                        &mut bufs.folder_name_buf,
                        resolved,
                        None,
                    )
                    .as_bytes()
                }
                ResolutionTag::LocalTarball | ResolutionTag::RemoteTarball => {
                    directories::cached_tarball_folder_name_print(
                        &mut bufs.folder_name_buf,
                        self.url.slice(),
                        None,
                    )
                    .as_bytes()
                }
                _ => unreachable!(),
            };
            if folder_name.is_empty() || (folder_name.len() == 1 && folder_name[0] == b'/') {
                panic!("Tried to delete root and stopped it");
            }
            let cache_dir = Dir::borrow(&self.cache_dir);

            // e.g. @next
            // if it's a namespace package, we need to make sure the @name folder exists
            let create_subdir = basename.len() != name.len() && !self.resolution.tag.is_git();

            // Now that we've extracted the archive, we rename.
            #[cfg(windows)]
            {
                // Windows EBUSY/SHARING_VIOLATION on `NtSetInformationFile` is
                // transient when a concurrent process (another `bun install`
                // sharing the cache, AV, the Search Indexer) is closing its
                // handle to the destination. Back off briefly between retries.
                const MAX_RETRIES: u32 = 4;
                let mut retries: u32 = 0;
                let mut path2_buf = WPathBuffer::uninit();
                let path2 = strings::to_wpath_normalized(&mut path2_buf, folder_name);

View on GitHub (pinned to 8c5296ac45)

When it happens

Trigger: Thrown at src/install/extract_tarball.rs:514 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/1dc1a3defe8757c1. Report an issue: GitHub.