{"record":{"id":"f9b197d5790558b4","repo":"apache/pulsar","slug":"pulsarwebserviceurl-cannot-be-null","errorCode":null,"errorMessage":"pulsarWebServiceUrl cannot be null","messagePattern":"pulsarWebServiceUrl cannot be null","errorType":"exception","errorClass":"PulsarClientException","httpStatus":null,"severity":"critical","filePath":"pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/InstanceUtils.java","lineNumber":220,"sourceCode":"            throws PulsarClientException {\n        PulsarAdminBuilder pulsarAdminBuilder = null;\n        if (isNotBlank(pulsarWebServiceUrl)) {\n            pulsarAdminBuilder = PulsarAdmin.builder().serviceHttpUrl(pulsarWebServiceUrl);\n            if (authConfig != null) {\n                if (isNotBlank(authConfig.getClientAuthenticationPlugin())\n                        && isNotBlank(authConfig.getClientAuthenticationParameters())) {\n                    pulsarAdminBuilder.authentication(authConfig.getClientAuthenticationPlugin(),\n                            authConfig.getClientAuthenticationParameters());\n                }\n                if (isNotBlank(authConfig.getTlsTrustCertsFilePath())) {\n                    pulsarAdminBuilder.tlsTrustCertsFilePath(authConfig.getTlsTrustCertsFilePath());\n                }\n                pulsarAdminBuilder.allowTlsInsecureConnection(authConfig.isTlsAllowInsecureConnection());\n                pulsarAdminBuilder.enableTlsHostnameVerification(authConfig.isTlsHostnameVerificationEnable());\n            }\n            return pulsarAdminBuilder.build();\n        }\n        throw new PulsarClientException(\"pulsarWebServiceUrl cannot be null\");\n    }\n}\n","sourceCodeStart":202,"sourceCodeEnd":223,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/InstanceUtils.java#L202-L223","documentation":"createPulsarAdminClient builds a PulsarAdmin from a web service URL plus auth/TLS config. If pulsarWebServiceUrl is null the builder cannot be completed and it throws PulsarClientException(\"pulsarWebServiceUrl cannot be null\"). Like the client-URL check, this signals missing instance configuration for the admin HTTP endpoint.","triggerScenarios":"createPulsarAdminClient(null, authConfig, ...) — the instance config's pulsarWebServiceUrl was null, e.g. the launcher omitted the web service URL or the worker config lacks it.","commonSituations":"Missing `--pulsarWebServiceUrl` argument in function instance launch; worker config missing brokerWebServiceUrl; custom instance setups (tests, embedded runtimes) that only set the binary service URL.","solutions":["Set pulsarWebServiceUrl (e.g. http://broker:8080) in the instance launch arguments/config.","Verify the function worker's webServiceUrl/brokerWebServiceUrl configuration is populated and propagated.","In programmatic setups, pass the admin HTTP URL explicitly to createPulsarAdminClient."],"exampleFix":"// before\nInstanceUtils.createPulsarAdminClient(null, authConfig);\n// after\nInstanceUtils.createPulsarAdminClient(\"http://localhost:8080\", authConfig);","handlingStrategy":"validation","validationCode":"if (pulsarWebServiceUrl == null || pulsarWebServiceUrl.isBlank()) {\n    throw new IllegalArgumentException(\"pulsarWebServiceUrl must be set (e.g. http://broker:8080)\");\n}","typeGuard":null,"tryCatchPattern":"try { admin = InstanceUtils.createPulsarAdminClient(url, authConfig); } catch (PulsarClientException e) { if (e.getMessage().contains(\"cannot be null\")) { throw new IllegalStateException(\"Instance config missing pulsarWebServiceUrl\", e); } throw e; }","preventionTips":["Always launch instances with --pulsarWebServiceUrl","Verify worker webServiceUrl configuration","Check config templates used by KubernetesRuntime/ProcessRuntime"],"tags":["pulsar-functions","pulsar-admin","configuration","null-check"],"backgroundTag":"missing-web-service-url","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"}