{"record":{"id":"d456e57dd8acc6cf","repo":"aeron-io/aeron","slug":"aeroncluster-context-clientname-length-must-be-aeron","errorCode":null,"errorMessage":"AeronCluster.Context.clientName length must be <= <Aeron.Configuration.MAX_CLIENT_NAME_LENGTH>","messagePattern":"AeronCluster\\.Context\\.clientName length must be <= <Aeron\\.Configuration\\.MAX_CLIENT_NAME_LENGTH>","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java","lineNumber":1506,"sourceCode":"                        \"AeronCluster.Context ingressEndpoints must be null when using IPC ingress\");\n                }\n            }\n\n            if (Strings.isEmpty(egressChannel))\n            {\n                throw new ConfigurationException(\"egressChannel must be specified\");\n            }\n\n            final ChannelUri egressChannelUri = ChannelUri.parse(egressChannel);\n            if (egressChannelUri.isUdp())\n            {\n                egressChannelUri.put(REJOIN_PARAM_NAME, \"false\");\n                egressChannel = egressChannelUri.toString();\n            }\n\n            if (clientName.length() > Aeron.Configuration.MAX_CLIENT_NAME_LENGTH)\n            {\n                throw new ConfigurationException(\n                    \"AeronCluster.Context.clientName length must be <= \" + Aeron.Configuration.MAX_CLIENT_NAME_LENGTH);\n            }\n\n            if (null == aeron)\n            {\n                aeron = Aeron.connect(\n                    new Aeron.Context()\n                        .aeronDirectoryName(aeronDirectoryName)\n                        .errorHandler(errorHandler)\n                        .subscriberErrorHandler(RethrowingErrorHandler.INSTANCE)\n                        .clientName(clientName.isEmpty() ? \"cluster-client\" : clientName));\n\n                ownsAeronClient = true;\n            }\n\n            if (null == idleStrategy)\n            {\n                idleStrategy = new BackoffIdleStrategy(1, 10, 1000, 1000);","sourceCodeStart":1488,"sourceCodeEnd":1524,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java#L1488-L1524","documentation":"The optional clientName identifies the cluster client and is carried in protocol fields, so its length is bounded by Aeron.Configuration.MAX_CLIENT_NAME_LENGTH. Context.conclude() throws ConfigurationException if a supplied clientName exceeds that bound.","triggerScenarios":"Calling ctx.clientName(name) with name.length() > Aeron.Configuration.MAX_CLIENT_NAME_LENGTH (64) before connect().","commonSituations":"Deriving the client name from a hostname, pod name, or UUID string that exceeds the limit; using generated identifiers without truncation.","solutions":["Shorten or truncate the client name to <= Aeron.Configuration.MAX_CLIENT_NAME_LENGTH characters","Pass null/default instead of an explicit clientName so the library generates one","Validate the name at config-load time and reject overly long values early"],"exampleFix":"// before\nString name = InetAddress.getLocalHost().getHostName() + \".client-\" + uuid;\nctx.clientName(name);\n// after\nString raw = InetAddress.getLocalHost().getHostName() + \".client-\" + uuid;\nctx.clientName(raw.length() <= Aeron.Configuration.MAX_CLIENT_NAME_LENGTH\n    ? raw : raw.substring(0, Aeron.Configuration.MAX_CLIENT_NAME_LENGTH));","handlingStrategy":"validation","validationCode":"String name = ...;\nif (name != null && name.length() > Aeron.Configuration.MAX_CLIENT_NAME_LENGTH) {\n    name = name.substring(0, Aeron.Configuration.MAX_CLIENT_NAME_LENGTH);\n}\nctx.clientName(name);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Truncate or hash long identifiers (hostnames, pod names) before assigning clientName","Check Aeron.Configuration.MAX_CLIENT_NAME_LENGTH at config validation time instead of hardcoding 64"],"tags":["configuration","validation","limit-exceeded"],"backgroundTag":"value-out-of-range","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}