{"record":{"id":"b8b5cae40a839072","repo":"zylon-ai/private-gpt","slug":"local-ingestion-is-disabled-you-can-enable-it-in-s","errorCode":null,"errorMessage":"Local ingestion is disabled.You can enable it in settings `ingestion.enabled`","messagePattern":"Local ingestion is disabled\\.You can enable it in settings `ingestion\\.enabled`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/ingest_folder.py","lineNumber":32,"sourceCode":"\nCOLLECTION = \"collection\"\n\n\nclass LocalIngestWorker:\n    def __init__(self, ingest_service: IngestService, setting: Settings) -> None:\n        self.ingest_service = ingest_service\n\n        self.total_documents = 0\n        self.current_document_count = 0\n\n        self._files_under_root_folder: list[Path] = []\n\n        self.is_local_ingestion_enabled = setting.data.local_ingestion.enabled\n        self.allowed_local_folders = setting.data.local_ingestion.allow_ingest_from\n\n    def _validate_folder(self, folder_path: Path) -> None:\n        if not self.is_local_ingestion_enabled:\n            raise ValueError(\n                \"Local ingestion is disabled.\"\n                \"You can enable it in settings `ingestion.enabled`\"\n            )\n\n        # Allow all folders if wildcard is present\n        if \"*\" in self.allowed_local_folders:\n            return\n\n        for allowed_folder in self.allowed_local_folders:\n            if not folder_path.is_relative_to(allowed_folder):\n                raise ValueError(f\"Folder {folder_path} is not allowed for ingestion\")\n\n    def _find_all_files_in_folder(self, root_path: Path, ignored: list[str]) -> None:\n        \"\"\"Search all files under the root folder recursively.\n\n        Count them at the same time\n        \"\"\"\n        for file_path in root_path.iterdir():","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/scripts/ingest_folder.py#L14-L50","documentation":"Raised by LocalIngestWorker._validate_folder when local ingestion is switched off in settings (data.local_ingestion.enabled is false). Before any folder-allowlist check, the script verifies the master switch; ingesting local filesystem paths is a security-sensitive capability, so it fails closed with an explicit pointer to the setting. Note the message text references the older key 'ingestion.enabled' while the code reads data.local_ingestion.enabled.","triggerScenarios":"Running scripts/ingest_folder.py on a default settings.yaml where data.local_ingestion.enabled defaults to false; deployments that disabled local ingestion to harden the server; settings.override.yaml flipping the flag off after it was enabled earlier.","commonSituations":"Hardened docker deployments that forbid touching container-local paths; fresh installs where the operator never opted in to local ingestion; confusion because the error mentions 'ingestion.enabled' but the actual key lives under data.local_ingestion.enabled.","solutions":["Set data.local_ingestion.enabled: true in settings.yaml (or the matching env var) and restart/re-run","Confirm you are editing the file in a folder the loader actually searches (PGPT_SETTINGS_FOLDER / settings-<profile>.yaml precedence)","If ingestion must stay disabled, run ingestion through the API/UI instead of the local folder script"],"exampleFix":"# settings.yaml - before\ndata:\n  local_ingestion:\n    enabled: false\n\n# after\ndata:\n  local_ingestion:\n    enabled: true\n    allow_ingest_from:\n      - /var/data/corpus","handlingStrategy":"validation","validationCode":"from private_gpt.settings.settings import Settings\n\ndef can_ingest_locally(settings: Settings) -> bool:\n    return bool(settings.data.local_ingestion.enabled)\n\n# check before invoking LocalIngestWorker / scripts/ingest_folder.py","typeGuard":"null","tryCatchPattern":"try:\n    worker.ingest_folder(root, ignored)\nexcept ValueError as e:\n    if \"Local ingestion is disabled\" in str(e):\n        raise SystemExit(\"enable data.local_ingestion.enabled in settings.yaml\")\n    raise","preventionTips":["Treat data.local_ingestion.enabled as an explicit opt-in; document both required keys (enabled and allow_ingest_from) together","Fail deployment preflights with a clear message when local ingestion scripts run against hardened settings","Prefer API-based ingestion when local access must stay disabled"],"tags":["ingestion","security","configuration","scripts"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}