ClickHouse 19.9.4.34 cannot start if /etc/localtime a is symlink.

Created on 11 Jul 2019  路  4Comments  路  Source: ClickHouse/ClickHouse

Describe the bug
ClickHouse cannot start if /etc/localtime is a symlink.

How to reproduce

  • Build and install ClickHouse server version 19.9.4.34 on CentOS 7.
  • Run su -m -s /bin/sh clickhouse -c '/usr/bin/clickhouse-server --config-file=/etc/clickhouse-server/config.xml' (config is default)

Expected behavior
ClickHouse should start.

Error message and/or stacktrace

Logging trace to /var/log/clickhouse-server/clickhouse-server.log
Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
Logging trace to console
Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = Exception: Could not determine local time zone: boost::filesystem::canonical: No such file or directory: "/etc/usr/share/zoneinfo/UTC" (version 19.9.4.34)
Aborted

Additional context
/etc/localtime is a symlink on CentOS (and may be some other distros):

# ls -l /etc/localtime
lrwxrwxrwx 1 root root 25 Mar  5 17:36 /etc/localtime -> ../usr/share/zoneinfo/UTC
# strings /etc/localtime
TZif2
TZif2
UTC0
bug comp-datetime st-fixed

All 4 comments

Also it looks like at least in this case time zone could be determined just reading /etc/localtime content. No need to look where symlink is pointing to, but probably it will not work for non-UTC timezones.

https://github.com/yandex/ClickHouse/commit/4e1286e1e562d7ec3e7ddf51fb982a5b75359bd1

This commit didn't make it to 19.9, needs to be backported.

But I strongly recommend to upgrade to 19.11 instead.

Was this page helpful?
0 / 5 - 0 ratings