{"record":{"id":"6225aeb4adfb8da9","repo":"apache/beam","slug":"pipeline-has-validations-errors","errorCode":null,"errorMessage":"Pipeline has validations errors: \n","messagePattern":"Pipeline has validations errors: \n","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/pipeline.py","lineNumber":226,"sourceCode":"      raise TypeError(\n          'Runner %s is not a PipelineRunner object or the '\n          'name of a registered runner.' % runner)\n\n    # Runner can override the default pickler to be used.\n    if (self._options.view_as(SetupOptions).pickle_library == 'default' and\n        runner.default_pickle_library_override()):\n      logging.info(\n          \"Runner defaulting to pickling library: %s.\",\n          runner.default_pickle_library_override())\n      self._options.view_as(\n          SetupOptions).pickle_library = runner.default_pickle_library_override(\n          )\n    pickler.set_library(self._options.view_as(SetupOptions).pickle_library)\n\n    # Validate pipeline options\n    errors = PipelineOptionsValidator(self._options, runner).validate()\n    if errors:\n      raise ValueError(\n          'Pipeline has validations errors: \\n' + '\\n'.join(errors))\n\n    typecoders.registry.update_compatibility_version = self._options.view_as(\n        StreamingOptions).update_compatibility_version\n\n    # set default experiments for portable runners\n    # (needs to occur prior to pipeline construction)\n    if runner.is_fnapi_compatible():\n      experiments = (self._options.view_as(DebugOptions).experiments or [])\n      if not 'beam_fn_api' in experiments:\n        experiments.append('beam_fn_api')\n        self._options.view_as(DebugOptions).experiments = experiments\n\n    self.local_tempdir = tempfile.mkdtemp(prefix='beam-pipeline-temp')\n\n    # Default runner to be used.\n    self.runner = runner\n","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/pipeline.py#L208-L244","documentation":"After constructing a runner, Pipeline.__init__ runs PipelineOptionsValidator which collects validation errors for the option set against the chosen runner. If any errors are found they are joined and raised as a single ValueError listing every problem.","triggerScenarios":"Constructing Pipeline(options=PipelineOptions([...])) with options invalid for the runner, e.g. streaming-specific flags with a non-streaming runner, missing required flags (like --project/--region for Dataflow), or flags only valid for a different runner.","commonSituations":"Running on Dataflow without required GCP options; passing --streaming to a batch runner; copying flags between runners where they are incompatible; typos in option names so validation sees unexpected/invalid values.","solutions":["Read the full error list in the message; each line names an invalid option.","Fix or remove the flagged PipelineOptions entries.","Supply required options for the runner (e.g. project, region, temp_location for Dataflow).","Verify option flags/names against the runner's documented option class.","Test options with PipelineOptionsValidator or by constructing the pipeline before submitting."],"exampleFix":"// before\noptions = PipelineOptions(['--streaming', '--worker_machine_type=n1-standard-1'])\np = Pipeline(runner='DirectRunner', options=options)\n// after\noptions = PipelineOptions(['--worker_machine_type=n1-standard-1'])\np = Pipeline(runner='DirectRunner', options=options)","handlingStrategy":"validation","validationCode":"from apache_beam.options.pipeline_options_validator import PipelineOptionsValidator\nerrors = PipelineOptionsValidator(options, runner).validate()\nassert not errors, '\\n'.join(errors)","typeGuard":null,"tryCatchPattern":"try:\n    p = Pipeline(options=options)\nexcept ValueError as e:\n    print('Option validation failed:', e)\n    # fix flagged options before retrying","preventionTips":["Validate options per-runner before submission","Keep runner-specific flags in separate config profiles","Avoid copying flag lists between runners"],"tags":["python","apache-beam","value-error","pipeline-options","validation"],"backgroundTag":"invalid-config-value","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"}