-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[exporter/clickhouse] create database fail if clickhouse cluster #36540
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
It looks like I was in a hurry to claim that the database is being created with a standalone clickhouse server. The database was successfully created with version otelcol 0.95. And I did not check the creation of the database on version 0.114.0 with standalone clickhouse. So it was in this issue: #23664 |
I ran the otelcol version 0.95 with the same configuration and the database was created on standalone clickhouse server. |
Hey! Thanks for submitting this. Could be a duplicate of #35713, check that thread and see if you can provide similar debugging info and I can look into it |
The problem is not the clickhouse cluster. clickhouse-server.err.log: 2024.11.28 11:56:25.949781 [ 19974 ] {} <Error> ServerErrorHandler: Code: 81. DB::Exception: Database otel does not exist. (UNKNOWN_DATABASE), Stack trace (when copying this message, always include the lines below):
0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000d176d5b
1. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x0000000007dabdec
2. DB::Exception::Exception<String>(int, FormatStringHelperImpl<std::type_identity<String>::type>, String&&) @ 0x0000000007dab92b
3. DB::DatabaseCatalog::assertDatabaseExists(String const&) const @ 0x0000000010bfafab
4. DB::Context::setCurrentDatabase(String const&) @ 0x0000000010b51e12
5. DB::TCPHandler::runImpl() @ 0x00000000125236e7
6. DB::TCPHandler::run() @ 0x000000001253a238
7. Poco::Net::TCPServerConnection::start() @ 0x00000000153190e7
8. Poco::Net::TCPServerDispatcher::run() @ 0x0000000015319579
9. Poco::PooledThread::run() @ 0x00000000152e6521
10. Poco::ThreadImpl::runnableEntry(void*) @ 0x00000000152e4add
11. ? @ 0x00007ffa18282ac3
12. ? @ 0x00007ffa18314850
(version 24.8.7.41 (official build)) And absolutely nothing in the query_log. /etc/otelcol/config.yaml: receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
cors:
allowed_origins:
- "https://*.somedomain.com:3000"
- "https://*.somedomain.com"
endpoint: 0.0.0.0:4318
tls:
cert_file: /etc/otelcol/cert.crt
key_file: /etc/otelcol/privkey.key
processors:
batch:
exporters:
clickhouse:
endpoint: tcp://127.0.0.1:9000
username: admin
password: password
database: otel
logs_table_name: otel_logs
traces_table_name: otel_traces
metrics_table_name: otel_metrics
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [clickhouse] |
I ran the 0.95 collector with the same configuration, it created the otel database. |
Component(s)
exporter/clickhouse
What happened?
Description
OTel collector can't start with clickhouse exporter when clickhouse cluster in config and the database doesn't exist.
OTel collector starts successfully if there is a standalone clickhouse server in the configuration, the database is successfully created.
If clickhouse cluster:
Error: cannot start pipelines: create database: code: 81, message: Database otel does not exist
collector server run finished with error: cannot start pipelines: create database: code: 81, message: Database otel does not exist
Steps to Reproduce
Describe the connection to the clickhouse cluster in the exporter.
Expected Result
Successful database creation
Actual Result
OTel collector can't start with error: Database otel does not exist
Collector version
0.114.0
Environment information
Environment
OS: Ubuntu 22.04.5 LTS
Compiler(if manually compiled): go version go1.22.1 linux/amd64
OpenTelemetry Collector configuration
Log output
Additional context
I tried to connect clickhouse clusters with versions:
ClickHouse server version 23.8.9.54 (official build) with Zookeeper.
ClickHouse server version 24.8.7.41 (official build) with ClickHouseKeeper.
The text was updated successfully, but these errors were encountered: