zylon-ai/private-gpt · error · ValueError

Local ingestion is disabled.You can enable it in settings `i

Error message

Local ingestion is disabled.You can enable it in settings `ingestion.enabled`

What it means

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.

Source

Thrown at scripts/ingest_folder.py:32

COLLECTION = "collection"


class LocalIngestWorker:
    def __init__(self, ingest_service: IngestService, setting: Settings) -> None:
        self.ingest_service = ingest_service

        self.total_documents = 0
        self.current_document_count = 0

        self._files_under_root_folder: list[Path] = []

        self.is_local_ingestion_enabled = setting.data.local_ingestion.enabled
        self.allowed_local_folders = setting.data.local_ingestion.allow_ingest_from

    def _validate_folder(self, folder_path: Path) -> None:
        if not self.is_local_ingestion_enabled:
            raise ValueError(
                "Local ingestion is disabled."
                "You can enable it in settings `ingestion.enabled`"
            )

        # Allow all folders if wildcard is present
        if "*" in self.allowed_local_folders:
            return

        for allowed_folder in self.allowed_local_folders:
            if not folder_path.is_relative_to(allowed_folder):
                raise ValueError(f"Folder {folder_path} is not allowed for ingestion")

    def _find_all_files_in_folder(self, root_path: Path, ignored: list[str]) -> None:
        """Search all files under the root folder recursively.

        Count them at the same time
        """
        for file_path in root_path.iterdir():

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Set data.local_ingestion.enabled: true in settings.yaml (or the matching env var) and restart/re-run
  2. Confirm you are editing the file in a folder the loader actually searches (PGPT_SETTINGS_FOLDER / settings-<profile>.yaml precedence)
  3. If ingestion must stay disabled, run ingestion through the API/UI instead of the local folder script

Example fix

# settings.yaml - before
data:
  local_ingestion:
    enabled: false

# after
data:
  local_ingestion:
    enabled: true
    allow_ingest_from:
      - /var/data/corpus
Defensive patterns

Strategy: validation

Validate before calling

from private_gpt.settings.settings import Settings

def can_ingest_locally(settings: Settings) -> bool:
    return bool(settings.data.local_ingestion.enabled)

# check before invoking LocalIngestWorker / scripts/ingest_folder.py

Type guard

null

Try / catch

try:
    worker.ingest_folder(root, ignored)
except ValueError as e:
    if "Local ingestion is disabled" in str(e):
        raise SystemExit("enable data.local_ingestion.enabled in settings.yaml")
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/b8b5cae40a839072. Report an issue: GitHub.