{"record":{"id":"731ca1a09c453731","repo":"t8y2/dbx","slug":"missing-version-for-native-driver-driver","errorCode":null,"errorMessage":"Missing version for native driver: {driver}","messagePattern":"Missing version for native driver: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agents/scripts/version_agent_artifacts.py","lineNumber":40,"sourceCode":"        raise FileExistsError(f\"Versioned agent artifact already exists: {target}\")\n    source.rename(target)\n    return target\n\n\ndef version_agent_artifacts(release_dir: Path, versions: dict[str, str]) -> list[Path]:\n    renamed: list[Path] = []\n    for driver, version in sorted(versions.items()):\n        jar = rename_artifact(\n            release_dir / f\"dbx-agent-{driver}.jar\",\n            release_dir / f\"dbx-agent-{driver}-{version}.jar\",\n        )\n        if jar:\n            renamed.append(jar)\n\n    for driver in NATIVE_DRIVERS:\n        version = versions.get(driver)\n        if not version:\n            raise ValueError(f\"Missing version for native driver: {driver}\")\n        for platform in PLATFORMS:\n            extension = \".exe\" if platform.startswith(\"windows-\") else \"\"\n            artifact = rename_artifact(\n                release_dir / f\"dbx-agent-{driver}-{platform}{extension}\",\n                release_dir / f\"dbx-agent-{driver}-{version}-{platform}{extension}\",\n            )\n            if artifact:\n                renamed.append(artifact)\n    return renamed\n\n\ndef main() -> None:\n    parser = argparse.ArgumentParser(description=\"Add module versions to DBX agent release filenames\")\n    parser.add_argument(\"release_dir\", type=Path)\n    parser.add_argument(\"versions_json\")\n    args = parser.parse_args()\n\n    versions = json.loads(args.versions_json)","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/scripts/version_agent_artifacts.py#L22-L58","documentation":"version_agent_artifacts() requires a version string for every driver listed in NATIVE_DRIVERS. If the supplied versions dict lacks an entry for a driver, it raises ValueError naming the missing driver, because the renamed artifact filename must embed the version. This fails fast before any files are renamed with an invalid name.","triggerScenarios":"Calling version_agent_artifacts(release_dir, versions) where versions does not contain a key for one of the NATIVE_DRIVERS (e.g. 'hive', 'zookeeper', 'sqlite-worker').","commonSituations":"A build step that extracts component versions failed silently and produced an incomplete versions dict; a new native driver added to NATIVE_DRIVERS but not wired into the version-resolution step; typo in the dict key.","solutions":["Populate the versions dict with an entry for the named driver before calling version_agent_artifacts","Check upstream version-extraction output (e.g. Maven/package metadata) for the missing driver","Compare the versions dict keys against NATIVE_DRIVERS to find the mismatch/typo"],"exampleFix":"// before\nversion_agent_artifacts(release_dir, {\"hive\": \"1.2.0\"})  # zookeeper missing\n// after\nversion_agent_artifacts(release_dir, {\"hive\": \"1.2.0\", \"zookeeper\": \"3.9.1\", ...})","handlingStrategy":"validation","validationCode":"missing = set(NATIVE_DRIVERS) - set(versions)\nif missing:\n    raise ValueError(f\"versions missing drivers: {missing}\")","typeGuard":null,"tryCatchPattern":"try:\n    version_agent_artifacts(release_dir, versions)\nexcept ValueError as e:\n    fail_build(f\"version resolution incomplete: {e}\")","preventionTips":["Assert the versions dict covers NATIVE_DRIVERS before invoking the script","Log upstream version-extraction output so silent failures are visible","Add a CI check that fails early when any component version is unresolved"],"tags":["python","configuration","release-automation","missing-version"],"backgroundTag":"missing-required-config","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}