ClickHouse TSV failed to connect / File catalog browsing is not available
Description
Hi,
with the new update ClichHose is not working and file catalog browsing ist not working.
Error: Catalog import failed: ClickHouse TSV upload failed: Failed to connect to localhost port 8123
Cheers
Steps to Reproduce
Start a backup ...
Installation Type
Docker
BBS Version
v2.28.0
Agent Version (if applicable)
v2.25.0
Agent OS (if applicable)
Ubuntu / Debian
Relevant Logs
Error: Catalog import failed: ClickHouse TSV upload failed: Failed to connect to localhost port 8123
Workaroud as mentioned here @ #88 does not solve the issue. On my system there ist only one container (bbs) no Clickhouse container. I restarted bbs but connection to Clickhouse is not working.
Can't reproduce locally — tested fresh v2.28.0 install and an upgrade from v2.27.1 → v2.28.0 reusing the same data volume. ClickHouse starts and binds port 8123 in both cases. ClickHouse version is the same (26.3.9.8) in v2.27.1 and v2.28.0 too, so no upstream version bump is involved.
To narrow this down, please run these from the host and paste the output:
1. Is ClickHouse actually running inside the container?
docker exec <container> sh -c 'pgrep -a clickhouse-server; curl -s http://localhost:8123/ping; echo'
If pgrep returns nothing, ClickHouse crashed during startup. Continue to step 2.
2. What did ClickHouse say when it tried to start?
docker exec <container> tail -200 /var/log/clickhouse-server/clickhouse-server.err.log
This will show the actual reason — usually permission errors, OOM, or config errors.
3. Container resource limits
docker stats --no-stream <container>
ClickHouse needs ~1 GB RAM minimum to start. If your host or container limit is lower, ClickHouse will OOM-kill itself silently.
4. Volume / bind mount type
What does your docker-compose.yml volumes: line look like? Specifically, is /var/bbs a Docker named volume or a bind mount to a host path?
5. What version did you upgrade from?
If it was pre-v2.27.0-beta1 (before the dynamic UID detection landed), there's a chance your existing /var/bbs/clickhouse data dir contents are owned by an old UID that the new container can't write to.
Quick fix if you don't need the existing catalog data:
The catalog can be rebuilt from your borg repos (it's just a search index, not source-of-truth backup data). Resetting it won't lose any backup:
docker compose stop
sudo rm -rf /path/to/your/var/bbs/clickhouse
docker compose start
ClickHouse will reinitialize. After it's running, the next backup will start populating the catalog automatically. If you want to backfill catalogs for existing archives, go to each client → Catalog → Rebuild Catalog.
This is a workaround until we identify the root cause from the diagnostics above.
Thanks for replying.
Ok, lets narrow down:
### Step 1:
docker exec bbs sh -c 'pgrep -a clickhouse-server; curl -s http://localhost:8123/ping; echo'
shows:
pgrep: pattern that searches for process name longer than 15 characters will result in zero matches Try pgrep -f' option to match against the complete command line.`
so i did a:
docker exec bbs sh -c 'pgrep -fa clickhouse-server; curl -s http://localhost:8123/ping; echo'
which shows:
1142 sh -c pgrep -fa clickhouse-server; curl -s http://localhost:8123/ping; echo
As i was not satisfied with this outcome i switched into the container:
docker exec -it <container> /bin/bash
there i did:
root@37205ffb203d:/var/www/html# clickhouse-server
an got this:
`Processing configuration file 'config.xml'.
There is no file 'config.xml', will use embedded config.
2026.04.18 09:52:38.308316 [ 1181 ] {}
- DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000001782e22a
- DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000faf504e
- DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000faf4989
- DB::Exception::Exception<String&>(int, FormatStringHelperImpl<std::type_identity<String&>::type>, String&) @ 0x000000000fb208b6
- DB::assertProcessUserMatchesDataOwner(String const&, std::function<void (PreformattedMessage const&)>) @ 0x00000000179d2d66
- DB::Server::main(std::vector<String, std::allocator
> const&) @ 0x0000000017bee2d8 - Poco::Util::Application::run() @ 0x0000000023cb9971
- DB::Server::run() @ 0x0000000017be1cfa
- mainEntryClickHouseServer(int, char**) @ 0x0000000017bde709
- main @ 0x000000000faec5ea
- ? @ 0x0000000000029ca8
- __libc_start_main @ 0x0000000000029d65
- _start @ 0x0000000009627a2e
(version 26.3.9.8 (official build))
2026.04.18 09:52:38.458788 [ 1181 ] {}
Application: shutting down 2026.04.18 09:52:38.458790 [ 1181 ] {} Application: Uninitializing subsystem: Logging Subsystem 2026.04.18 09:52:38.462831 [ 1185 ] {} BaseDaemon: Received signal -2 2026.04.18 09:52:38.462839 [ 1185 ] {} BaseDaemon: Stop SignalListener thread`
--> I think this is a permission problem?
### Step 2:
docker exec <container> tail -200 /var/log/clickhouse-server/clickhouse-server.err.log
shows nothing.
### Step 3:
docker stats --no-stream <container>
shows
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS 37205ffb203d bbs 1.20% 305.4MiB / 15.62GiB 1.91% 12.1MB / 2.61MB 100MB / 19.8MB 40
### Step 4:
I only use named volumes, my docker-compose.yaml looks like this:
`services: bbs: image: marcpope/borgbackupserver:latest # build: . # uncomment to build locally instead of pulling from Docker Hub container_name: bbs ports: - "${WEB_PORT:-8080}:80" # Web UI - "${SSH_PORT:-2222}:22" # SSH for borg agent connections environment: - APP_URL=${APP_URL:-http://localhost:8080} - SSH_PORT=${SSH_PORT:-2222} # Admin password — only used on first run. Omit to auto-generate (shown in logs). # - ADMIN_PASS=${ADMIN_PASS} volumes: - bbs-data:/var/bbs - bbs-storage-st01:/mnt/bbs-storage-st01 # To store backups on a specific disk or path instead of Docker's internal storage, # replace the line above with a bind mount: # - /mnt/backups:/var/bbs restart: unless-stopped
volumes: bbs-data: # Remove this 'volumes' section entirely if using a bind mount above bbs-storage-st01: driver: local driver_opts: type: nfs o: addr=192.168.10.10,rw,nfsvers=3,nolock device: ":/volume1/BBS-STORAGE"`
### Step 5:
I upgraded from v2.27.0.
Thanks for helping me out and for pointing out the workaround. I think its better to identify the root cause so i'm waiting for your response.
Hi,
I've been following this discussion and I’d like to share my findings as well, as they might help narrow down the root cause.
I am running BBS in a Docker environment using bind-mounts, while @bekaha is using named volumes. Since we are both seeing the same error, it's possible that the issue is independent of the volume driver or mount type.
In my environment:
- I first noticed the catalog browsing issue on v2.28.0 and v2.28.1.
- I tried the suggested downgrade to v2.27.0, but the problem persisted for me.
- The catalog only became functional again after I downgraded to v2.26.7.
Based on the logs shared above, there might be a regression or a slight conflict in the UID/GID logic introduced in recent versions (perhaps around the v2.27.0-beta changes). It seems the ClickHouse process is struggling to reconcile its effective user with the data ownership on disk, regardless of how the storage is mounted.
I hope this helps in identifying where the issue might be.
Thanks to both of you — the detail made this reproducible. Fix is in 6cddc98 on main (not released yet).
Root cause: /var/bbs/clickhouse/* on your persistent volume is owned by www-data instead of clickhouse. An older image build ran chown -R www-data:www-data /var/bbs at some point, and those ownerships carried forward across container rebuilds. ClickHouse refuses to start when it's asked to run as clickhouse but the data is owned by a different user:
Code: 430. DB::Exception: Effective user of the process (clickhouse) does not match the owner of the data (www-data). (MISMATCHING_USERS_FOR_PROCESS_AND_DATA)
The current entrypoint's ensure_dir only chowns the top-level directory, and the UID migration only triggers when the recorded .ownership file disagrees with env vars, so the filesystem-level mismatch slipped through. The 2>/dev/null on the startup line then hid the error, which is why @bekaha saw nothing in the logs.
What the fix does: on every container start, scan /var/bbs/clickhouse and /var/bbs/mysql with find for any entry owned by the wrong user/group. If found, repair it recursively. On a clean volume the check short-circuits in ~4ms and does nothing. Also stops swallowing ClickHouse's stderr and adds an explicit post-start ping check, so the next time something like this happens the logs will say so.
Immediate workaround (no need to wait for the next release):
docker exec <container> chown -R clickhouse:clickhouse /var/bbs/clickhouse
docker restart <container>
@erycsonero — this explains why 2.26.7 worked for you: before that version's UID changes, clickhouse was running as whatever user owned the data by happenstance; after, it became strict about the mismatch. Same underlying volume state, same fix.
I applied your immediate workaround. After restarting the docker container catalog rebuilding started immediately. This fixed it for me. Thanks
Thank you for the quick turnaround and the detailed explanation, @marcpope!
I can confirm that the fix in v2.28.2 works perfectly. Instead of applying the manual workaround, I updated my image tag from :v2.26.7 to :latest (v2.28.2), and the entrypoint successfully repaired the ownership issues on my bind-mount setup.
The file catalog is now fully functional again, and the transition from v2.26.7 to the latest version was seamless. I really appreciate the prompt fix and the improved error logging—it makes the project much more robust for those of us managing larger infrastructures.
Great job!