Skip to content

Make local install failures and prerequisites actionable - #507

Open
sdairs wants to merge 1 commit into
issue-456-atomic-installsfrom
issue-462-install-errors-help
Open

Make local install failures and prerequisites actionable#507
sdairs wants to merge 1 commit into
issue-456-atomic-installsfrom
issue-462-install-errors-help

Conversation

@sdairs

@sdairs sdairs commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve the requested path and underlying OS cause when install and atomic staging directories cannot be created.
  • Replace the Linux host tar subprocess with selective in-process extraction using the existing flate2 and tar dependencies, while retaining archive, destination, malformed-input, and missing-binary context.
  • Expand local install --help with version examples, the binary destination, source hosts, the approximate download size, and the bare local server start bootstrap route.

Tests

  • cargo test -p clickhousectl
  • cargo test -p clickhousectl --no-default-features
  • cargo test -p clickhousectl version_manager::install::tests
  • cargo fmt --all --check
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

Stack

Closes #462

Stack created with GitHub Stacks CLIGive Feedback

@sdairs sdairs changed the title issue 462 install errors help Make local install failures and prerequisites actionable Aug 24, 2026
.map_err(extraction_error)?;
std::io::copy(&mut entry, &mut output).map_err(extraction_error)?;
let _ = std::fs::remove_file(tarball_path);
return Ok(());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High version_manager/install.rs:379

A corrupted gzip download can be accepted as an installed clickhouse binary: this return Ok(()) runs immediately after copying the matching entry, so GzDecoder is dropped before validating the gzip trailer CRC and size. For exact versions, install_resolved then commits the corrupted executable without running version detection. Consume and validate the archive to EOF before publishing the output, preferably by writing to a temporary file and renaming it only after validation.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @crates/clickhousectl/src/version_manager/install.rs around line 379:

A corrupted gzip download can be accepted as an installed `clickhouse` binary: this `return Ok(())` runs immediately after copying the matching entry, so `GzDecoder` is dropped before validating the gzip trailer CRC and size. For exact versions, `install_resolved` then commits the corrupted executable without running version detection. Consume and validate the archive to EOF before publishing the output, preferably by writing to a temporary file and renaming it only after validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make local install failures and prerequisites actionable

1 participant