Clickhouse with S3 not accessiable by Langfuse web and worker containers #12759
-
Describe your questionI wish to use S3 Blob Storage as Clickhouse disk for my on premise langfuse server setup on AWS EC2. My Clickhouse container has to use the AWS EC2 instance profile for authenticating to S3. My clickhouse config.xml looks like this: But I found out the the Clickhouse container was not able to use the AWS EC2 instance profile to authenticate to S3 until I made a change in docker-compose.yml to include network_mode: host for the clickhouse container config. After this, I could see that the Clickhouse container did start successfully and could see some data being populated in my S3 folder. But, the langfuse containers were not able to access the clickhouse container. When I started the containers I could see this warning next to my clickhouse container:
Any help here is much appreciated. Langfuse Cloud or Self-Hosted?Self-Hosted If Self-Hostedv3.155.1 OSS If Langfuse CloudNo response SDK and integration versionsNo response Pre-Submission Checklist
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
The issue you're encountering is a networking conflict: when you use This creates a problem because the Langfuse web and worker containers are trying to reach ClickHouse via Docker's internal network (e.g., Solution OptionsOption 1: Use host networking for all containers If ClickHouse requires host networking for EC2 instance profile credentials, you could also set Option 2: Pass AWS credentials explicitly to ClickHouse Instead of relying on the EC2 instance profile via host networking, you can explicitly provide AWS credentials to the ClickHouse container. In your config.xml, replace This allows ClickHouse to remain on Docker's bridge network, keeping it accessible to the Langfuse containers via the internal hostname. Option 3: Use a credentials proxy or IAM Roles Anywhere If you need to maintain the EC2 instance profile approach without host networking, you could explore using a credentials proxy service that runs on the host and is accessible to containers, or AWS IAM Roles Anywhere for container-based credential retrieval. The recommended approach for most self-hosted setups is Option 2 - explicitly passing credentials - as it maintains Docker's internal networking and keeps the configuration simpler.(1) 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
The issue you're encountering is a networking conflict: when you use
network_mode: hostfor ClickHouse, the container shares the host's network stack directly, which means it no longer participates in Docker's internal networking and the published ports are discarded.(1)This creates a problem because the Langfuse web and worker containers are trying to reach ClickHouse via Docker's internal network (e.g.,
http://clickhouse:8123), but ClickHouse is now only accessible via the host's network interface.Solution Options
Option 1: Use host networking for all containers
If ClickHouse requires host networking for EC2 instance profile credentials, you could also set
network_mode: hostfor the L…