{"record":{"id":"f0e53ec7f4e152f8","repo":"testcontainers/testcontainers-java","slug":"unexpected-outputtype-outputtype","errorCode":null,"errorMessage":"Unexpected outputType ${outputType}","messagePattern":"Unexpected outputType (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/org/testcontainers/containers/output/Slf4jLogConsumer.java","lineNumber":77,"sourceCode":"            switch (outputType) {\n                case END:\n                    break;\n                case STDOUT:\n                    if (separateOutputStreams) {\n                        logger.info(\"{}{}\", prefix.isEmpty() ? \"\" : (prefix + \": \"), utf8String);\n                    } else {\n                        logger.info(\"{}{}: {}\", prefix, outputType, utf8String);\n                    }\n                    break;\n                case STDERR:\n                    if (separateOutputStreams) {\n                        logger.error(\"{}{}\", prefix.isEmpty() ? \"\" : (prefix + \": \"), utf8String);\n                    } else {\n                        logger.info(\"{}{}: {}\", prefix, outputType, utf8String);\n                    }\n                    break;\n                default:\n                    throw new IllegalArgumentException(\"Unexpected outputType \" + outputType);\n            }\n        } finally {\n            if (originalMdc == null) {\n                MDC.clear();\n            } else {\n                MDC.setContextMap(originalMdc);\n            }\n        }\n    }\n}\n","sourceCodeStart":59,"sourceCodeEnd":88,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/core/src/main/java/org/testcontainers/containers/output/Slf4jLogConsumer.java#L59-L88","documentation":"Slf4jLogConsumer.accept() switches on the Docker frame OutputType (STDOUT/STDERR) to pick the log level. Any OutputType outside the handled cases — or an accept() call made after the consumer was composed/filtered in an unexpected way — hits the default branch and throws IllegalArgumentException(\"Unexpected outputType \" + outputType).","triggerScenarios":"Following a container's log stream and receiving a frame whose OutputType is neither STDOUT nor STDERR (e.g. unexpected Docker API response), or programmatic misuse passing a foreign OutputType to accept().","commonSituations":"Rare in practice; appears with unusual Docker Engine versions returning unexpected frame types, or custom code feeding frames into the consumer.","solutions":["Check the Docker Engine version; upgrade Testcontainers to match its API.","Log the actual outputType value from the message to identify the unexpected frame type.","Wrap the consumer to sanitize frames before passing to Slf4jLogConsumer.","Report the issue to Testcontainers if it comes from a normal `followOutput` stream."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"container.followOutput(frame -> { try { consumer.accept(frame); } catch (IllegalArgumentException e) { log.warn(\"skipped frame with outputType {}\", frame.getType()); } });","preventionTips":["Keep Testcontainers aligned with your Docker Engine version.","Only feed standard FollowOutput frames into Slf4jLogConsumer.","Log frame types when debugging unexpected stream output."],"tags":["logging","log-consumer","illegal-argument"],"backgroundTag":"invalid-enum-value","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}