{"record":{"id":"684d4bbf229308dc","repo":"quarkusio/quarkus","slug":"unable-to-obtain-the-config-value-for","errorCode":null,"errorMessage":"Unable to obtain the config value for: ","messagePattern":"Unable to obtain the config value for: ","errorType":"exception","errorClass":"WebSocketClientException","httpStatus":null,"severity":"error","filePath":"extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectorImpl.java","lineNumber":74,"sourceCode":"        setPath(clientEndpoint.path);\n    }\n\n    @Override\n    public Uni<WebSocketClientConnection> connect() {\n        // A new client is created for each connection\n        // The client is created when the returned Uni is subscribed\n        // The client is closed when the connection is closed\n        AtomicReference<WebSocketClient> client = new AtomicReference<>();\n\n        StringBuilder serverEndpoint = new StringBuilder();\n        if (baseUri != null) {\n            serverEndpoint.append(baseUri.toString());\n        } else {\n            // Obtain the base URI from the config\n            String key = clientEndpoint.clientId + \".base-uri\";\n            Optional<String> maybeBaseUri = ConfigProvider.getConfig().getOptionalValue(key, String.class);\n            if (maybeBaseUri.isEmpty()) {\n                throw new WebSocketClientException(\"Unable to obtain the config value for: \" + key);\n            }\n            serverEndpoint.append(maybeBaseUri.get());\n        }\n        serverEndpoint.append(replacePathParameters(clientEndpoint.path));\n\n        URI serverEndpointUri;\n        try {\n            serverEndpointUri = new URI(serverEndpoint.toString());\n        } catch (URISyntaxException e) {\n            throw new WebSocketClientException(e);\n        }\n\n        WebSocketConnectOptions connectOptions = newConnectOptions(serverEndpointUri);\n        StringBuilder uri = new StringBuilder();\n        if (serverEndpointUri.getPath() != null) {\n            uri.append(serverEndpointUri.getRawPath());\n        }\n        if (serverEndpointUri.getQuery() != null) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectorImpl.java#L56-L92","documentation":"When the WebSocket client endpoint has no programmatic base URI and no per-client quarkus.websocket.<client-id>.base-uri config property is set, WebSocketConnectorImpl.connect() fails while resolving the server endpoint URI and throws this WebSocketClientException naming the config key.","triggerScenarios":"Calling connect() on a WebSocketConnector for an endpoint that (a) had no baseUri() call on the connector and (b) has no quarkus.websocket.<client-id>.base-uri property in application.properties/yaml — including wrong client-id in the key or property not visible at runtime.","commonSituations":"Missing application.properties entry; client-id mismatch between annotation and config key; config not included in the build (wrong profile, missing file); test profile lacking the property.","solutions":["Add quarkus.websocket.<client-id>.base-uri=ws://host:port to application.properties (client-id matches @WebSocketClient clientId or endpoint class-derived id)","Call baseUri(URI) on the connector programmatically before connect()","Verify the client-id used in the property key is correct","Check the property is present in the active profile (e.g. %test)"],"exampleFix":"// before\nconnector.connect(); // no base-uri configured\n// after (application.properties)\nquarkus.websocket.my-client.base-uri=ws://localhost:8080\n// or programmatically\nconnector.baseUri(URI.create(\"ws://localhost:8080\")).connect();","handlingStrategy":"validation","validationCode":"String key = clientId + \".base-uri\";\nboolean configured = ConfigProvider.getConfig().getOptionalValue(key, String.class).isPresent();\n// or check programmatically before connect(); otherwise call connector.baseUri(...)","typeGuard":null,"tryCatchPattern":"try {\n    connector.connect();\n} catch (WebSocketClientException e) {\n    if (e.getMessage().contains(\".base-uri\")) {\n        log.error(\"Set {} in application.properties or call baseUri()\", clientId + \".base-uri\", e);\n    }\n}","preventionTips":["Always set quarkus.websocket.<client-id>.base-uri when not calling baseUri() programmatically","Verify client-id spelling in property keys","Check the property exists in every active profile (prod, dev, test)"],"tags":["websockets","configuration","client","missing-config"],"backgroundTag":"missing-config-property","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}