{"record":{"id":"8df5c7365826ff26","repo":"apache/hadoop","slug":"invalid-stream-type-s","errorCode":null,"errorMessage":"Invalid stream type: \\\"\" + s + \"\\\"","messagePattern":"Invalid stream type: \\\\\"\" \\+ s \\+ \"\\\\\"","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/streams/StreamIntegration.java","lineNumber":158,"sourceCode":"    if (conf.getBoolean(PREFETCH_ENABLED_KEY, false)) {\n      // prefetch enabled, warn (once) then change it to be the default.\n      WARN_PREFETCH_KEY.info(\"Using {} is deprecated: choose the appropriate stream in {}\",\n          PREFETCH_ENABLED_KEY, INPUT_STREAM_TYPE);\n      return InputStreamType.Prefetch;\n    }\n\n    // retrieve the enum value, returning the configured value or\n    // the (calculated) default\n    return ConfigurationHelper.resolveEnum(conf,\n        INPUT_STREAM_TYPE,\n        InputStreamType.class,\n        s -> {\n          if (isEmpty(s) || DEFAULT.equalsIgnoreCase(s)) {\n            // return default type.\n            return DEFAULT_STREAM_TYPE;\n          } else {\n            // any other value\n            throw new IllegalArgumentException(E_INVALID_STREAM_TYPE\n                + \" \\\"\" + s + \"\\\"\");\n          }\n        });\n  }\n\n  /**\n   * Load the input stream factory defined in the option\n   * {@link Constants#INPUT_STREAM_CUSTOM_FACTORY}.\n   * @param conf configuration to use\n   * @return the custom factory\n   * @throws RuntimeException any binding/loading/instantiation problem\n   */\n  static ObjectInputStreamFactory loadCustomFactory(Configuration conf) {\n\n    // make sure the classname option is actually set\n    final String name = conf.getTrimmed(INPUT_STREAM_CUSTOM_FACTORY, \"\");\n    checkArgument(!isEmpty(name), E_EMPTY_CUSTOM_CLASSNAME);\n","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/streams/StreamIntegration.java#L140-L176","documentation":"StreamIntegration.determineInputStreamType() parses fs.s3a.input.stream.type. Valid values are the InputStreamType enum names Classic, Prefetch, Analytics, Custom, plus 'Default'/empty (which resolve to the default stream). Anything else throws IllegalArgumentException(\"Invalid stream type: \\\"<s>\\\"\") when the S3A filesystem initializes input streams.","triggerScenarios":"Setting fs.s3a.input.stream.type to a typo or removed value, e.g. 'Guarded' (removed in Hadoop 3.4.0, HADOOP-16831), 'classic ' with stray characters, 'VectoredGeneric' or 'default1'; XML config with whitespace/HTML entity issues; setting the old fs.s3a.prefetch.enabled alongside an invalid type value.","commonSituations":"Upgrading to Hadoop 3.4+ with configs written for 3.3.x that say fs.s3a.input.stream.type=Guarded; copy-paste from outdated documentation or blog posts; environment-level defaults (core-site.xml in the image) applied to every job; case sensitivity ('classic' vs 'Classic') depending on resolution path.","solutions":["Set fs.s3a.input.stream.type to one of: Classic, Prefetch, Analytics, Custom, or Default (or remove the property entirely).","If you had 'Guarded', remove it - the Guarded stream was deleted in Hadoop 3.4.0; 'Classic' is the closest replacement behavior.","Check the exact effective value: hadoop conf | grep input.stream.type, or conf.getPropertySources(\"fs.s3a.input.stream.type\") to find which file supplies it.","For 'Custom', also set fs.s3a.input.stream.custom.factory to your factory class."],"exampleFix":"<!-- before -->\n<property><name>fs.s3a.input.stream.type</name><value>Guarded</value></property>\n\n<!-- after (Hadoop 3.4+) -->\n<property><name>fs.s3a.input.stream.type</name><value>Classic</value></property>\n<!-- or simply delete the property to use the default -->","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(\"Classic\", \"Prefetch\", \"Analytics\", \"Custom\", \"Default\");\nString v = conf.getTrimmed(\"fs.s3a.input.stream.type\", \"\");\nif (!v.isEmpty() && !valid.contains(v)) {\n  throw new IllegalArgumentException(\n      \"fs.s3a.input.stream.type='\" + v + \"' invalid; allowed: \" + valid);\n}","typeGuard":null,"tryCatchPattern":"try {\n  FileSystem fs = path.getFileSystem(conf);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Invalid stream type\")) {\n    // fix fs.s3a.input.stream.type and rebuild config before retrying\n  } else { throw e; }\n}","preventionTips":["Validate the option in a config-lint step before deploying jobs.","After a Hadoop upgrade, grep configs for removed values like 'Guarded'.","Check conf.getPropertySources(key) to find which layer supplies a bad value."],"tags":["hadoop-aws","configuration","input-stream","hadoop-3-4-upgrade","illegal-argument"],"backgroundTag":"invalid-configuration-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}