{"record":{"id":"56e86406dd2efc67","repo":"apache/flink","slug":"unknown-error-typeinformation-is-null","errorCode":null,"errorMessage":"Unknown Error. TypeInformation is null.","messagePattern":"Unknown Error\\. TypeInformation is null\\.","errorType":"exception","errorClass":"InvalidTypesException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java","lineNumber":1494,"sourceCode":"            return; // skip input validation e.g. for raw types\n        }\n\n        try {\n            validateInfo(typeHierarchy, inType, inTypeInfo);\n        } catch (InvalidTypesException e) {\n            throw new InvalidTypesException(\"Input mismatch: \" + e.getMessage(), e);\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    private static void validateInfo(\n            List<Type> typeHierarchy, Type type, TypeInformation<?> typeInfo) {\n        if (type == null) {\n            throw new InvalidTypesException(\"Unknown Error. Type is null.\");\n        }\n\n        if (typeInfo == null) {\n            throw new InvalidTypesException(\"Unknown Error. TypeInformation is null.\");\n        }\n\n        if (!(type instanceof TypeVariable<?>)) {\n            // check for Java Basic Types\n            if (typeInfo instanceof BasicTypeInfo) {\n\n                TypeInformation<?> actual;\n                // check if basic type at all\n                if (!(type instanceof Class<?>)\n                        || (actual = BasicTypeInfo.getInfoFor((Class<?>) type)) == null) {\n                    throw new InvalidTypesException(\"Basic type expected.\");\n                }\n                // check if correct basic type\n                if (!typeInfo.equals(actual)) {\n                    throw new InvalidTypesException(\n                            \"Basic type '\" + typeInfo + \"' expected but was '\" + actual + \"'.\");\n                }\n","sourceCodeStart":1476,"sourceCodeEnd":1512,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java#L1476-L1512","documentation":"Thrown at the start of `validateInfo` when the `typeInfo` argument passed to validation is null. Unlike error 608 (null extracted Type), this means the TypeInformation object itself — the one the framework is trying to validate against — was never produced or was passed as null. This is a defensive guard indicating that type information extraction failed silently upstream.","triggerScenarios":"The TypeInformation for the function's input or output could not be extracted and resulted in null being passed to validateInfo. This can happen when the framework's extraction pipeline silently returns null instead of throwing, and that null propagates to the validation step.","commonSituations":"An upstream extraction step failed to produce TypeInformation. A custom function or connector that incorrectly reports its type as null. Internal state corruption during extraction. Typically indicates a deeper issue in the type extraction pipeline.","solutions":["Provide the TypeInformation explicitly via `.returns(...)` to bypass extraction","Implement ResultTypeQueryable on the function to supply type info directly","Check if the function class has any unusual annotations or type signatures that confuse the extractor","Report as a bug if it occurs with standard Flink function implementations"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    resultStream = inputStream.map(myFunction);\n} catch (InvalidTypesException e) {\n    if (e.getMessage().contains(\"TypeInformation is null\")) {\n        // Extraction returned null — provide type explicitly\n        resultStream = inputStream.map(myFunction)\n            .returns(TypeInformation.of(MyOutputType.class));\n    } else {\n        throw e;\n    }\n}","preventionTips":["Implement ResultTypeQueryable on functions that have complex type hierarchies","Provide TypeInformation explicitly via .returns() when extraction is unreliable","Verify TypeExtractor.createTypeInfo() returns non-null before using the function","Report this as a bug if it occurs with straightforward function implementations"],"tags":["type-extraction","internal-error","null-typeinfo","validation"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}