Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behaviour when bad hash in password_sha256_hex #24126

Closed
Tri0L opened this issue May 14, 2021 · 3 comments · Fixed by #31557
Closed

Unexpected behaviour when bad hash in password_sha256_hex #24126

Tri0L opened this issue May 14, 2021 · 3 comments · Fixed by #31557
Assignees

Comments

@Tri0L
Copy link
Contributor

Tri0L commented May 14, 2021

Describe the unexpected behaviour
If, when creating a user via xml in the password_sha256_hex field, enter an incorrect hash, then ClickHouse will crash without correct error description

How to reproduce

<yandex>
    <users>
        <testuser>
           <password_sha256_hex>a95aff94b1f06ec175c359cd1df425c8bb53a1c9c50596ceed8ecbdba9c5752r</password_sha256_hex>
           <profile>readonly</profile>
        </testuser>
    </users>
</yandex>

Expected behavior
Some human readable error in logs. Maybe just skip this user without crash.

Error message and/or stacktrace
/var/log/clickhouse-server/clickhouse-server.log

2021.05.14 17:26:08.911812 [ 25348 ] {} <Information> Application: Will watch for the process with pid 25350
2021.05.14 17:26:08.911957 [ 25350 ] {} <Information> Application: Forked a child process to watch
2021.05.14 17:26:08.912391 [ 25350 ] {} <Information> SentryWriter: Sending crash reports is disabled
2021.05.14 17:26:08.912513 [ 25350 ] {} <Trace> Pipe: Pipe capacity is 1.00 MiB
2021.05.14 17:26:08.966801 [ 25350 ] {} <Information> : Starting ClickHouse 21.4.3.21 with revision 54449, build id: 4E8F6FDA87D4EEA23848BE55E4AFF2B2E87C8553, PID 25350
2021.05.14 17:26:08.966941 [ 25350 ] {} <Information> Application: starting up
2021.05.14 17:26:09.092420 [ 25350 ] {} <Information> Application: Calculated checksum of the binary: 1C0FC2BE13EADA0AAFC7B8FB103A0FE8, integrity check passed.
2021.05.14 17:26:09.092580 [ 25350 ] {} <Trace> Application: Will do mlock to prevent executable memory from being paged out. It may take a few seconds.
2021.05.14 17:26:09.105372 [ 25350 ] {} <Trace> Application: The memory map of clickhouse executable has been mlock'ed, total 186.13 MiB
2021.05.14 17:26:09.105515 [ 25350 ] {} <Debug> Application: rlimit on number of file descriptors is 500000
2021.05.14 17:26:09.105529 [ 25350 ] {} <Debug> Application: Initializing DateLUT.
2021.05.14 17:26:09.105537 [ 25350 ] {} <Trace> Application: Initialized DateLUT with time zone 'Europe/Moscow'.
2021.05.14 17:26:09.105556 [ 25350 ] {} <Debug> Application: Setting up /var/lib/clickhouse/tmp/ to store temporary data in it
2021.05.14 17:26:09.105657 [ 25350 ] {} <Debug> Application: Skipped file in temporary path /var/lib/clickhouse/tmp/data
2021.05.14 17:26:09.106004 [ 25350 ] {} <Debug> Application: Configuration parameter 'interserver_http_host' doesn't exist or exists and empty. Will use '***' as replica host.
2021.05.14 17:26:09.106179 [ 25350 ] {} <Information> SensitiveDataMaskerConfigRead: 1 query masking rules loaded.
2021.05.14 17:26:09.106975 [ 25350 ] {} <Debug> ConfigReloader: Loading config '/etc/clickhouse-server/config.xml'
2021.05.14 17:26:09.110256 [ 25350 ] {} <Debug> ConfigReloader: Loaded config '/etc/clickhouse-server/config.xml', performing update on configuration
2021.05.14 17:26:09.111302 [ 25350 ] {} <Information> Application: Setting max_server_memory_usage was set to 44.23 GiB (49.14 GiB available * 0.90 max_server_memory_usage_to_ram_ratio)
2021.05.14 17:26:09.112183 [ 25350 ] {} <Debug> ConfigReloader: Loaded config '/etc/clickhouse-server/config.xml', performed update on configuration
2021.05.14 17:26:09.115887 [ 25350 ] {} <Debug> ConfigReloader: Loading config '/etc/clickhouse-server/users.xml'
2021.05.14 17:26:09.116431 [ 25350 ] {} <Debug> ConfigReloader: Loaded config '/etc/clickhouse-server/users.xml', performing update on configuration
2021.05.14 17:26:09.118825 [ 25350 ] {} <Error> Application: std::exception
2021.05.14 17:26:09.118859 [ 25350 ] {} <Information> Application: shutting down
2021.05.14 17:26:09.118870 [ 25350 ] {} <Debug> Application: Uninitializing subsystem: Logging Subsystem
2021.05.14 17:26:09.119059 [ 25351 ] {} <Trace> BaseDaemon: Received signal -2
2021.05.14 17:26:09.119101 [ 25351 ] {} <Information> BaseDaemon: Stop SignalListener thread
2021.05.14 17:26:09.138296 [ 25348 ] {} <Information> Application: Child process exited normally with code 70.

/var/log/clickhouse-server/clickhouse-server.err.log

2021.05.14 17:26:09.118825 [ 25350 ] {} <Error> Application: std::exception

Additional context
ClickHouse version: 21.4.3.21
OS: Ubuntu 16.04

@alexey-milovidov
Copy link
Member

ClickHouse throws exception about incorrect configuration and exits with code 70:

Child process exited normally with code 70.

This is expected behaviour.

@alexey-milovidov
Copy link
Member

But the error message is unclear and this should be improved.

@alexey-milovidov
Copy link
Member

ClickHouse will crash without correct error description

No "crash" happens. Correct termination with error message is not a crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants