Ubuntu upgrade changes Clickhouse default user password
Description
This is not really a BBS issue, however when I did an Ubuntu OS upgrade via "apt update" and "apt upgrade", it appears the default user password for Clickhouse was changed.
On subsequent BBS client plan runs, I see the following error: Catalog import failed: ClickHouse TSV insert failed (401): Code: 194. DB::Exception: default: Authentication failed: password is incorrect, or there is no user with such name If you use ClickHouse Cloud, the password can be reset at https://clickhouse.cloud/ on the settings page for the corresponding service. If you have installed ClickHouse and forgot password you can reset it in the configuration file. The password for default user is typically located at /etc/clickhouse-server/users.d/default-password.xml and deleting this file will reset the password. See also /etc/clickhouse-server/users.xml on the server where ClickHouse is installed. . (REQUIRED_PASSWORD) [file: 0640 bbs-xxxxx11197521b, www-data readable: yes] | gate-diag: user=uid=1002(bbs-xxxxx) gid=1002(bbs-xxxxx) groups=1002(bbs-xxxxx),1133(www-data) / target=/var/bbs/home/5/.catalog-logs/catalog-39254.jsonl / dir_perms=drwxrws--- bbs-xxxxx:www-data / mount=ext2/ext3 / created: -rw-rw-r-- bbs-xxxxx:www-data 11197521 bytes / chgrp=ok final=-rw-r----- bbs-xxxxx:www-data.
Looks like I need to reset the clickhouse user password or synchronize it with what BBS expects.
Steps to Reproduce
Portions of the upgrade snipped out for brevity. I have the entire upgrade transcript if needed. BBS was operating correctly before the OS upgrade.
cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.4 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.4 LTS (Noble Numbat)"
apt update
Hit:1 https://repo.zabbix.com/zabbix/7.0/ubuntu noble InRelease
Hit:2 https://packages.clickhouse.com/deb stable InRelease
Hit:3 http://archive.ubuntu.com/ubuntu noble InRelease
Get:4 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Hit:5 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:6 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Get:7 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1400 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble-updates/main Translation-en [310 kB]
Get:9 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [1706 kB]
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
72 packages can be upgraded. Run 'apt list --upgradable' to see them.
apt upgrade
Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following NEW packages will be installed: linux-firmware-amd-graphics linux-firmware-amd-misc linux-firmware-broadcom-wireless linux-firmware-intel-graphics linux-firmware-intel-misc linux-firmware-intel-wireless linux-firmware-marvell-prestera linux-firmware-marvell-wireless linux-firmware-mediatek linux-firmware-mellanox-spectrum linux-firmware-misc linux-firmware-netronome linux-firmware-nvidia-graphics linux-firmware-qlogic linux-firmware-qualcomm-graphics linux-firmware-qualcomm-misc linux-firmware-qualcomm-wireless linux-firmware-realtek The following packages will be upgraded: apparmor apport apport-core-dump-handler base-files ca-certificates clickhouse-client clickhouse-common-static clickhouse-server cloud-init console-setup console-setup-linux distro-info-data firmware-sof-signed gir1.2-glib-2.0 iproute2 keyboard-configuration kpartx krb5-locales libapache2-mod-php8.3 libapparmor1 libaudit-common libaudit1 libglib2.0-0t64 libglib2.0-bin libglib2.0-data libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 liblzma5 libnetplan1 libopeniscsiusr libplymouth5 libproc2-0 libprotobuf-lite32t64 libxmlb2 linux-base linux-firmware multipath-tools netplan-generator netplan.io open-iscsi php8.3 php8.3-cli php8.3-common php8.3-curl php8.3-intl php8.3-mbstring php8.3-mysql php8.3-opcache php8.3-readline php8.3-xml php8.3-zip plymouth plymouth-theme-ubuntu-text procps python-apt-common python3-apport python3-apt python3-distupgrade python3-netplan python3-problem-report python3-software-properties snapd software-properties-common systemd-hwe-hwdb thermald ubuntu-drivers-common ubuntu-release-upgrader-core xz-utils zabbix-agent zabbix-release 72 upgraded, 18 newly installed, 0 to remove and 0 not upgraded.
Do you want to continue? [Y/n] y Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 base-files amd64 13ubuntu10.5 [73.2 kB]
Get:4 https://packages.clickhouse.com/deb stable/main amd64 clickhouse-server amd64 26.9.24.8 [460 kB]
Get:25 https://packages.clickhouse.com/deb stable/main amd64 clickhouse-client amd64 26.9.24.8 [429 kB]
Get:36 https://packages.clickhouse.com/deb stable/main amd64 clickhouse-common-static amd64 26.9.24.8 [266 MB]
Fetched 975 MB in 46s (21.2 MB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 125147 files and directories currently installed.)
Preparing to unpack .../base-files_13ubuntu10.5_amd64.deb ...
Unpacking base-files (13ubuntu10.5) over (13ubuntu10.4) ...
debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline
Preparing to unpack .../22-clickhouse-server_26.9.24.8_amd64.deb ... Unpacking clickhouse-server (26.9.24.8) over (26.4.2.10) ... Preparing to unpack .../23-clickhouse-client_26.9.24.8_amd64.deb ... Unpacking clickhouse-client (26.9.24.8) over (26.4.2.10) ... Preparing to unpack .../24-clickhouse-common-static_26.9.24.8_amd64.deb ... Unpacking clickhouse-common-static (26.9.24.8) over (26.4.2.10) ...
Preparing to unpack .../26-php8.3-zip_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-zip (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../27-php8.3-xml_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-xml (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../28-php8.3-readline_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-readline (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../29-php8.3-opcache_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-opcache (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../30-php8.3-mysql_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-mysql (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../31-php8.3-mbstring_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-mbstring (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../32-php8.3-intl_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-intl (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../33-php8.3-curl_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-curl (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../34-libapache2-mod-php8.3_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking libapache2-mod-php8.3 (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../35-php8.3-cli_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-cli (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ... Preparing to unpack .../36-php8.3-common_8.3.6-0ubuntu0.24.04.13_amd64.deb ... Unpacking php8.3-common (8.3.6-0ubuntu0.24.04.13) over (8.3.6-0ubuntu0.24.04.12) ...
Setting up linux-base (4.5ubuntu9+24.04.2) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline
Setting up clickhouse-common-static (26.9.24.8) ... Setting up php8.3-common (8.3.6-0ubuntu0.24.04.13) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Dialog
Setting up php8.3-mysql (8.3.6-0ubuntu0.24.04.13) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline
Setting up clickhouse-server (26.9.24.8) ... Installing new version of config file /etc/clickhouse-keeper/keeper_config.xml ... Installing new version of config file /etc/clickhouse-server/config.xml ... Installing new version of config file /etc/clickhouse-server/users.xml ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline ClickHouse binary is already located at /usr/bin/clickhouse Symlink /usr/bin/clickhouse-server already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-server to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-client already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-client to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-local already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-local to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-benchmark already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-benchmark to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-obfuscator already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-obfuscator to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-compressor already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-compressor to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-format already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-format to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-extract-from-config already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-extract-from-config to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-keeper already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-keeper to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-keeper-converter already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-keeper-converter to /usr/bin/clickhouse. Symlink /usr/bin/clickhouse-chdig already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse. Creating symlink /usr/bin/clickhouse-chdig to /usr/bin/clickhouse. Symlink /usr/bin/chdig already exists. Will keep it. Symlink /usr/bin/ch already exists. Will keep it. Symlink /usr/bin/chl already exists. Will keep it. Symlink /usr/bin/chc already exists. Will keep it. 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 /var/lib/clickhouse/ as data 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 /var/lib/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' '/var/lib/clickhouse/' Set up the password for the default user: xxxxxxxxxx Password for the default user is saved in file /etc/clickhouse-server/users.d/default-password.xml. Setting capabilities for clickhouse binary. This is optional. chown -R 'clickhouse':'clickhouse' '/etc/clickhouse-server'
ClickHouse has been successfully installed.
Restart clickhouse-server with: sudo clickhouse restart --pid-path /var/run/clickhouse-server --config-path /etc/clickhouse-server --binary-path /usr/bin
Start clickhouse-client with: clickhouse-client --password
Synchronizing state of clickhouse-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install enable clickhouse-server
Installation Type
Docker
BBS Version
2.98.6
Agent Version (if applicable)
2.98.6
Agent OS (if applicable)
CentOS / RHEL
Relevant Logs
Catalog import failed: ClickHouse TSV insert failed (401): Code: 194. DB::Exception: default: Authentication failed: password is incorrect, or there is no user with such name If you use ClickHouse Cloud, the password can be reset at https://clickhouse.cloud/ on the settings page for the corresponding service. If you have installed ClickHouse and forgot password you can reset it in the configuration file. The password for default user is typically located at /etc/clickhouse-server/users.d/default-password.xml and deleting this file will reset the password. See also /etc/clickhouse-server/users.xml on the server where ClickHouse is installed. . (REQUIRED_PASSWORD) [file: 0640 bbs-xxxxx:www-data 11197521b, www-data readable: yes] | gate-diag: user=uid=1002(bbs-xxxxx) gid=1002(bbs-xxxxx) groups=1002(bbs-xxxxx),1133(www-data) / target=/var/bbs/home/5/.catalog-logs/catalog-39254.jsonl / dir_perms=drwxrws--- bbs-xxxxx:www-data / mount=ext2/ext3 / created: -rw-rw-r-- bbs-xxxxx:www-data 11197521 bytes / chgrp=ok final=-rw-r----- bbs-xxxxx:www-data
Thanks for the full transcript, it made this easy to pin down. apt upgrade moved ClickHouse from 26.4 to 26.9, and the new package's setup asked for a password for the default user. BBS connects as that user without a password, so every catalog import now gets rejected. Your backups themselves are fine; only the file catalog is missing for the runs since the upgrade.
To fix it:
sudo rm /etc/clickhouse-server/users.d/default-password.xml
sudo systemctl restart clickhouse-server
sudo apt-mark hold clickhouse-common-static clickhouse-server clickhouse-client
The first two remove the password. The third stops apt upgrade from moving ClickHouse again. You can stay on 26.9 as long as it runs; I wouldn't downgrade, since ClickHouse doesn't promise its data files work on an older version.
Then, for each affected repository, open it and use Maintenance → Rebuild Catalog → Missing to index the recovery points that were skipped.
New installs have held these packages since 2.66.0, but bbs-update never added the hold to older ones. It does now, and it also warns if ClickHouse starts asking for a password. That will be in the next release.
Hey Marc, thank you so much for your usual speedy and thorough response - worked perfectly. Have a great weekend! AP