-
Notifications
You must be signed in to change notification settings - Fork 683
Closed
Labels
Description
What happened?
Description
In Craft CMS 5, it is possible to end up with a persistent Project Config diff containing {} for categoryGroups, which cannot be resolved using standard recovery mechanisms such as:
• project-config/rebuild
• cache clearing
• disabling all plugins
• restarting the environment
This state causes Craft to continuously report that the Project Config is out of sync and can block plugin activation and safe deployments.
Example diff:
+ { }
categoryGroups:
<category-group-uid>:• project-config/rebuild should result in:
• no diff output, or
• at minimum, no empty root nodes ({}) shown as changes
Steps to reproduce
- No idea how to. I've updated from craft 4 to 5 and discovered this issue since a few weeks
Expected behavior
Expected Behavior
• project-config/rebuild should result in:
• no diff output, or
• at minimum, no empty root nodes ({}) shown as changes
### Actual behavior
it's always bringing the same update again for + { }
#### Observed Behavior
• craft project-config/diff always shows {} under categoryGroups
• The affected UID may change after project-config/rebuild
• The issue persists after:
• project-config/rebuild
• project-config/apply
• clear-caches/all
• disabling all plugins
• full environment restart (Docker/DDEV)
• Plugin enablement may fail with:
“The loaded project config is out-of-date.”
#### Key Findings & Analysis
##### 1. {} is not a YAML issue
• {} is not coming from the YAML files
• It is a runtime fallback produced when Craft fails to serialize an entity into Project Config
##### 2. {} indicates a non-serializable Category Group
The affected Category Groups:
• are not deleted
• have valid name, handle, structureId, fieldLayoutId
• Despite this, Craft fails to serialize them and falls back to an empty config node: return []; which appears as {} in the diff.
##### 3. possible relation to categorygroups_sites
• Category Groups must have valid site settings
• Craft 5 cannot serialize Category Groups without valid siteSettings
• In migrated projects (Craft 4 → 5), it appears possible for:
• categorygroups_sites records to be missing or inconsistent
• However, even when valid categorygroups_sites rows exist, the {} diff can still persist
##### 4. Rebuild can shift the problem, not fix it
• After running project-config/rebuild:
• the original UID may disappear
• {} appears for a different Category Group
• This suggests:
• Craft iterates over all Category Groups
• the first one that fails serialization produces {}
• Therefore {} acts as a global consistency indicator, not a single broken record
###### 5. Plugins are definitively excluded
• The issue persists with all plugins disabled
• Therefore, the cause is not plugin-related
• Root cause lies in Craft core, specifically:
• Project Config serialization
• Category Group → Project Config export
#### Suspected Root Cause
Craft CMS 5:
• treats {} as a valid Project Config diff
• lacks validation or repair for:
• partially invalid Category Groups
• invalid or non-serializable site settings
• project-config/rebuild provides no diagnostics explaining why serialization fails
### Craft CMS version
5.7
### PHP version
8.3.17
### Operating system and version
Linux 6.12.54-linuxkit
### Database type and version
MySQL 8.0.40
### Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
### Installed plugins and versions
Tested with and without all these plugins
Asset Summary 5.0.0
CKEditor 4.11.0
Colour Swatches 5.1.0
Control Panel Nav 5.0.5
Data center dev-master
Default Dashboard 3.0.2
Do It Yourself widget 4.1.1
Feed Me 6.11.0
Formie 3.1.7
Guide 5.3.3
SEO 5.0.0
Smith 3.1.1
Splash 5.0.0
Table Maker 5.0.6
Translation Helper 1.0.7
User Group Field 4.0.1
Vite 5.0.1
Reactions are currently unavailable