{"record":{"id":"d4265f2cd9925e6c","repo":"blakeblackshear/frigate","slug":"custom-model-zip-not-found-self-memx-model-path","errorCode":null,"errorMessage":"Custom model zip not found: {self.memx_model_path}","messagePattern":"Custom model zip not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"frigate/detectors/plugins/memryx.py","lineNumber":209,"sourceCode":"            raise\n\n    def check_and_prepare_model(self):\n        if not os.path.exists(self.cache_dir):\n            os.makedirs(self.cache_dir, exist_ok=True)\n\n        lock_path = os.path.join(self.cache_dir, f\".{self.model_folder}.lock\")\n        lock = FileLock(lock_path, timeout=60)\n\n        with lock:\n            # ---------- CASE 1: user provided a custom model path ----------\n            if self.memx_model_path:\n                if not self.memx_model_path.endswith(\".zip\"):\n                    raise ValueError(\n                        f\"Invalid model path: {self.memx_model_path}. \"\n                        \"Only .zip files are supported. Please provide a .zip model archive.\"\n                    )\n                if not os.path.exists(self.memx_model_path):\n                    raise FileNotFoundError(\n                        f\"Custom model zip not found: {self.memx_model_path}\"\n                    )\n\n                logger.info(f\"User provided zip model: {self.memx_model_path}\")\n\n                # Extract custom zip into a separate area so it never clashes with MemryX cache\n                custom_dir = os.path.join(\n                    self.cache_dir, \"custom_models\", self.model_folder\n                )\n                if os.path.isdir(custom_dir):\n                    shutil.rmtree(custom_dir)\n                os.makedirs(custom_dir, exist_ok=True)\n\n                with zipfile.ZipFile(self.memx_model_path, \"r\") as zip_ref:\n                    zip_ref.extractall(custom_dir)\n                logger.info(f\"Custom model extracted to {custom_dir}.\")\n\n                # Find .dfp and optional *_post.onnx recursively","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/blakeblackshear/frigate/blob/ca18b8dc131ccb3e086f13a780853b775ef13426/frigate/detectors/plugins/memryx.py#L191-L227","documentation":"The memryx detector was given a custom model zip path (it ends with .zip) but os.path.exists fails, so check_and_prepare_model raises FileNotFoundError. The file is simply not present at that location inside the Frigate container.","triggerScenarios":"Configuring a .zip model path that does not exist in the container: unmounted volume, host path used instead of container path, typo, or file not yet synced.","commonSituations":"Missing docker volume mount for the models directory; path correct on host but not in container; USB/NAS mount not ready at container start; case-sensitive filename mismatch.","solutions":["docker exec into the container and confirm the zip exists at the exact configured path","Fix/add the volume mount mapping the host models dir to the container path used in config","Correct filename typos and ensure mounts are available before Frigate starts"],"exampleFix":"# before\npath: /models/memryx/model.zip  # not mounted\n# after (docker-compose)\nvolumes:\n  - /host/models:/models\n# path: /models/model.zip","handlingStrategy":"validation","validationCode":"import os\n\ndef zip_exists(path: str) -> bool:\n    return path.endswith('.zip') and os.path.isfile(path)","typeGuard":null,"tryCatchPattern":"try:\n    detector = MemryXDetector(config)\nexcept FileNotFoundError as e:\n    if 'Custom model zip not found' in str(e):\n        raise SystemExit(f'Mount/verify {path} inside the container') from None\n    raise","preventionTips":["Mount the models volume and use container paths in config","Pre-flight check configured model files at startup","Avoid NAS/USB paths that may mount after container start"],"tags":["memryx","file-not-found","model-path","docker-mount"],"backgroundTag":"model-file-missing","analyzedSha":"ca18b8dc131ccb3e086f13a780853b775ef13426","analyzedAt":"2026-08-27T11:28:05.618Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}