How to fix No FieldLayoutScheme found for id XXXXX during deployment
Problem
From time to time, Jira's fieldlayoutschemeentity table has abandoned references from a field configuration to a field configuration scheme.
Caused by: com.atlassian.jira.exception.DataAccessException: No FieldLayoutScheme found for id 11301
at com.atlassian.jira.issue.fields.layout.field.DefaultFieldLayoutManager$ConfigurationSchemeCacheLoader.load(DefaultFieldLayoutManager.java:834)From the log entries above, there is a problem with an association between a Field Configuration and a Field Configuration Scheme.
Solution
Perform an integrity check on the target instance:
Jira - https://confluence.atlassian.com/adminjiraserver/using-the-database-integrity-checker-938847667.html
Configuration Manager for Jira (CMJ)- https://appfire.atlassian.net/wiki/spaces/CMJ/pages/198116074
Resolve the CMJ integrity check errors by following the quick fix article
If the issue persists after executing an integrity check, run the following database query on the target instance to delete the missing references.
DELETE FROM fieldlayoutschemeentity WHERE scheme NOT IN (SELECT id FROM fieldlayoutscheme);DELETE statements are to be used at your own risk.
Take a database dump before deleting rows from your database.