{"record":{"id":"5a3b6b29a716c5c3","repo":"floci-io/floci","slug":"validationexception-5a3b6b","errorCode":"ValidationException","errorMessage":"floci.services.bedrock-runtime.proxy.url is not a valid URL: {}","messagePattern":"floci\\.services\\.bedrock-runtime\\.proxy\\.url is not a valid URL: (.+?)","errorType":"error_code","errorClass":"AwsException","httpStatus":400,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/bedrockruntime/backend/ProxyBackend.java","lineNumber":70,"sourceCode":"        EmulatorConfig.BedrockProxyConfig proxyConfig = config.services().bedrockRuntime().proxy();\n        String resolvedModel = resolveModel(modelId, proxyConfig);\n        String baseUrl = proxyConfig.url()\n                .filter(url -> !url.isBlank())\n                .orElseThrow(() -> new AwsException(\"ValidationException\",\n                        \"floci.services.bedrock-runtime.proxy.url is required when backend=proxy.\", 400));\n\n        ObjectNode openAiRequest = BedrockOpenAiTranslator.toOpenAiRequest(objectMapper, bedrockRequest, resolvedModel);\n\n        URI uri;\n        HttpRequest.Builder builder;\n        try {\n            uri = URI.create(stripTrailingSlash(baseUrl) + \"/chat/completions\");\n            builder = HttpRequest.newBuilder()\n                    .uri(uri)\n                    .timeout(Duration.ofSeconds(proxyConfig.requestTimeoutSeconds()))\n                    .header(\"Content-Type\", \"application/json\");\n        } catch (IllegalArgumentException e) {\n            throw new AwsException(\"ValidationException\",\n                    \"floci.services.bedrock-runtime.proxy.url is not a valid URL: \" + e.getMessage(), 400);\n        }\n        proxyConfig.apiKey()\n                .filter(key -> !key.isBlank())\n                .ifPresent(key -> builder.header(\"Authorization\", \"Bearer \" + key));\n\n        String requestBody;\n        try {\n            requestBody = objectMapper.writeValueAsString(openAiRequest);\n        } catch (Exception e) {\n            throw new AwsException(\"InternalServerException\", \"Failed to serialize proxy request: \" + e.getMessage(), 500);\n        }\n        builder.POST(HttpRequest.BodyPublishers.ofString(requestBody));\n\n        long start = System.nanoTime();\n        HttpResponse<String> response;\n        try {\n            response = httpClient.send(builder.build(), HttpResponse.BodyHandlers.ofString());","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/bedrockruntime/backend/ProxyBackend.java#L52-L88","documentation":"The Bedrock proxy backend failed to build the upstream URL from floci.services.bedrock-runtime.proxy.url (plus /chat/completions). URI.create/HttpRequest.newBuilder threw IllegalArgumentException, meaning the configured base URL is syntactically invalid for a URI.","triggerScenarios":"Setting FLOCI_SERVICES_BEDROCK_RUNTIME_PROXY_URL to a value with spaces, a missing scheme (e.g. 'localhost:8080'), or illegal URI characters. Note: only the builder calls are inside the try — the actual network call happens later, so this is purely URL construction.","commonSituations":"Env var quoting mistakes injecting whitespace; forgetting the http:// scheme; using a Windows-style path or a URL with unencoded spaces.","solutions":["Set the property to a full URL with scheme and host, e.g. http://localhost:8080 or https://api.example.com","Trim whitespace/newlines from the environment variable value","Validate with java.net.URI.create(value) or curl before starting Floci"],"exampleFix":"# before\nFLOCI_SERVICES_BEDROCK_RUNTIME_PROXY_URL=localhost:11434\n# after\nFLOCI_SERVICES_BEDROCK_RUNTIME_PROXY_URL=http://localhost:11434","handlingStrategy":"validation","validationCode":"try {\n    java.net.URI.create(proxyUrl.trim());\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"Invalid FLOCI proxy url: \" + proxyUrl, e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the URL in CI config checks before booting the emulator","Always include the scheme; avoid trailing spaces in env files"],"tags":["bedrock","configuration","url","floci"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}