{"record":{"id":"ae65753530b1aa6c","repo":"apache/beam","slug":"hdfs-host-is-not-set","errorCode":null,"errorMessage":"hdfs_host is not set","messagePattern":"hdfs_host is not set","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/hadoopfilesystem.py","lineNumber":134,"sourceCode":"          'Failed to import hdfs. You can ensure it is '\n          'installed by installing the hadoop beam extra')\n    logging.getLogger('hdfs.client').setLevel(logging.WARN)\n    if pipeline_options is None:\n      raise ValueError('pipeline_options is not set')\n    if isinstance(pipeline_options, PipelineOptions):\n      hdfs_options = pipeline_options.view_as(HadoopFileSystemOptions)\n      hdfs_host = hdfs_options.hdfs_host\n      hdfs_port = hdfs_options.hdfs_port\n      hdfs_user = hdfs_options.hdfs_user\n      self._full_urls = hdfs_options.hdfs_full_urls\n    else:\n      hdfs_host = pipeline_options.get('hdfs_host')\n      hdfs_port = pipeline_options.get('hdfs_port')\n      hdfs_user = pipeline_options.get('hdfs_user')\n      self._full_urls = pipeline_options.get('hdfs_full_urls', False)\n\n    if hdfs_host is None:\n      raise ValueError('hdfs_host is not set')\n    if hdfs_port is None:\n      raise ValueError('hdfs_port is not set')\n    if hdfs_user is None:\n      raise ValueError('hdfs_user is not set')\n    if not isinstance(self._full_urls, bool):\n      raise ValueError(\n          'hdfs_full_urls should be bool, got: %s', self._full_urls)\n    self._hdfs_client = hdfs.InsecureClient(\n        'http://%s:%s' % (hdfs_host, str(hdfs_port)), user=hdfs_user)\n\n  @classmethod\n  def scheme(cls):\n    return 'hdfs'\n\n  def _parse_url(self, url):\n    \"\"\"Verifies that url begins with hdfs:// prefix, strips it and adds a\n    leading /.\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/hadoopfilesystem.py#L116-L152","documentation":"After reading connection settings from pipeline options, HadoopFileSystem validates each required field. A missing hdfs_host raises ValueError 'hdfs_host is not set' because no HDFS namenode host was configured.","triggerScenarios":"Initializing HadoopFileSystem with options lacking the 'hdfs_host' key / --hdfs_host flag; typo like 'hdfs_hostname' in a dict-based options mapping.","commonSituations":"Partial HadoopFileSystemOptions configuration; environment differences where config was provided locally but not on workers; dict passed without the exact key names.","solutions":["Set the --hdfs_host flag or add 'hdfs_host': '<namenode>' to the options.","Use HadoopFileSystemOptions with hdfs_host populated and view_as it.","Double-check key spelling when passing a raw dict ('hdfs_host' exactly).","Fail fast in your launcher by asserting options contain hdfs_host before starting the pipeline."],"exampleFix":"// before\nPipelineOptions(['--hdfs_port=50070', '--hdfs_user=hduser'])\n// after\nPipelineOptions(['--hdfs_host=namenode.example.com', '--hdfs_port=50070', '--hdfs_user=hduser'])","handlingStrategy":"validation","validationCode":"def require_hdfs_host(opts):\n    v = (opts.get('hdfs_host') if isinstance(opts, dict)\n         else opts.view_as(HadoopFileSystemOptions).hdfs_host)\n    if not v:\n        raise ValueError('Set --hdfs_host before launching')\n    return v","typeGuard":"None","tryCatchPattern":"try:\n    fs = HadoopFileSystem(pipeline_options=opts)\nexcept ValueError as e:\n    if 'hdfs_host is not set' in str(e):\n        raise SystemExit('Add --hdfs_host=<namenode> to pipeline options')\n    raise","preventionTips":["Always include --hdfs_host in launch flags","Use exact key name 'hdfs_host' in dict options","Validate the full option trio before starting the pipeline","Document required HDFS options for your team's runner config"],"tags":["hdfs","configuration","python","apache-beam"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}