{"record":{"id":"6bbc8a011e78f02f","repo":"apache/beam","slug":"only-one-of-extra-args-or-append-args-may-be-provided","errorCode":null,"errorMessage":"Only one of extra_args or append_args may be provided","messagePattern":"Only one of extra_args or append_args may be provided","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/external.py","lineNumber":1054,"sourceCode":"      expansion service using the jar file. These arguments will be appended to\n      the default arguments.\n    user_agent: HTTP user agent string used when downloading jars via\n      `JavaJarServer.local_jar`, including the main jar and any classpath\n      dependencies.\n    maven_repository_url: Maven repository base URL to resolve artifacts when\n      classpath entries or jars are specified as Maven coordinates\n      (`group:artifact:version`). Defaults to Maven Central if not provided.\n  \"\"\"\n  def __init__(\n      self,\n      path_to_jar,\n      extra_args=None,\n      classpath=None,\n      append_args=None,\n      user_agent=None,\n      maven_repository_url=None):\n    if extra_args and append_args:\n      raise ValueError('Only one of extra_args or append_args may be provided')\n    self.path_to_jar = path_to_jar\n    self._extra_args = extra_args\n    self._classpath = classpath or []\n    self._service_count = 0\n    self._append_args = append_args or []\n    self._user_agent = user_agent\n    self._maven_repository_url = maven_repository_url\n\n  def is_existing_service(self):\n    return subprocess_server.is_service_endpoint(self.path_to_jar)\n\n  @staticmethod\n  def _expand_jars(jar, user_agent=None, maven_repository_url=None):\n    if glob.glob(jar):\n      return glob.glob(jar)\n    elif isinstance(jar, str) and (jar.startswith('http://') or\n                                   jar.startswith('https://')):\n      return [subprocess_server.JavaJarServer.local_jar(jar)]","sourceCodeStart":1036,"sourceCodeEnd":1072,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/external.py#L1036-L1072","documentation":"JarExpansionService/BeamJar construction rejects specifying both extra_args (replacing default service arguments) and append_args (extending them); the two argument-override styles are mutually exclusive.","triggerScenarios":"Thrown at sdks/python/apache_beam/transforms/external.py:1054 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use append_args to add to the default argument list","Or use extra_args to fully replace it — but not both"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}