v.24.11Improvement

Command-line Applications Update: Non-Zero Exit Codes for Errors

Command-line applications will return non-zero exit codes on errors. In previous versions, the disks application returned zero on errors, and other applications returned zero for errors 256 (PARTITION_ALREADY_EXISTS) and 512 (SET_NON_GRANTED_ROLE). #71623 (Alexey Milovidov).
Improved error handling in ClickHouse command-line applications to return non-zero exit codes for errors consistently.

Why it matters

Previously, some ClickHouse CLI tools like disks would return zero even when errors occurred, and other applications ignored certain error codes (256 for PARTITION_ALREADY_EXISTS and 512 for SET_NON_GRANTED_ROLE). This caused confusion and unreliable error detection in scripts and automation. The update ensures that command-line applications return non-zero exit codes on errors, enabling more robust error handling and clearer failure signals to users and automation systems.

How to use it

No explicit user action is required to enable this behavior. It is applied automatically by the updated command-line applications in ClickHouse. Users will now receive proper non-zero exit codes on errors from tools like disks and others, improving scripting and error management.