{"record":{"id":"91c894d54d13e22f","repo":"apache/pulsar","slug":"description-should-be-at-most-64-characters-91c894","errorCode":null,"errorMessage":"description should be at most 64 characters","messagePattern":"description should be at most 64 characters","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/PulsarAdminBuilderImpl.java","lineNumber":416,"sourceCode":"\n    @Override\n    public PulsarAdminBuilder maxConnectionsPerHost(int maxConnectionsPerHost) {\n        // reuse the same configuration as the client, however for the admin client, the connection\n        // is usually established to a cluster address and not to a broker address\n        this.conf.setConnectionsPerBroker(maxConnectionsPerHost);\n        return this;\n    }\n\n    @Override\n    public PulsarAdminBuilder connectionMaxIdleSeconds(int connectionMaxIdleSeconds) {\n        this.conf.setConnectionMaxIdleSeconds(connectionMaxIdleSeconds);\n        return this;\n    }\n\n    @Override\n    public PulsarAdminBuilder description(String description) {\n        if (description != null && description.length() > 64) {\n            throw new IllegalArgumentException(\"description should be at most 64 characters\");\n        }\n        this.conf.setDescription(description);\n        return this;\n    }\n\n    @Override\n    public PulsarAdminBuilder socks5ProxyAddress(InetSocketAddress socks5ProxyAddress) {\n        this.conf.setSocks5ProxyAddress(socks5ProxyAddress);\n        return this;\n    }\n\n    @Override\n    public PulsarAdminBuilder socks5ProxyUsername(String socks5ProxyUsername) {\n        this.conf.setSocks5ProxyUsername(socks5ProxyUsername);\n        return this;\n    }\n\n    @Override","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/PulsarAdminBuilderImpl.java#L398-L434","documentation":"IllegalArgumentException enforcing that the admin client's optional user-agent description is at most 64 characters. The description is stored in ClientConfigurationData and sent with requests (e.g. for tracing); longer values are rejected immediately by the builder rather than by the server.","triggerScenarios":"Calling PulsarAdminBuilder.description(String) with a non-null string longer than 64 characters.","commonSituations":"Passing an app name plus version plus environment string concatenated at runtime; building the description from a long config value or hostname; forgetting that the 64-char limit applies to this builder field.","solutions":["Shorten the description to 64 characters or fewer before calling description().","Truncate programmatically: description.length() > 64 ? description.substring(0, 64) : description.","Pass null to omit the description if it isn't needed."],"exampleFix":"// before\nadminBuilder.description(\"My Long Application Name v1.2.3 environment=production cluster=us-east region=primary\");\n// after\nString desc = \"MyApp v1.2.3 production\";\nadminBuilder.description(desc.length() > 64 ? desc.substring(0, 64) : desc);","handlingStrategy":"validation","validationCode":"public static PulsarAdminBuilder safeDescription(PulsarAdminBuilder b, String d) {\n    if (d != null && d.length() > 64)\n        throw new IllegalArgumentException(\"description must be <= 64 chars, got \" + d.length());\n    return b.description(d);\n}","typeGuard":null,"tryCatchPattern":"try {\n    builder.description(desc);\n} catch (IllegalArgumentException e) {\n    builder.description(desc.substring(0, 64));\n}","preventionTips":["Truncate or compose descriptions defensively before passing","Keep descriptions short identifiers (app name + version), not free-form text","Add a unit test asserting description length for generated values"],"tags":["validation","configuration","illegal-argument"],"backgroundTag":"input-length-exceeded","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}