ClickHouse Authentication Fix
Problem
You were unable to connect to ClickHouse via DBeaver and Signoz registration was failing because:
- ClickHouse Authentication: Newer versions of ClickHouse require a password for the
defaultuser when connecting from external clients (like DBeaver) - Empty Password: The docker-compose configuration had
CLICKHOUSE_PASSWORD: ""(empty string), which ClickHouse rejects - Signoz Connection: Signoz Query Service couldn't authenticate to ClickHouse, causing registration failures
Solution
Changes Made
- Set ClickHouse Password in
docker-compose.dev.yml:
yaml
environment:
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-default}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-clickhouse123}
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: '1' # Enable network access
- Updated Signoz Query Service connection string to include credentials:
yaml
ClickHouseUrl: tcp://${CLICKHOUSE_USER:-default}:${CLICKHOUSE_PASSWORD:-clickhouse123}@clickhouse:9000?database=signoz
-
Updated OTEL Collector DSN strings to include credentials
-
Added environment variables to
env.development.example:bash CLICKHOUSE_USER=default CLICKHOUSE_PASSWORD=clickhouse123
How to Apply the Fix
Step 1: Update Environment File
If you have a .env.development file, add:
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=clickhouse123
Or copy from example:
cp env.development.example .env.development
Step 2: Restart ClickHouse and Signoz Services
# Stop existing containers
docker compose -f docker-compose.dev.yml stop clickhouse signoz-query-service signoz-otel-collector
# Remove ClickHouse volume (if you want fresh start with new password)
# WARNING: This will delete all existing data!
docker compose -f docker-compose.dev.yml down -v clickhouse
# Start services with new configuration
docker compose -f docker-compose.dev.yml up -d clickhouse signoz-query-service signoz-otel-collector signoz-frontend
Step 3: Verify Connection
Test ClickHouse Connection via HTTP:
curl 'http://localhost:8123/?user=default&password=clickhouse123' -d 'SELECT 1'
Should return: 1
Test via DBeaver:
- Connection Settings:
- Host:
localhost - Port:
8123(HTTP) or9000(Native) - Database:
signoz - Username:
default -
Password:
clickhouse123 -
JDBC URL (for Generic JDBC):
jdbc:clickhouse://localhost:8123/signoz?user=default&password=clickhouse123
Test Signoz Registration:
- Go to http://localhost:3301/signup
- Fill in registration form
- Should now work without authentication errors
Why This Happened
ClickHouse Security Model
- Default Behavior: ClickHouse's
defaultuser has no password by default - Network Access: However, network access for
defaultis disabled unless: - A password is explicitly set, OR
- Access management is explicitly enabled
- Version Changes: Newer ClickHouse versions (25.x) enforce stricter authentication requirements
The Error Message Explained
The error you saw:
Authentication failed: password is incorrect, or there is no user with such name.
(REQUIRED_PASSWORD)
This means:
- ClickHouse detected a connection attempt from an external client (DBeaver)
- The
defaultuser requires a password for network access - No password was provided (empty string), so authentication failed
Security Notes
⚠️ For Production:
- Use a strong, unique password
- Store credentials in environment variables or secrets manager
- Consider creating dedicated users with minimal privileges
- Enable SSL/TLS for connections
✅ For Development:
- The default password
clickhouse123is acceptable - Can be changed via
CLICKHOUSE_PASSWORDenvironment variable
Troubleshooting
If Signoz still can't connect:
- Check ClickHouse logs:
bash
docker logs clickhouse
- Verify password is set:
bash
docker exec clickhouse clickhouse-client --query "SELECT 1" --user default --password clickhouse123
- Check Signoz Query Service logs:
bash
docker logs signoz-query-service
- Verify environment variables:
bash docker exec signoz-query-service env | grep CLICKHOUSE
If DBeaver still can't connect:
- Verify port mapping: Check that ports 8123 and 9000 are exposed
- Try HTTP interface first: Use port 8123 with HTTP driver
- Check firewall: Ensure Docker ports are accessible
- Try native interface: Use port 9000 with native ClickHouse driver
Alternative: Passwordless Access (Not Recommended)
If you really want passwordless access (development only), you can:
- Remove password requirement in ClickHouse config (requires custom config file)
- Use
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: "1"without password (less secure)
However, setting a password is the recommended approach and what we've implemented.