Answers.Body: <p>The only place that message appears in the Craft CMS codebase is <a href="https://github.com/craftcms/cms/blob/f65480f0af7097bd851846c016e3bcd2b4d0c93b/src/fieldlayoutelements/CustomField.php#L106" rel="nofollow noreferrer">here</a>.</p>
  <p>So, the most likely cause is that something (Craft itself or a plugin/custom module) is calling the <code>setFieldUid()</code> method on a <code>CustomField</code> instance (i.e. a custom field in a field layout), passing the UID for a field that doesn't actually exist in your database. I've never seen that happen, and it's difficult to say what the root cause could be.</p>
  <p>Things to try:</p>
  <ul>
  <li>Clear your data caches and compiled templates</li>
  <li>Make sure project config is in sync</li>
  <li>Search for the &quot;Invalid field UID&quot; message in your log files (<code>storage/logs</code>) to hopefully determine the root cause</li>
  <li>Turn on <code>devMode</code> to hopefully make Craft throw up a stack trace</li>
  <li>Search for the <code>22faa4bf-2fb5-415b-b4e9-2416fe728843</code> UID in the <code>fields</code> database column. Is there a field with that UID or not?</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-31T22:08:04.047Z
Answers.Text: Thx Mats. Ive updated the post with the stack trace, and synced project config, cleared caches, searched db. Its kinda of circular to search for the uid that doesn't exist. I might step thru plugins and turn off/uninstall. Any more ideas welcome.
Answers.UserDisplayName: joomkit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-01T06:25:39.273Z
Answers.Text: @joomkit Try deleting the folder `storage/runtime/compiled_classes`
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-11T09:40:09.983Z
Answers.Text: It turned out to be a field layout - very hard to find and only solved by editing UI/ db change rather than project files changes
Answers.UserDisplayName: joomkit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-31T07:33:23.773Z
Answers.LastActivityDate: 2022-03-31T07:33:23.773Z
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.Body: <p>I had the same thing it was an old Entry Instructions field that was a Craft 2 plugin. Search for the invalid UID in your /config/project folder - that is where I located mine. It will show up in a field layout project config file and the file name and info in the file will tell you which entry type/field layout it is. If you go there and resave the entry type field layout, it will update your project config files and fix the problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-26T21:44:06.000Z
Answers.Text: This worked for me. Thanks Chad! - Brian from Flannel
Answers.UserDisplayName: Brimby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-24T19:05:02.903Z
Answers.LastActivityDate: 2022-05-24T19:05:02.903Z
Answers.UserDisplayName: Chad Crowell
Body: <p>I keep seeing this in the craft debug bar in the control panel</p>
  <p>Invalid field UID: 22faa4bf-2fb5-415b-b4e9-2416fe728843</p>
  <p>How can I investigate what this means and resolve it?</p>
  <p>UPDATE:
  I've searched the fields table and layouts tbale for the uid and been thru PhpStorm project searches and it doesn't show up anywhere in the project logs/config.</p>
  <p>Here is the stack trace</p>
  <pre><code>yii\base\InvalidArgumentException: Invalid field UID: 22faa4bf-2fb5-415b-b4e9-2416fe728843 in /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php:109
  Stack trace:
  #0 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/BaseObject.php(159): craft\fieldlayoutelements\CustomField-&gt;setFieldUid('22faa4bf-2fb5-4...')
  #1 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\BaseObject-&gt;__set('fieldUid', '22faa4bf-2fb5-4...')
  #2 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\fieldlayoutelements\CustomField), Array)
  #3 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(59): yii\base\BaseObject-&gt;__construct(Array)
  #4 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(39): craft\fieldlayoutelements\BaseField-&gt;__construct(Array)
  #5 [internal function]: craft\fieldlayoutelements\CustomField-&gt;__construct(NULL, Array)
  #6 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass-&gt;newInstanceArgs(Array)
  #7 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container-&gt;build('craft\\fieldlayo...', Array, Array)
  #8 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container-&gt;get('craft\\fieldlayo...', Array, Array)
  #9 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/Craft.php(61): yii\BaseYii::createObject(Array, Array)
  #10 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Fields.php(1340): Craft::createObject(Array)
  #11 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/models/FieldLayoutTab.php(141): craft\services\Fields-&gt;createLayoutElement(Array)
  #12 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\models\FieldLayoutTab-&gt;init()
  #13 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Fields.php(1225): yii\base\BaseObject-&gt;__construct(Array)
  #14 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Fields.php(1247): craft\services\Fields-&gt;_createLayoutTabFromRow(Array, true)
  #15 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Fields.php(1135): craft\services\Fields-&gt;_loadTabs(Array)
  #16 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Sections.php(1032): craft\services\Fields-&gt;getLayoutsByIds(Array)
  #17 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Sections.php(1009): craft\services\Sections-&gt;_entryTypes()
  #18 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/models/Section.php(334): craft\services\Sections-&gt;getEntryTypesBySectionId(37)
  #19 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(518): craft\models\Section-&gt;getEntryTypes()
  #20 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(499): craft\web\assets\cp\CpAsset-&gt;_entryTypes(Object(craft\models\Section))
  #21 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(373): craft\web\assets\cp\CpAsset-&gt;_publishableSections(Object(craft\elements\User))
  #22 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(100): craft\web\assets\cp\CpAsset-&gt;_craftData()
  #23 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/View.php(274): craft\web\assets\cpname\CpAsset-&gt;registerAssetFiles(Object(craft\web\View))
  #24 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(1953): yii\web\View-&gt;registerAssetFiles('craft\\web\\asset...')
  #25 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/View.php(272): craft\web\View-&gt;registerAssetFiles('craft\\web\\asset...')
  #26 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(1953): yii\web\View-&gt;registerAssetFiles('verbb\\base\\asse...')
  #27 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/View.php(272): craft\web\View-&gt;registerAssetFiles('verbb\\base\\asse...')
  #28 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(1953): yii\web\View-&gt;registerAssetFiles('verbb\\iconpicke...')
  #29 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/View.php(168): craft\web\View-&gt;registerAssetFiles('verbb\\iconpicke...')
  #30 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(1161): yii\web\View-&gt;endBody()
  #31 /Users/name/sites/health-trust/craft/storage/runtime/compiled_templates/56/568a431c5389273bf2501ea26fe51d9659313197e375b8fd81f18fe76e75e287.php(102): craft\web\View-&gt;endBody()
  #32 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(405): __TwigTemplate_b06f297580a96620ddc33c45b35d0cac2eace54c8e25618266c8056f0bfb069c-&gt;doDisplay(Array, Array)
  #33 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(378): Twig\Template-&gt;displayWithErrorHandling(Array, Array)
  #34 /Users/name/sites/health-trust/craft/storage/runtime/compiled_templates/41/4144a3f1a7a70c4eda99d48a48c6c9ff6015246edff28267f235f7b05ea9c0ca.php(56): Twig\Template-&gt;display(Array, Array)
  #35 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(405): __TwigTemplate_345517481bee85cb217815bf276f85b3947944acdd6ab76e29f6acbcb6a4ec18-&gt;doDisplay(Array, Array)
  #36 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(378): Twig\Template-&gt;displayWithErrorHandling(Array, Array)
  #37 /Users/name/sites/health-trust/craft/storage/runtime/compiled_templates/b5/b5cc4b1504a9d4c93efb67efb076f10d665c926e68e357d38f06755412cd2d83.php(165): Twig\Template-&gt;display(Array, Array)
  #38 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(405): __TwigTemplate_240f80d3e59f671ba92edcafb2bbf7713041fd42d1a9ba49b2479a60c6eb7e03-&gt;doDisplay(Array, Array)
  #39 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(378): Twig\Template-&gt;displayWithErrorHandling(Array, Array)
  #40 /Users/name/sites/health-trust/craft/storage/runtime/compiled_templates/50/5035e9af462f183270c876e7fd71abb068acd541f9bcc4ef95eab13f1b6d2353.php(49): Twig\Template-&gt;display(Array, Array)
  #41 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(405): __TwigTemplate_80a606bc74b28e25753ba0d4dd38790cffeea1dc6e5f591d26dbac42cdfc1f55-&gt;doDisplay(Array, Array)
  #42 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(378): Twig\Template-&gt;displayWithErrorHandling(Array, Array)
  #43 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(390): Twig\Template-&gt;display(Array)
  #44 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template-&gt;render(Array, Array)
  #45 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper-&gt;render(Array)
  #46 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(408): Twig\Environment-&gt;render('utilities/_inde...', Array)
  #47 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(461): craft\web\View-&gt;renderTemplate('utilities/_inde...', Array)
  #48 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/Controller.php(201): craft\web\View-&gt;renderPageTemplate('utilities/_inde...', Array, 'cp')
  #49 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/controllers/UtilitiesController.php(89): craft\web\Controller-&gt;renderTemplate('utilities/_inde...', Array)
  #50 [internal function]: craft\controllers\UtilitiesController-&gt;actionShowUtility('system-report')
  #51 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
  #52 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction-&gt;runWithParams(Array)
  #53 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller-&gt;runAction('show-utility', Array)
  #54 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module-&gt;runAction('utilities/show-...', Array)
  #55 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application-&gt;runAction('utilities/show-...', Array)
  #56 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application-&gt;handleRequest(Object(craft\web\Request))
  #57 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application-&gt;handleRequest(Object(craft\web\Request))
  #58 /Users/name/sites/health-trust/craft/public_html/index.php(26): yii\base\Application-&gt;run()
  #59 /Users/name/.composer/vendor/laravel/valet/server.php(235): require('/Users/alanspar...')
  #60 {main}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-31T08:30:38.103Z
