Skip to content

Fix running server remove error message - #363

Open
sdairs wants to merge 1 commit into
issue-342-lossy-positional-flagsfrom
issue-325-running-remove-error
Open

Fix running server remove error message#363
sdairs wants to merge 1 commit into
issue-342-lossy-positional-flagsfrom
issue-325-running-remove-error

Conversation

@sdairs

@sdairs sdairs commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #325

Summary

  • report an actionable stop-first command when removing a running local server
  • preserve the existing start collision wording

Tests

  • cargo test -p clickhousectl --test local_server_stopped_test running_server_remove_has_stop_first_error_and_start_keeps_collision_error -- --exact
  • cargo test -p clickhousectl
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

@sdairs
sdairs requested review from iskakaushik and rndD as code owners August 5, 2026 11:59
@sdairs sdairs changed the title Fix running server remove error (#325) Fix running server remove error message Aug 5, 2026
@sdairs
sdairs requested a review from Copilot August 5, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the error message shown when attempting to remove a running local ClickHouse server, making it actionable (“stop it first …”) while preserving the existing “already running” wording for server start name collisions. This aligns CLI behavior with issue #325’s expected UX without changing the underlying refusal-to-remove logic.

Changes:

  • Introduce a dedicated error variant (ServerRunningCannotRemove) with a stop-first instruction.
  • Update the local server remove handler to return the new error when the target server is running.
  • Add an integration-style regression test covering both remove (new message) and start (existing collision message).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/clickhousectl/tests/local_server_stopped_test.rs Adds a regression test asserting the new stop-first remove error and unchanged start collision error.
crates/clickhousectl/src/local/mod.rs Switches server remove to return the new “running; stop first” error variant when applicable.
crates/clickhousectl/src/error.rs Adds ServerRunningCannotRemove with the expected actionable error message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sdairs
sdairs force-pushed the issue-325-running-remove-error branch from ff90e32 to 419d198 Compare August 5, 2026 18:28
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.

server remove on a running server prints start's error message ("is already running")

2 participants