{"record":{"id":"b83c7a07e9cf7d9d","repo":"apache/beam","slug":"artifact-not-found-at-s-response-s","errorCode":null,"errorMessage":"Artifact not found at %s (response: %s)","messagePattern":"Artifact not found at (.+?) \\(response: (.+?)\\)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/portability/stager.py","lineNumber":515,"sourceCode":"    shutil.rmtree(temp_dir)\n    retrieval_token = self.commit_manifest()\n    return retrieval_token, staged_resources\n\n  @staticmethod\n  @retry.with_exponential_backoff(num_retries=4)\n  def _download_file(from_url, to_path):\n    \"\"\"Downloads a file over http/https from a url or copy it from a remote\n        path to local path.\"\"\"\n    if from_url.startswith('http://') or from_url.startswith('https://'):\n      # TODO(silviuc): We should cache downloads so we do not do it for every\n      # job.\n      try:\n        # We check if the file is actually there because wget returns a file\n        # even for a 404 response (file will contain the contents of the 404\n        # response).\n        response, content = get_new_http().request(from_url)\n        if int(response['status']) >= 400:\n          raise RuntimeError(\n              'Artifact not found at %s (response: %s)' % (from_url, response))\n        with open(to_path, 'wb') as f:\n          f.write(content)\n      except Exception:\n        _LOGGER.info('Failed to download Artifact from %s', from_url)\n        raise\n    else:\n      try:\n        read_handle = FileSystems.open(\n            from_url, compression_type=CompressionTypes.UNCOMPRESSED)\n        with read_handle as fin:\n          with open(to_path, 'wb') as f:\n            while True:\n              chunk = fin.read(Stager._DEFAULT_CHUNK_SIZE)\n              if not chunk:\n                break\n              f.write(chunk)\n        _LOGGER.info('Copied remote file from %s to %s.', from_url, to_path)","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/portability/stager.py#L497-L533","documentation":"Stager._download_file downloads an artifact over HTTP and explicitly checks the response status because wget-style helpers can return content even for 404s. If the HTTP status is >= 400 it raises this RuntimeError including the raw response object.","triggerScenarios":"_download_file (used for jar_packages and other remote artifacts) fetches a URL and the server returns status 400+ (404 missing artifact, 403 denied, 5xx).","commonSituations":"--experiment=jar_packages=<https url> pointing at a nonexistent jar in a Maven/Nexus repo; expired or unauthorized artifact URL; internal repo requiring credentials; DNS/proxy returning an error page with a 4xx/5xx status.","solutions":["Verify the URL is downloadable: curl -I <from_url> and expect 200","Fix the URL/version in jar_packages to an artifact that exists in the repository","Add authentication or use a repository mirror if the artifact requires credentials","Upload the jar to an accessible location or stage it as a local file instead"],"exampleFix":"// before\n--experiment=jar_packages=https://repo.example.com/libs/my-lib-1.2.jar\n// after\n--experiment=jar_packages=https://repo1.maven.org/maven2/com/example/my-lib/1.2/my-lib-1.2.jar","handlingStrategy":"validation","validationCode":"import urllib.request\nreq = urllib.request.Request(url, method='HEAD')\nwith urllib.request.urlopen(req) as r:\n    if r.status != 200:\n        raise SystemExit(f'Artifact URL not downloadable: {url} ({r.status})')","typeGuard":null,"tryCatchPattern":"try:\n    stager.create_and_stage_job_resources(setup_options)\nexcept RuntimeError as e:\n    if 'Artifact not found at' in str(e):\n        sys.exit(f'Artifact URL unreachable: {e}')\n    raise","preventionTips":["HEAD-check jar URLs before submission","Use versioned, immutable artifact URLs","Ensure repo credentials/proxy settings are available to the driver"],"tags":["python","http","download","network","beam"],"backgroundTag":"http-error-response","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"}