{"record":{"id":"db5ff333c4bcbdb8","repo":"apache/pulsar","slug":"failed-to-clone-consumerconfigurationdata","errorCode":null,"errorMessage":"Failed to clone ConsumerConfigurationData","messagePattern":"Failed to clone ConsumerConfigurationData","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConsumerConfigurationData.java","lineNumber":463,"sourceCode":"        checkArgument(interval > 0, \"interval needs to be > 0\");\n        this.autoUpdatePartitionsIntervalSeconds = timeUnit.toSeconds(interval);\n    }\n\n    @JsonIgnore\n    public String getSingleTopic() {\n        checkArgument(topicNames.size() == 1, \"topicNames needs to be = 1\");\n        return topicNames.iterator().next();\n    }\n\n    public ConsumerConfigurationData<T> clone() {\n        try {\n            @SuppressWarnings(\"unchecked\")\n            ConsumerConfigurationData<T> c = (ConsumerConfigurationData<T>) super.clone();\n            c.topicNames = Sets.newTreeSet(this.topicNames);\n            c.properties = new TreeMap<>(this.properties);\n            return c;\n        } catch (CloneNotSupportedException e) {\n            throw new RuntimeException(\"Failed to clone ConsumerConfigurationData\");\n        }\n    }\n\n    /**\n     * Backward compatibility with the old `replicateSubscriptionState` field.\n     * @deprecated Using {@link #getReplicateSubscriptionState()} instead.\n     */\n    @JsonIgnore\n    @Deprecated\n    public boolean isReplicateSubscriptionState() {\n        return replicateSubscriptionState != null && replicateSubscriptionState;\n    }\n}\n","sourceCodeStart":445,"sourceCodeEnd":477,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConsumerConfigurationData.java#L445-L477","documentation":"ConsumerConfigurationData.clone() calls super.clone() inside a try-catch for CloneNotSupportedException and rethrows it as this RuntimeException. In practice Object.clone() never throws CloneNotSupportedException here because ConsumerConfigurationData implements Cloneable, so this is a defensive, effectively-unreachable guard failure.","triggerScenarios":"Called by cloneConf() and createInternalConsumer() when a MultiTopicsConsumerImpl/Reader-based internal consumer needs a defensive copy of its configuration. Only fires if the JVM considers the class non-Cloneable (a bug/JVM-level anomaly, not user input).","commonSituations":"Essentially only seen when constructing a multi-topic consumer or reader from ConsumerConfigurationData if the runtime environment is inconsistent (incompatible bytecode weaving/agent corrupting class flags).","solutions":["Check for bytecode instrumentation agents or shading that could strip/alter the Cloneable interface.","Ensure the client jar and its dependencies come from the same Pulsar version (no mixed-jar classpath corruption).","Rebuild/verify the class against the official artifact; report to Pulsar if reproducible on a clean classpath."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { ConsumerConfigurationData<T> copy = conf.clone(); } catch (RuntimeException e) { /* defensive clone failure: rebuild conf manually */ }","preventionTips":["Keep a single unmodified pulsar-client version on the classpath.","Avoid bytecode agents/shading that rewrite library classes.","Treat this as a JVM/classpath anomaly, not a config problem."],"tags":["clone","internal","unreachable","configuration"],"backgroundTag":"clone-not-supported","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}