{"record":{"id":"57ce8c29e7ef17af","repo":"apache/pulsar","slug":"not-supported-config","errorCode":null,"errorMessage":"Not supported config","messagePattern":"Not supported config","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderBasic.java","lineNumber":75,"sourceCode":"        INVALID_TOKEN,\n    }\n\n    @Override\n    public void close() throws IOException {\n        // noop\n    }\n\n    public static byte[] readData(String data)\n            throws IOException, URISyntaxException, InstantiationException, IllegalAccessException {\n        if (data.startsWith(\"data:\") || data.startsWith(\"file:\")) {\n            return IOUtils.toByteArray(URL.createURL(data));\n        } else if (Files.exists(Paths.get(data))) {\n            return Files.readAllBytes(Paths.get(data));\n        } else if (org.apache.commons.codec.binary.Base64.isBase64(data)) {\n            return Base64.getDecoder().decode(data);\n        } else {\n            String msg = \"Not supported config\";\n            throw new IllegalArgumentException(msg);\n        }\n    }\n\n    @Override\n    public void initialize(ServiceConfiguration config) throws IOException {\n        initialize(Context.builder().config(config).build());\n    }\n\n    @Override\n    public void initialize(Context context) throws IOException {\n        authenticationMetrics = new AuthenticationMetrics(context.getOpenTelemetry(),\n                getClass().getSimpleName(), getAuthMethodName());\n        var config = context.getConfig();\n        String data = config.getProperties().getProperty(CONF_PULSAR_PROPERTY_KEY);\n        if (StringUtils.isEmpty(data)) {\n            data = System.getProperty(CONF_SYSTEM_PROPERTY_KEY);\n        }\n        if (StringUtils.isEmpty(data)) {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderBasic.java#L57-L93","documentation":"AuthenticationProviderBasic.readData interprets its configured credential source string: if it starts with 'data:' it is inline JSON, if a readable file path it is read from disk, if base64 it is decoded; otherwise it throws IllegalArgumentException \"Not supported config\" because the value matches none of the accepted formats.","triggerScenarios":"Setting the basic-auth config property (CONF_PULSAR_PROPERTY_KEY / system property) to a value that is not data:..., an existing file path, or valid base64 — e.g. a bare 'user:password' string or a path to a nonexistent file.","commonSituations":"Typo in file path; passing a plaintext user:password directly; relative path wrong working directory; copying a config example without the data: prefix.","solutions":["Prefix inline credentials with 'data:' e.g. data:{\"username\":\"myuser\",\"password\":\"myp@ss\"}","Or point the property to an existing readable JSON file with credentials","Or base64-encode the JSON credentials and supply that string"],"exampleFix":"// before\nSystem.setProperty(\"pulsar.auth.basic.conf\", \"myuser:mypassword\"); // unsupported\n// after\nSystem.setProperty(\"pulsar.auth.basic.conf\",\n    \"data:{\\\"userId\\\":\\\"myuser\\\",\\\"password\\\":\\\"mypassword\\\"}\");","handlingStrategy":"validation","validationCode":"boolean supported(String data) {\n    return data.startsWith(\"data:\")\n        || java.nio.file.Files.exists(java.nio.file.Paths.get(data))\n        || org.apache.commons.codec.binary.Base64.isBase64(data);\n}","typeGuard":null,"tryCatchPattern":"try {\n    provider.initialize(context);\n} catch (IOException e) {\n    // includes config-not-provided; readData IllegalArgumentException surfaces here too if wrapped\n    log.error(\"basic auth config invalid\", e);\n}","preventionTips":["Use data:{...} prefix for inline credentials","Verify file paths are absolute and readable","Test the conf value against the three accepted formats before deploy"],"tags":["authentication","configuration","basic-auth"],"backgroundTag":"invalid-config-format","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"}