Comments.Text: I'm seeing a similar error - let me know if you find out the cause
Comments.UserDisplayName: James Smith
Tags: <control-panel><debugging>
Title: Invalid field uid
ThreadText: # Invalid field uid
  
  (Asked by: username_0 on 2022-03-29)
  
  I keep seeing this in the craft debug bar in the control panel
  
  Invalid field UID: 22faa4bf-2fb5-415b-b4e9-2416fe728843
  
  How can I investigate what this means and resolve it?
  
  UPDATE:
  I've searched the fields table and layouts tbale for the uid and been thru PhpStorm project searches and it doesn't show up anywhere in the project logs/config.
  
  Here is the stack trace
  
  ```
  yii\base\InvalidArgumentException: Invalid field UID: 22faa4bf-2fb5-415b-b4e9-2416fe728843 in /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php:109
  Stack trace:
  #0 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/BaseObject.php(159): craft\fieldlayoutelements\CustomField->setFieldUid('22faa4bf-2fb5-4...')
  #1 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\BaseObject->__set('fieldUid', '22faa4bf-2fb5-4...')
  #2 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\fieldlayoutelements\CustomField), Array)
  #3 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(59): yii\base\BaseObject->__construct(Array)
  #4 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(39): craft\fieldlayoutelements\BaseField->__construct(Array)
  #5 [internal function]: craft\fieldlayoutelements\CustomField->__construct(NULL, Array)
  #6 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)
  #7 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('craft\\fieldlayo...', Array, Array)
  #8 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\fieldlayo...', Array, Array)
  #9 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/Craft.php(61): yii\BaseYii::createObject(Array, Array)
  #10 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Fields.php(1340): Craft::createObject(Array)
  #11 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/models/FieldLayoutTab.php(141): craft\services\Fields->createLayoutElement(Array)
  #12 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\models\FieldLayoutTab->init()
  #13 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Fields.php(1225): yii\base\BaseObject->__construct(Array)
  #14 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Fields.php(1247): craft\services\Fields->_createLayoutTabFromRow(Array, true)
  #15 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Fields.php(1135): craft\services\Fields->_loadTabs(Array)
  #16 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Sections.php(1032): craft\services\Fields->getLayoutsByIds(Array)
  #17 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/services/Sections.php(1009): craft\services\Sections->_entryTypes()
  #18 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/models/Section.php(334): craft\services\Sections->getEntryTypesBySectionId(37)
  #19 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(518): craft\models\Section->getEntryTypes()
  #20 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(499): craft\web\assets\cp\CpAsset->_entryTypes(Object(craft\models\Section))
  #21 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(373): craft\web\assets\cp\CpAsset->_publishableSections(Object(craft\elements\User))
  #22 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(100): craft\web\assets\cp\CpAsset->_craftData()
  #23 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/View.php(274): craft\web\assets\cpname\CpAsset->registerAssetFiles(Object(craft\web\View))
  #24 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(1953): yii\web\View->registerAssetFiles('craft\\web\\asset...')
  #25 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/View.php(272): craft\web\View->registerAssetFiles('craft\\web\\asset...')
  #26 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(1953): yii\web\View->registerAssetFiles('verbb\\base\\asse...')
  #27 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/View.php(272): craft\web\View->registerAssetFiles('verbb\\base\\asse...')
  #28 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(1953): yii\web\View->registerAssetFiles('verbb\\iconpicke...')
  #29 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/View.php(168): craft\web\View->registerAssetFiles('verbb\\iconpicke...')
  #30 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(1161): yii\web\View->endBody()
  #31 /Users/name/sites/health-trust/craft/storage/runtime/compiled_templates/56/568a431c5389273bf2501ea26fe51d9659313197e375b8fd81f18fe76e75e287.php(102): craft\web\View->endBody()
  #32 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(405): __TwigTemplate_b06f297580a96620ddc33c45b35d0cac2eace54c8e25618266c8056f0bfb069c->doDisplay(Array, Array)
  #33 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
  #34 /Users/name/sites/health-trust/craft/storage/runtime/compiled_templates/41/4144a3f1a7a70c4eda99d48a48c6c9ff6015246edff28267f235f7b05ea9c0ca.php(56): Twig\Template->display(Array, Array)
  #35 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(405): __TwigTemplate_345517481bee85cb217815bf276f85b3947944acdd6ab76e29f6acbcb6a4ec18->doDisplay(Array, Array)
  #36 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
  #37 /Users/name/sites/health-trust/craft/storage/runtime/compiled_templates/b5/b5cc4b1504a9d4c93efb67efb076f10d665c926e68e357d38f06755412cd2d83.php(165): Twig\Template->display(Array, Array)
  #38 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(405): __TwigTemplate_240f80d3e59f671ba92edcafb2bbf7713041fd42d1a9ba49b2479a60c6eb7e03->doDisplay(Array, Array)
  #39 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
  #40 /Users/name/sites/health-trust/craft/storage/runtime/compiled_templates/50/5035e9af462f183270c876e7fd71abb068acd541f9bcc4ef95eab13f1b6d2353.php(49): Twig\Template->display(Array, Array)
  #41 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(405): __TwigTemplate_80a606bc74b28e25753ba0d4dd38790cffeea1dc6e5f591d26dbac42cdfc1f55->doDisplay(Array, Array)
  #42 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
  #43 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
  #44 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
  #45 /Users/name/sites/health-trust/craft/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
  #46 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(408): Twig\Environment->render('utilities/_inde...', Array)
  #47 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/View.php(461): craft\web\View->renderTemplate('utilities/_inde...', Array)
  #48 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/Controller.php(201): craft\web\View->renderPageTemplate('utilities/_inde...', Array, 'cp')
  #49 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/controllers/UtilitiesController.php(89): craft\web\Controller->renderTemplate('utilities/_inde...', Array)
  #50 [internal function]: craft\controllers\UtilitiesController->actionShowUtility('system-report')
  #51 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
  #52 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
  #53 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('show-utility', Array)
  #54 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('utilities/show-...', Array)
  #55 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('utilities/show-...', Array)
  #56 /Users/name/sites/health-trust/craft/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application->handleRequest(Object(craft\web\Request))
  #57 /Users/name/sites/health-trust/craft/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
  #58 /Users/name/sites/health-trust/craft/public_html/index.php(26): yii\base\Application->run()
  #59 /Users/name/.composer/vendor/laravel/valet/server.php(235): require('/Users/alanspar...')
  #60 {main}
  
  ```
  
  **Tags:** control-panel, debugging
  
  > **Comments:**
  > **username_1**: I'm seeing a similar error - let me know if you find out the cause  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2022-03-31. Score: 1 | Accepted answer
  
  The only place that message appears in the Craft CMS codebase is [here](https://github.com/craftcms/cms/blob/f65480f0af7097bd851846c016e3bcd2b4d0c93b/src/fieldlayoutelements/CustomField.php#L106).
  
  So, the most likely cause is that something (Craft itself or a plugin/custom module) is calling the `setFieldUid()` method on a `CustomField` instance (i.e. a custom field in a field layout), passing the UID for a field that doesn't actually exist in your database. I've never seen that happen, and it's difficult to say what the root cause could be.
  
  Things to try:
  
  * Clear your data caches and compiled templates
  * Make sure project config is in sync
  * Search for the "Invalid field UID" message in your log files (`storage/logs`) to hopefully determine the root cause
  * Turn on `devMode` to hopefully make Craft throw up a stack trace
  * Search for the `22faa4bf-2fb5-415b-b4e9-2416fe728843` UID in the `fields` database column. Is there a field with that UID or not?
  
  > **Comments:**
  > **username_0**: Thx username_2. Ive updated the post with the stack trace, and synced project config, cleared caches, searched db. Its kinda of circular to search for the uid that doesn't exist. I might step thru plugins and turn off/uninstall. Any more ideas welcome.  
  > **username_2**: @username_0 Try deleting the folder `storage/runtime/compiled_classes`  
  > **username_0**: It turned out to be a field layout - very hard to find and only solved by editing UI/ db change rather than project files changes  
  
  ---
  
  ### Answer by username_3 on 2022-05-24. Score: 2
  
  I had the same thing it was an old Entry Instructions field that was a Craft 2 plugin. Search for the invalid UID in your /config/project folder - that is where I located mine. It will show up in a field layout project config file and the file name and info in the file will tell you which entry type/field layout it is. If you go there and resave the entry type field layout, it will update your project config files and fix the problem.
  
  > **Comments:**
  > **username_4**: This worked for me. Thanks username_3! - Brian from Flannel  
  
  ---
  
  