{"record":{"id":"f3a0651e1ba2dfdd","repo":"t8y2/dbx","slug":"java-agent-artifact-missing-for-driver-name-so","errorCode":null,"errorMessage":"Java agent artifact missing for {driver_name}: {source}","messagePattern":"Java agent artifact missing for (.+?): (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"agents/scripts/build_driver_zips.py","lineNumber":77,"sourceCode":"    artifact[\"url\"] = release_url_with_filename(artifact[\"url\"], output.name)\n    artifact[\"size\"] = output.stat().st_size\n    artifact[\"sha256\"] = hashlib.sha256(output.read_bytes()).hexdigest()\n    artifact[\"format\"] = \"tar_zstd\"\n\n\ndef build_driver_zips(release_dir: Path) -> list[Path]:\n    registry_path = release_dir / \"agent-registry.json\"\n    registry = json.loads(registry_path.read_text(encoding=\"utf-8\"))\n    outputs: list[Path] = []\n\n    for driver_name, driver in registry.get(\"drivers\", {}).items():\n        version = driver[\"version\"]\n        jar_artifact = driver.get(\"jar\")\n        if jar_artifact and jar_artifact.get(\"size\", 0) > 0:\n            filename = artifact_filename(jar_artifact[\"url\"])\n            source = release_dir / filename\n            if not source.is_file():\n                raise FileNotFoundError(f\"Java agent artifact missing for {driver_name}: {source}\")\n\n            package_driver = copy.deepcopy(driver)\n            package_driver.pop(\"native\", None)\n            package_driver[\"jar\"] = packaged_artifact(jar_artifact, source)\n            package_registry = {\"jres\": {}, \"drivers\": {driver_name: package_driver}}\n            output = release_dir / f\"dbx-agent-{driver_name}-{version}.tar.zst\"\n            if not output.exists():\n                write_driver_tar_zstd(output, package_registry, source, executable=False)\n            elif not output.is_file():\n                raise FileExistsError(f\"Reusable Java agent package is not a file: {output}\")\n            update_release_artifact(jar_artifact, output)\n            outputs.append(output)\n\n        for platform, artifact in driver.get(\"native\", {}).items():\n            filename = artifact_filename(artifact[\"url\"])\n            source = release_dir / filename\n            if not source.is_file():\n                raise FileNotFoundError(f\"Native agent artifact missing for {driver_name}/{platform}: {source}\")","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/scripts/build_driver_zips.py#L59-L95","documentation":"build_driver_zips packages a release registry's Java agent JARs into tar.zst packages. For each driver with a jar artifact it computes the expected filename from the artifact URL and checks the file exists in release_dir; if not it raises FileNotFoundError naming the driver and path. This catches incomplete release downloads before packaging half-built archives.","triggerScenarios":"Running build_driver_zips when a driver's registry entry declares a jar (size > 0) but the corresponding file (release_dir / artifact_filename(jar_artifact['url'])) is absent — e.g. the release dir only has some artifacts, or the URL-derived filename changed.","commonSituations":"Partial release download; artifact URL updated in the registry but the local file kept its old name; clean release_dir without re-downloading; typo'd version in registry producing a filename that was never fetched.","solutions":["Download the missing JAR into release_dir with exactly the name derived from the artifact URL.","Re-run the release download step so all jar artifacts referenced by the registry are fetched.","Compare artifact_filename(jar_artifact['url']) against the files present in release_dir to spot name mismatches.","Ensure release_dir points at the directory that actually contains the downloaded release."],"exampleFix":"# before\npython build_driver_zips.py --release-dir out  # jar never downloaded\n# after\nfetch-artifacts --release-dir out && python build_driver_zips.py --release-dir out","handlingStrategy":"validation","validationCode":"from pathlib import Path\nrelease_dir = Path(\"out\")\nfrom build_driver_zips import artifact_filename\nmissing = [n for n, d in registry[\"drivers\"].items()\n           if d.get(\"jar\", {}).get(\"size\", 0) > 0\n           and not (release_dir / artifact_filename(d[\"jar\"][\"url\"])).is_file()]\nif missing:\n    raise SystemExit(f\"missing jar artifacts for: {missing}\")","typeGuard":null,"tryCatchPattern":"try:\n    build_driver_zips(release_dir)\nexcept FileNotFoundError as e:\n    print(f\"incomplete release: {e}; re-run artifact download\")","preventionTips":["Always run the full artifact download before packaging","Verify downloaded file names match artifact_filename(url)","Checksum artifacts after download","Keep registry URLs and local files in sync"],"tags":["python","file-not-found","packaging","release-artifacts"],"backgroundTag":"missing-build-artifact","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}