{"record":{"id":"78e189c9c92b1d32","repo":"apache/beam","slug":"unable-to-parse-jar-url-s-if-using-a-full-url-make-sure-the-78e189","errorCode":null,"errorMessage":"Unable to parse jar URL \"%s\". If using a full URL, make sure the scheme is specified. If using a local file path, make sure the file exists; you may have to first build the job server using `./gradlew runners:spark:3:job-server:shadowJar`.","messagePattern":"Unable to parse jar URL \"(.+?)\"\\. If using a full URL, make sure the scheme is specified\\. If using a local file path, make sure the file exists; you may have to first build the job server using `\\./gradlew runners:spark:3:job-server:shadowJar`\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/portability/spark_uber_jar_job_server.py","lineNumber":69,"sourceCode":"        options.view_as(pipeline_options.JobServerOptions).artifact_port)\n    self._temp_dir = tempfile.mkdtemp(prefix='apache-beam-spark')\n    spark_options = options.view_as(pipeline_options.SparkRunnerOptions)\n    self._executable_jar = spark_options.spark_job_server_jar\n    self._spark_version = spark_options.spark_version\n    self._user_agent = options.view_as(pipeline_options.SetupOptions).user_agent\n\n  def start(self):\n    return self\n\n  def stop(self):\n    pass\n\n  def executable_jar(self):\n    if self._executable_jar:\n      if not os.path.exists(self._executable_jar):\n        parsed = urllib.parse.urlparse(self._executable_jar)\n        if not parsed.scheme:\n          raise ValueError(\n              'Unable to parse jar URL \"%s\". If using a full URL, make sure '\n              'the scheme is specified. If using a local file path, make sure '\n              'the file exists; you may have to first build the job server '\n              'using `./gradlew runners:spark:3:job-server:shadowJar`.' %\n              self._executable_jar)\n      url = self._executable_jar\n    else:\n      if self._spark_version == '2':\n        raise ValueError('Support for Spark 2 was dropped.')\n      else:\n        url = job_server.JavaJarJobServer.path_to_beam_jar(\n            ':runners:spark:3:job-server:shadowJar')\n    return job_server.JavaJarJobServer.local_jar(\n        url, user_agent=self._user_agent)\n\n  def create_beam_job(self, job_id, job_name, pipeline, options):\n    return SparkBeamJob(\n        self._rest_url,","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/portability/spark_uber_jar_job_server.py#L51-L87","documentation":"SparkUberJarJobServer.executable_jar validates the uber jar location the same way SparkRunner does: a value that is neither an existing file nor a scheme-qualified URL is ambiguous, so Beam raises ValueError with instructions to build the job server or fix the URL.","triggerScenarios":"Constructing SparkUberJarJobServer with an executable jar string that does not exist on disk and lacks a scheme (e.g. '/missing/dir/server.jar' that was deleted, or 'myhost/jar' without http://); reached via create_beam_job during pipeline launch.","commonSituations":"Uber jar built on another machine and never copied over; relative path resolved from a different CWD; URL pasted without its scheme; CI artifact not uploaded before the job ran.","solutions":["Build the uber jar with ./gradlew runners:spark:3:job-server:shadowJar and pass the real, existing path.","Correct the path so the file exists where the driver runs.","Add a scheme if it is remote: gs://..., https://..., file:///... .","Log/verify os.path.exists(jar) and urllib.parse.urlparse(jar).scheme before launching the pipeline."],"exampleFix":"// before\nSparkUberJarJobServer('build/libs/job-server.jar', options)  # missing file, no scheme\n// after\nSparkUberJarJobServer('gs://my-bucket/beam-runners-spark-3-job-server.jar', options)","handlingStrategy":"validation","validationCode":"import os, urllib.parse\njar = uber_jar_path\nassert os.path.exists(jar) or urllib.parse.urlparse(jar).scheme, f'bad jar location: {jar}'","typeGuard":null,"tryCatchPattern":"try:\n    server.create_beam_job(...)\nexcept ValueError as e:\n    if 'Unable to parse jar URL' in str(e):\n        upload_or_build_jar_and_retry()\n    else:\n        raise","preventionTips":["Verify jar existence from the same host/CWD that submits","Pre-upload remote jars and reference them by scheme","Fail fast with your own existence check"],"tags":["apache-beam","spark","jar","url"],"backgroundTag":"invalid-url-format","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"}