Skip to content

project status and doctor crash with a traceback (exit 1, no JSON under --json) when a family member link loops #38

Open

Description

@brettheap

Lane: openRepoProject-1

Filed on Brett Heap's word "all recommended" (2026-10-22T19:46:44Z), which adopted lane openRepoProject-1's recommendation to file this defect as its own issue. The adversary of the council on PR #37 (governing issue #36) found it. That change records it as Out of Scope, because it does not touch status or doctor. This issue reports it and claims nothing.

Defect

project status (and doctor, through the same snapshot()) crashes with a Python traceback when a family member's directory is a symbolic link that loops. It exits 1, and prints nothing on standard output even under --json.

Reproduction (main at 15504f1; Python 3.12.3 and 3.10.18 alike)

A projects directory P holding one family:

P/loop/loop/family.yaml     # kind: family-manifest, name: loop, members: [{project: web, id: web}]
P/loop/web  -> web2         # symbolic link
P/loop/web2 -> web          # symbolic link: web and web2 loop
PROJECTS_DIR=P project status loop --json

Observed: exit status 1, standard output empty, and on standard error:

  File ".../project", line 1142, in main
  File ".../project", line 937, in inspect_project
  File ".../project", line 852, in snapshot
  File ".../project", line 54, in inside
    raise RuntimeError("Symlink loop from %r" % e.filename)
RuntimeError: Symlink loop from '.../loop/web'

The same happens without --json, and for a self-loop (P/selfie/me -> me). The lane re-ran the --json case on main at 15504f1 on 2026-10-22. The adversary's runs on 3.12 and 3.10 are recorded with the council's report.

Cause

  • inside() resolves a member path with Path.resolve() (project:51-57, reached from snapshot() at project:852). On a loop, Path.resolve() raises RuntimeError, which is not an OSError.
  • main() catches only Refused and OSError (project:1143), so the error escapes as a traceback.
  • os.path.realpath(strict=True) raises OSError with errno 40 (ELOOP) on the same fixture, on both Pythons.

Expected

A clean refusal, as the other bad-member cases already give: exit 2 with a one-line message naming the member, and under --json the JSON error object the other refusals print (for example "Cyclic estate membership" for two entries naming one sibling, or "Path escapes its owner"). Not a traceback with exit 1.

Notes

Activity

  1. brettheap commented on Oct 23, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoProject-1, session a0e10447-aab0-411d-8015-359674fb42ea@Eagle, 2026-10-23T13:33:40Z, for #38

    Logged in lanes/log/openRepoProject-1.md at d8d7dcb9ea204bbf5f2a4b7cdd790441120c9dcc.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoProject#38:
       none
    2. `gh pr list --repo opensoft/openRepoProject --state all --search "#38"`, kept where the row or its body names `#38`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoProject` branches naming `38` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions