Skip to content

Message definition: after RENAME ATTRIBUTE, describe prints the member under the old attribute name; the output passes check but fails on exec ("has no attribute") #1733

Closed

Description

@TomNiesConclusion

1. mxcli version: nightly-20261103-6094f471f (Windows amd64)
2. Mendix version: 11.12.6
Repro app: a fresh mxcli new app, built by the script below

3. Scenario

After alter entity … rename attribute on an attribute that is a member of a message definition, describe message definition collection still prints the member under the old attribute name. The stored member does point at the renamed attribute (MyFirstModule.Booking.CustomerReference), but its stored element name and path keep Reference, and describe prints that name as if it were the attribute. Feeding the describe output back is refused: check --references passes, exec fails with has no attribute "Reference".

The rename itself leaves the message definition inconsistent (mx check: CE6524 "The domain model has changed and is no longer consistent with the message definition … Attribute … was previously called …"), but that is the same as a rename in Studio Pro 11.12.6, which reports the identical CE6524 and asks to refresh the message definition. So that part is Mendix behaviour; this issue is only about describe. Not related to #1386 (CE6524 from a one-to-one association's occurrence).

Self-contained repro, run in an empty directory (bash repro.sh):

#!/usr/bin/env bash
# Repro: after RENAME ATTRIBUTE, DESCRIBE of a message definition prints the old attribute name, and its output no longer passes check.
# Needs mxcli and a local mxbuild for `mxcli docker check`.
set -e
cd "$(dirname "$0")"
rm -rf Repro logs step1.mdl step2.mdl step3.mdl
export MXCLI_LOG_DIR="$PWD/logs"
P=Repro/Repro.mpr
mxcli new Repro --version 11.12.6 --skip-build > /dev/null

cat > step1.mdl <<'MDL'
mdl 1;
create persistent entity MyFirstModule.Booking (
  Reference: String(200),
  Code: String(200)
);
create message definition collection MyFirstModule.MD_Booking
{
  definition BookingMessage for MyFirstModule.Booking {
    Reference,
    Code
  }
};
MDL
mxcli -p $P exec step1.mdl 2>/dev/null

cat > step2.mdl <<'MDL'
mdl 1;
alter entity MyFirstModule.Booking rename attribute Reference to CustomerReference;
MDL
mxcli -p $P exec step2.mdl 2>/dev/null

echo "--- stored message definition strings after step 2"
f=$(grep -r -l -a 'MD_Booking' Repro/mprcontents | head -1)
grep -a -o -E '[[:print:]]{4,}' "$f" | grep -i -E 'reference' || true
echo "--- describe after step 2"
mxcli -p $P -c "describe message definition collection MyFirstModule.MD_Booking" 2>/dev/null > step3.mdl
cat step3.mdl
echo "--- check, then exec of the describe output"
mxcli check step3.mdl -p $P --references 2>/dev/null | tail -1
mxcli -p $P exec step3.mdl 2>&1 | grep -E '^Error|Modified|Created' || true

Output (progress lines left out):

Created entity: MyFirstModule.Booking
Created message definition collection: MyFirstModule.MD_Booking
Renamed attribute 'Reference' to 'CustomerReference' on entity MyFirstModule.Booking
Updated 1 reference(s) in 1 document(s)
Note: uses in microflow expressions ($obj/Reference) are stored as text and were not rewritten — run 'mxcli docker check' to find them.
--- stored message definition strings after step 2
Booking|Reference
Reference
Reference
MyFirstModule.Booking.CustomerReference
--- describe after step 2
mdl 1;
create or modify message definition collection MyFirstModule.MD_Booking
{
  definition BookingMessage for MyFirstModule.Booking {
    Reference,
    Code
  }
};
--- check, then exec of the describe output
Check passed!
Error: message definition MyFirstModule.MD_Booking.BookingMessage: MyFirstModule.Booking has no attribute "Reference"; available: Code, CustomerReference

4. Expected output

  • describe prints the member by the attribute it references, with the stored exposed name when that differs: CustomerReference AS 'Reference',. That is what is stored, it round-trips, and it keeps the exposed name (the message contract) unchanged.
  • check --references and exec agree: if the describe output cannot be executed, check reports it too.
  • Optional: rename attribute notes that the message definition needs a refresh (CE6524), like its note about microflow expressions.

5. Experienced output

Expected Actual
Stored member attribute MyFirstModule.Booking.CustomerReference MyFirstModule.Booking.CustomerReference ✔
Stored element name / path Reference / Booking|Reference (until a refresh) same ✔
describe CustomerReference AS 'Reference', Reference, ✘
check --references on the describe output passes passes
exec of the describe output succeeds Error: … has no attribute "Reference" ✘

6. AI bug report

mxcli diag (log dir isolated to this repro):

mxcli diagnostics
  Version:     nightly-20261103-6094f471f
  Go:          go1.27.3 windows/amd64
  Log dir:     <repro>\logs
  Log files:   1 files (5 KB)
  Sessions:    6 (last 7 days)
  Errors:      1 (last 7 days)

Recent errors:
  [2026-11-03 14:59] CreateMessageDefinitionCollectionStmt: message definition MyFirstModule.MD_Booking.BookingMessage: MyFirstModule.Booking has no attribute "Reference"; available: Code, CustomerReference

Log lines of the exec of the describe output:

{"time":"2026-11-03T14:59:01.1764441+01:00","level":"INFO","msg":"session_start","version":"nightly-20261103-6094f471f","go":"go1.27.3","os":"windows","arch":"amd64","mode":"mxcli exec","args":["mxcli","-p","Repro/Repro.mpr","exec","step3.mdl"],"pid":23932,"parent_pid":""}
{"time":"2026-11-03T14:59:01.4175634+01:00","level":"ERROR","msg":"execute_error","stmt_type":"CreateMessageDefinitionCollectionStmt","stmt_summary":"CreateMessageDefinitionCollectionStmt","error":"message definition MyFirstModule.MD_Booking.BookingMessage: MyFirstModule.Booking has no attribute \"Reference\"; available: Code, CustomerReference","duration_ms":8}

The log shows the exec failing on the member name that describe printed; check --references on the same file had passed.

Why it matters

Renaming an attribute that an API exposes through a message definition is a normal refactoring. Afterwards, every describe → edit → create or modify of that message definition (for example to add a member) fails until it is refreshed in Studio Pro, and if the script is edited by hand to use the new name, the exposed name changes too, which changes the message contract.

Activity

  1. added a commit that references this issue on Nov 5, 2026
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