Discovery fails: FileNotFoundError on /app/config/notion.yaml #25

Closed
opened 2026-03-21 00:21:24 -07:00 by pyr0ball · 0 comments
Owner

Bug Report

Summary

Running discovery produces an immediate failure:

Discovery failed: [Errno 2] No such file or directory: '/app/config/notion.yaml'

Steps to Reproduce

  1. Open Peregrine (cloud or self-hosted)
  2. Run discovery
  3. Discovery fails immediately with the above error

Expected Behavior

Discovery should run normally. If Notion integration is not configured, it should skip gracefully — not crash.

Actual Behavior

Discovery aborts entirely because notion.yaml does not exist.

Root Cause (likely)

Code is doing an unconditional open/read of /app/config/notion.yaml before checking whether the Notion integration is enabled. The file is optional (Notion is an optional integration) so its absence should be handled with a try/except FileNotFoundError or an existence check, and the integration should be skipped if the file is missing.

Fix Direction

  • Guard the notion.yaml load with existence check or try/except
  • If file is absent, skip Notion source silently (or log at DEBUG level)
  • Do not abort discovery for a missing optional integration config

Priority

High — discovery is completely broken when Notion config file is absent (default state for most users)


Fix

Fixed in scripts/discover.pyload_config() now returns None for notion_cfg when the file is absent; run_discovery() only raises if notion_push=True and the file is missing. Also hardened scripts/sync.py, scripts/match.py, and scripts/llm_router.py with the same pattern (clear FileNotFoundError messages pointing to .example templates for each). Docker image rebuilt and redeployed.

## Bug Report ### Summary Running discovery produces an immediate failure: ``` Discovery failed: [Errno 2] No such file or directory: '/app/config/notion.yaml' ``` ### Steps to Reproduce 1. Open Peregrine (cloud or self-hosted) 2. Run discovery 3. Discovery fails immediately with the above error ### Expected Behavior Discovery should run normally. If Notion integration is not configured, it should skip gracefully — not crash. ### Actual Behavior Discovery aborts entirely because `notion.yaml` does not exist. ### Root Cause (likely) Code is doing an unconditional open/read of `/app/config/notion.yaml` before checking whether the Notion integration is enabled. The file is optional (Notion is an optional integration) so its absence should be handled with a `try/except FileNotFoundError` or an existence check, and the integration should be skipped if the file is missing. ### Fix Direction - Guard the `notion.yaml` load with existence check or try/except - If file is absent, skip Notion source silently (or log at DEBUG level) - Do not abort discovery for a missing optional integration config ### Priority High — discovery is completely broken when Notion config file is absent (default state for most users) --- ## Fix Fixed in `scripts/discover.py` — `load_config()` now returns `None` for `notion_cfg` when the file is absent; `run_discovery()` only raises if `notion_push=True` and the file is missing. Also hardened `scripts/sync.py`, `scripts/match.py`, and `scripts/llm_router.py` with the same pattern (clear `FileNotFoundError` messages pointing to `.example` templates for each). Docker image rebuilt and redeployed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/peregrine#25
No description provided.