{"record":{"id":"e638b3abe1806632","repo":"apache/flink","slug":"invalid-cluster-id-s-the-expected-format-is-0","errorCode":null,"errorMessage":"Invalid cluster id \"%s\". The expected format is [0-9a-fA-F]{32}, e.g. fd72014d4c864993a2e5a9287b4a9c5d.","messagePattern":"Invalid cluster id \"(.+?)\"\\. The expected format is \\[0-9a-fA-F\\](.+?), e\\.g\\. fd72014d4c864993a2e5a9287b4a9c5d\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-clients/src/main/java/org/apache/flink/client/deployment/application/ApplicationJobUtils.java","lineNumber":122,"sourceCode":"                            PipelineOptionsInternal.PIPELINE_FIXED_JOB_ID,\n                            new JobID(\n                                            Preconditions.checkNotNull(\n                                                            configuration.get(\n                                                                    HighAvailabilityOptions\n                                                                            .HA_CLUSTER_ID))\n                                                    .hashCode(),\n                                            0)\n                                    .toHexString());\n                }\n            }\n        }\n    }\n\n    private static String checkClusterId(String str) {\n        try {\n            ApplicationID.fromHexString(str);\n        } catch (IllegalArgumentException e) {\n            throw new IllegalArgumentException(\n                    \"Invalid cluster id \\\"\"\n                            + str\n                            + \"\\\". The expected format is [0-9a-fA-F]{32}, e.g. fd72014d4c864993a2e5a9287b4a9c5d.\");\n        }\n        return str;\n    }\n\n    /**\n     * Returns the job count limits for the given configuration.\n     *\n     * @param config The configuration to get the job count limits from\n     * @return A tuple of (total job count limit, streaming job count limit)\n     */\n    public static Tuple2<Integer, Integer> getJobCountLimits(Configuration config) {\n        if (config.get(DeploymentOptions.SUBMIT_FAILED_JOB_ON_APPLICATION_ERROR)) {\n            // When enabled, this option ensures that if the application fails before any job is\n            // submitted, a synthetic failed job is submitted for diagnostics. To provide a stable\n            // and predictable job ID, only a single job is allowed in the main method. Therefore,","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/deployment/application/ApplicationJobUtils.java#L104-L140","documentation":"Thrown by ApplicationJobUtils.checkClusterId when ApplicationID.fromHexString(str) throws an IllegalArgumentException, meaning the cluster ID string does not conform to the expected 32-character hexadecimal format (e.g., fd72014d4c864993a2e5a9c5d). This check runs when application mode derives a fixed JobID from the HA cluster ID. The HA cluster ID must be a valid ApplicationID (32 hex chars) for the job ID derivation to succeed.","triggerScenarios":"Setting high-availability.cluster-id to a non-hex or wrong-length string; using a custom cluster ID that doesn't match the ApplicationID hex format; the cluster ID is auto-generated incorrectly by a deployment plugin.","commonSituations":"Manual configuration of high-availability.cluster-id with a human-readable name instead of a hex hash; custom Kubernetes deployment scripts that set the cluster ID to the Kubernetes namespace or a short name.","solutions":["Set high-availability.cluster-id to a 32-character hexadecimal string (e.g., generate with `uuidgen | tr -d '-'`)","Let Flink auto-generate the cluster ID by not setting high-availability.cluster-id explicitly","Use ApplicationID.fromHexString() in your deployment scripts to validate before passing the value"],"exampleFix":"# before\nconfig.set(\"high-availability.cluster-id\", \"my-cluster\")\n\n# after\n# use a 32-hex-char ID\nconfig.set(\"high-availability.cluster-id\", \"fd72014d4c864993a2e5a9287b4a9c5d\")\n# or omit to auto-generate","handlingStrategy":"validation","validationCode":"// Validate cluster ID format before passing to Flink:\nString clusterId = config.get(HighAvailabilityOptions.HA_CLUSTER_ID);\nif (clusterId != null && !clusterId.matches(\"[0-9a-fA-F]{32}\")) {\n    throw new IllegalArgumentException(\n        \"Cluster ID must be 32 hex chars. Got: \" + clusterId);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use 32-character hexadecimal strings for high-availability.cluster-id","Let Flink auto-generate the cluster ID by omitting the config key","Validate cluster IDs in deployment scripts with a regex before submission"],"tags":["application-mode","configuration","cluster-id","high-availability"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}