{"record":{"id":"797d4a5eaf551dac","repo":"floci-io/floci","slug":"internalserverexception","errorCode":"InternalServerException","errorMessage":"Failed to serialize proxy request: {}","messagePattern":"Failed to serialize proxy request: (.+?)","errorType":"error_code","errorClass":"AwsException","httpStatus":500,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/bedrockruntime/backend/ProxyBackend.java","lineNumber":81,"sourceCode":"        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());\n        } catch (HttpTimeoutException e) {\n            LOG.warnv(\"Bedrock proxy backend timed out: modelId={0}, url={1}, error={2}\", modelId, uri, e.getMessage());\n            throw new AwsException(\"ModelTimeoutException\", \"Proxy backend timed out: \" + e.getMessage(), 408);\n        } catch (Exception e) {\n            LOG.warnv(\"Bedrock proxy backend call failed: modelId={0}, url={1}, error={2}\", modelId, uri, e.getMessage());\n            throw new AwsException(\"ModelErrorException\", \"Failed to reach proxy backend: \" + e.getMessage(), 424);\n        }\n        long latencyMs = (System.nanoTime() - start) / 1_000_000;\n\n        if (response.statusCode() >= 300) {\n            LOG.warnv(\"Bedrock proxy backend returned HTTP {0}: {1}\", response.statusCode(), response.body());","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/bedrockruntime/backend/ProxyBackend.java#L63-L99","documentation":"Jackson failed while serializing the translated OpenAI request object before sending it to the Bedrock proxy backend. This is an internal 500 (InternalServerException) — the request never left Floci.","triggerScenarios":"A converse request whose structure, after Bedrock-to-OpenAI translation, produces a node Jackson cannot serialize (effectively a translator bug or an unexpected JsonNode shape).","commonSituations":"Rare; typically encountered with unusual message content blocks (e.g. document/toolUse-only content) that the BedrockOpenAiTranslator maps into a non-serializable structure. Check the appended Jackson message.","solutions":["Simplify the request (plain text content blocks) and retry to isolate the offending member","Inspect the appended exception message for the exact serialization failure","Report to Floci with the minimal request JSON that reproduces it — an InternalServerException here is a bug, not a usage error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    converse(req);\n} catch (InternalServerException e) {\n    // retry once with plain text content; if it recurs, report upstream to Floci\n    log.error(\"Floci proxy serialization failed: {}\", e.getMessage());\n}","preventionTips":["Stick to text content blocks when using the proxy backend","Keep request shapes minimal when evaluating new emulator builds"],"tags":["bedrock","proxy","serialization","internal-error","floci"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}