Skip to content

diff-local always fails with "mprcontents directory not found" on a project where the directory exists #1038

Description

@TOFBuck

diff-local always fails with "mprcontents directory not found" — on a project where the directory exists and mxcli itself stats it successfully

mxcli version

mxcli version v0.20.0 (2026-08-28T13:22:53Z)

Also reproduced on v0.19.0 and v0.18.0 (same binary family, same machine).
This is not a v0.20.0 regression — the command appears to have never worked here.

Mendix version

10.24.24.119653 (MPR v2 format, mprcontents/ on disk — confirmed by mxcli's
own connect log: "mpr_format":2)

Environment

  • linux / arm64, Go 1.26.6 (from mxcli's session log)
  • Project is at the git repository root, .git is a normal directory
  • mprcontents/ is tracked by git

Severity

Medium.

diff-local is the only command that answers "what changed in the model since a git
ref". It is the documented way to derive a change list before handing model work to
another branch. With it broken there is no substitute: mxcli diff compares an MDL
script against the project, which is a different question.

Not High, because it is a read-only reporting command — no data or security impact.

Steps to reproduce

On any MPR v2 project inside a git repository, with mprcontents/ tracked:

mxcli diff-local -p App.mpr

Expected behaviour

Either a diff of the changed .mxunit files, or "no local changes".

Actual behaviour

Connected to: App.mpr (Mendix 10.24.24.119653)
Error: mprcontents directory not found

The connect step succeeds and correctly reports mpr_format: 2, which already proves
mxcli located mprcontents/.

Evidence: mxcli finds the directory and then reports it missing

strace on the failing run (strace -f -e trace=openat,newfstatat,statx,execve):

newfstatat(AT_FDCWD, "App.mpr",     {st_mode=S_IFREG|0644, st_size=413696, ...}, 0) = 0
newfstatat(AT_FDCWD, "mprcontents", {st_mode=S_IFDIR|0755, st_size=8288,   ...}, 0) = 0
                                     ^^^^^^^^^ is a directory              ^^^ success
...
Error: mprcontents directory not found

Two further observations from the same trace:

  1. mprcontents is stat'ed exactly once, during connect, and it succeeds. The
    diff-local code path never stats it again — so whatever it tests, it is not the
    filesystem.
  2. .git is never opened and git is never exec'ed. The trace contains exactly
    one execve (mxcli itself) and zero accesses to any .git path. The command's own
    embedded documentation says it works by running git diff --name-status, so it
    aborts before reaching any of its actual work.

Directory state at the time of the run:

$ ls -ld mprcontents
drwxr-xr-x 259 user user 8288 mprcontents

$ ls mprcontents | wc -l
257

$ git ls-tree HEAD --name-only | grep -x mprcontents
mprcontents

The failure is invariant

Every one of these produces the identical message:

Variation Result
-p App.mpr fail
-p ./App.mpr fail
-p /abs/path/App.mpr fail
run from the parent directory, -p subdir/App.mpr fail
--ref HEAD (default) fail
--ref HEAD~1 fail
--ref origin/<branch> fail
--format struct / --format unified fail
--json fail, same plain-text message (not JSON-wrapped)
working tree clean fail
working tree with modified .mxunit files fail
mxcli v0.20.0 / v0.19.0 / v0.18.0 fail all three

Notes for triage

  • There appear to be two distinct "no mprcontents" strings in the binary:
    Not an MPR v2 project (no mprcontents directory) and
    mprcontents directory not found. Only the second one is emitted here, and it is
    emitted after the v2 detection has already succeeded.
  • Because --json does not wrap this error, an automated caller cannot distinguish it
    from any other failure.

Workaround

None for this command. The nearest substitute answers a different question:

mxcli diff -p App.mpr script.mdl --format struct    # script vs project, not model vs git

Diagnostic bundle

Yes — mxcli-diag-20260904-091156.tar.gz, available on request.

Activity

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