Skip to main content
The S3Queue table engine keeps its state in ClickHouse Keeper (or ZooKeeper), also when there is only one server. The default configuration of a self-managed server has no connection to ClickHouse Keeper, so creating an S3Queue table fails with NO_ELEMENTS_IN_CONFIG. On a single server, enable the ClickHouse Keeper that is built into clickhouse-server and restart.

The error

Why S3Queue needs ClickHouse Keeper

An S3Queue table registers itself in ClickHouse Keeper and records there which files it has already processed, so that every file is loaded once, also after a restart or when several replicas read the same bucket. The location is the keeper_path table setting, by default a path under /clickhouse/s3queue/. The server takes the address of ClickHouse Keeper from its configuration. When there is none, the statement fails with the error above. This is true for every value of the mandatory mode setting. A table with mode = 'exclusive' does not track processed files, but creating it on a server without ClickHouse Keeper fails with the same error.

Enable the embedded ClickHouse Keeper

Create a file such as /etc/clickhouse-server/config.d/keeper.xml:
  • The keeper_server section starts a one-node ClickHouse Keeper inside the server process. It listens for clients on tcp_port.
  • The zookeeper section tells the server where to connect. If you leave it out, the server connects to the hosts of raft_configuration on tcp_port, which gives the same result here.
Restart the server and run the CREATE TABLE statement again. It now succeeds:
A one-node ClickHouse Keeper inside the server is enough for a single server or a test setup. For a cluster, set it up as described in the ClickHouse Keeper guide.

Notes

  • The table starts reading files only after you attach a materialized view to it, as described in the S3Queue reference.
  • Processed and failed files are logged to system.s3queue_log if the s3queue_log section is present in the server configuration and the table setting enable_logging_to_queue_log is on, which is its default. The log table is created by the first flush: see Why is a system log table missing after I enabled it?.
  • The same missing configuration makes CREATE TABLE ... ENGINE = ReplicatedMergeTree fail with a different message: Can't create replicated table without ZooKeeper. (NO_ZOOKEEPER).