ClickHouse / ClickHouse/ClickHouse

Don't ask for default user password when upgrading via apt

Open
#86,164 1 comment 1 reaction 0 assignees View on GitHub
comp-build-system external unexpected behaviour
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

### Company or project name

_No response_

### Describe the unexpected behaviour

When installing Clickhouse on Debian for the first time, it asks for a password for the default user. This is ok.
However if you _choose_ to have an empty password, it still asks again during an upgrade. This does not really make sense from an administrative perspective. If you have chosen to have an empty password, there are very few cases if any, in which you would want to change this during an upgrade.

```
Creating clickhouse group if it does not exist.
groupadd -r clickhouse
groupadd: group 'clickhouse' already exists
Creating clickhouse user if it does not exist.
useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse clickhouse
useradd: user 'clickhouse' already exists
Will set ulimits for clickhouse user in /etc/security/limits.d/clickhouse.conf.
Config file /etc/clickhouse-server/config.xml already exists, will keep it and extract path info from it.
/etc/clickhouse-server/config.xml has /data/clickhouse/ as data path.
/etc/clickhouse-server/config.xml has /var/log/clickhouse-server/ as log path.
Users config file /etc/clickhouse-server/users.xml already exists, will keep it and extract users info from it.
Log directory /var/log/clickhouse-server/ already exists.
Data directory /data/clickhouse/ already exists.
Pid directory /var/run/clickhouse-server already exists.
chown -R clickhouse:clickhouse '/var/log/clickhouse-server/'
chown -R clickhouse:clickhouse '/var/run/clickhouse-server'
chown clickhouse:clickhouse '/data/clickhouse/'
Set up the password for the default user:
Password for the default user is an empty string. See /etc/clickhouse-server/users.xml and /etc/clickhouse-server/users.d to change it.
```

The upgrade process detects `users.xml` already exists, so it should be able to detect that you chose to not set a password.

### Which ClickHouse versions are affected?

All

### How to reproduce

N/a

### Expected behavior

When upgrading Clickhouse with apt, do not ask to set the default user password even if it is not set.

### Error message and/or stacktrace

_No response_

### Additional context

Yes, I am aware of `DEBIAN_NONINTERACTIVE`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.