{"record":{"id":"21198c0d3f0f52ea","repo":"apache/pulsar","slug":"metadatastoreconfig-query-parameter-key-must-21198c","errorCode":null,"errorMessage":"MetadataStoreConfig query parameter '${key}' must be greater than 0","messagePattern":"MetadataStoreConfig query parameter '(.+?)' must be greater than 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/MetadataStoreConfigQueryParams.java","lineNumber":99,"sourceCode":"            return false;\n        }\n        throw new IllegalArgumentException(\"MetadataStoreConfig query parameter '\" + key\n                + \"' must be true or false\");\n    }\n\n    private static int parseNonNegativeInt(String key, String value) {\n        int intValue = parseInt(key, value);\n        if (intValue < 0) {\n            throw new IllegalArgumentException(\"MetadataStoreConfig query parameter '\" + key\n                    + \"' must be greater than or equal to 0\");\n        }\n        return intValue;\n    }\n\n    private static int parsePositiveInt(String key, String value) {\n        int intValue = parseInt(key, value);\n        if (intValue <= 0) {\n            throw new IllegalArgumentException(\"MetadataStoreConfig query parameter '\" + key\n                    + \"' must be greater than 0\");\n        }\n        return intValue;\n    }\n\n    private static int parseInt(String key, String value) {\n        try {\n            return Integer.parseInt(value);\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\"MetadataStoreConfig query parameter '\" + key\n                    + \"' must be an integer\", e);\n        }\n    }\n}\n","sourceCodeStart":81,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/MetadataStoreConfigQueryParams.java#L81-L114","documentation":"parsePositiveInt() rejects integer values <= 0 for strictly positive MetadataStoreConfig query parameters, throwing IllegalArgumentException 'must be greater than 0'. Unlike parseNonNegativeInt, 0 is not allowed here.","triggerScenarios":"positiveIntParam applied to 0 or a negative value from the metadata store URL config section, e.g. a zero timeout or zero cache-size parameter.","commonSituations":"Setting a parameter to 0 hoping to disable a feature when 0 is invalid for it; generated configs substituting empty strings that parse to 0 elsewhere; misunderstanding the allowed range for that key.","solutions":["Change the value to an integer >= 1.","Remove the parameter to use the default instead of 0.","Consult the error's key against PARAM_SETTERS/docs to learn the valid range."],"exampleFix":"// before\n?someCacheSize=0\n// after\n?someCacheSize=1024","handlingStrategy":"validation","validationCode":"int v = Integer.parseInt(value);\nif (v <= 0) throw new IllegalArgumentException(key + \" must be > 0\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use >= 1 for strictly positive params","Remove the param instead of passing 0 to disable features","Check docs for which params accept 0"],"tags":["configuration","validation","integer","metadata-store"],"backgroundTag":"invalid-config-parameter","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"}