{"record":{"id":"3dc02027d0355f69","repo":"apache/beam","slug":"error-writing-to-clickhouse-retry-attempt","errorCode":null,"errorMessage":"Error writing to ClickHouse. Retry attempt[{}]","messagePattern":"Error writing to ClickHouse\\. Retry attempt\\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/java/io/clickhouse/src/main/java/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.java","lineNumber":645,"sourceCode":"          if (response != null) {\n            LOG.debug(\n                \"Successfully inserted {} rows out of {} into table {}. total size written {} bytes\",\n                response.getWrittenRows(),\n                buffer.size(),\n                table(),\n                response.getWrittenBytes());\n          } else {\n            LOG.debug(\"Successfully inserted {} rows into table {}\", buffer.size(), table());\n          }\n\n          buffer.clear();\n          break;\n        } catch (Exception e) {\n          if (!BackOffUtils.next(Sleeper.DEFAULT, backOff)) {\n            throw new RuntimeException(\"Failed to write to ClickHouse after retries\", e);\n          } else {\n            retries.inc();\n            LOG.warn(RETRY_ATTEMPT_LOG, attempt, e);\n            attempt++;\n          }\n        }\n      }\n    }\n\n    @AutoValue.Builder\n    abstract static class Builder<T> {\n\n      public abstract Builder<T> clickHouseUrl(String clickHouseUrl);\n\n      public abstract Builder<T> database(String database);\n\n      public abstract Builder<T> table(String table);\n\n      public abstract Builder<T> maxInsertBlockSize(long maxInsertBlockSize);\n\n      public abstract Builder<T> schema(TableSchema schema);","sourceCodeStart":627,"sourceCodeEnd":663,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/clickhouse/src/main/java/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.java#L627-L663","documentation":"WARN logged in ClickHouseIO's flush retry loop: an attempt to insert the buffered rows failed and the connector is retrying with exponential backoff (BackOffUtils). If backoff is exhausted the loop rethrows as a runtime exception; this message specifically marks a transient, retryable failure during processElement/finishBundle flushing.","triggerScenarios":"Thrown at sdks/java/io/clickhouse/src/main/java/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.java:645 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Let the built-in retry with backoff handle transient ClickHouse overload","If retries exhaust, check ClickHouse server health/capacity and tune the backoff policy","Batch larger writes to reduce insert pressure"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}