When registering or analysing a catalog-info.yaml, Backstage checks the naming rules first. A space or another special character in metadata.name leads to Policy check failed – the entity never enters the catalog.
Symptom
InputError: Policy check failed for component:default/sendungs archiv; caused by Error: "metadata.name" is not valid; expected a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters …
The message names the broken name and the rule.
Diagnosis
The same dry run the GUI's ANALYZE runs checks a file without registering it.
pruefe() {
local u="$FORGEJO/kranich/sendungsverfolgung/src/branch/main/$1"
curl -s -H "Authorization: Bearer $BACKSTAGE_TOKEN" \
-H 'Content-Type: application/json' -X POST \
"$BACKSTAGE/api/catalog/locations?dryRun=true" \
-d "{\"type\":\"url\",\"target\":\"$u\"}" \
| jq -r '.error.message // "ok"' | cut -c1-170
}
Causes
LeerzeichenIllegal character in the name
metadata.name may only consist of letters and digits separated by -, _ or ., at most 63 characters. Uppercase letters are allowed; the space in “sendungs archiv” is not.
unbekannter KindRelated error: kind not allowed
An unknown kind already fails at catalog.rules before any schema is checked.
NotAllowedError: Entity komponente:default/sendungs-archiv at url:http://127.0.0… is not of an allowed kind for that location
Fix
Don't: Confusing the name with display text. For a readable label with spaces there is metadata.title.
Backstage hands-on, day 2: the data model, required fields, naming rules and dry runs against the catalog API.
Go to day 2 →
FAQ
Are uppercase letters allowed?
Yes. Only spaces and characters other than -, _ and . are forbidden.
How do I check many files before merging?
With the dry run against /api/catalog/locations?dryRun=true, for example in CI.