Forum Discussion
Error on deployment on a CHE
This kind of issue usually points to something specific inside that database, rather than the CHE or the deployment pipeline itself , especially since:
- DB sync works fine from Visual Studio
- Deployment succeeds with a fresh/empty DB
- Restoring the same DB to another CHE reproduces the problem
That combination strongly suggests data or metadata inconsistencies that only surface during the AOS Global Update script phase (step 11), which runs a broader set of checks and upgrade logic than a standard VS DB sync.
A few practical things that have helped in similar cases:
1.Check deployment logs in detail
The failure at step 11 should produce SQL or X++ errors in the LCS deployment logs (and sometimes in the SQL error log). Look for:
Failing upgrade scripts
Missing objects, invalid metadata references
Duplicate keys or orphaned records in system tables
VS DB sync is more forgiving; the deployment upgrade is not.
2.Validate system tables and metadata
Issues often come from corrupted or inconsistent data in tables like:
SQLDictionary, SQLMetadata, UtilElements, SysModel*
Custom extension metadata referencing objects that no longer exist
If possible, compare these tables against a known-good environment.
3.Run DB validation / consistency checks
If this is a D365FO-style environment, run:
Full DB sync + compile with “report errors”
Metadata validation (best practice checks)
Any available DB consistency or validation jobs
Even if they don’t fail hard, warnings can point you to the root cause.
4.Look at recent changes to the master DB
If this DB has gone through multiple restores, upgrades, or partial deployments, it may contain:
Incomplete upgrade history
Leftover artifacts from removed models or extensions
Sometimes exporting/importing configuration data into a clean DB is safer than continuing to reuse a problematic master DB.
5.Escalate with logs if needed
Since this blocks CHE deployments and the DB is business-critical, opening a Microsoft support ticket with:
The failing deployment ID
Full step 11 logs
Confirmation that the issue reproduces across CHEs
is usually the fastest way to get a definitive answer.
Hope that helps , curious if anyone else has hit a similar “DB works in VS but fails in CHE deployment” scenario and what finally fixed it.