Search code examples
kentico

Kentico 12: System Wide Macro Failures


Quick qualification: I have been developing on the Kentico platform since V7, spanning more than a decade. I have used every license from EMS to Free Edition, and consider myself a Kentico expert. I regularly build custom Web Parts, Form Controls, Modules, Scheduled Tasks, Integrations and more with a great deal of success.

About a week ago, I started encountering catastrophic macro failures on one of my sites, and as I go on to explain in more detail, keep in mind that I have already Resigned the Macros many times in an effort to resolve this issue. My Event log is FULL of macro errors:

Event Log RESOLVEDATAMACRO Error Unigrid Error

When this first occurred over a week ago, I tried all of the obvious things (resigning macros, restarting application pools etc.). After many hours of failed attempts, I eventually created a whole new site from a fresh deployment, created a new database and rebuilt the site from scratch, and everything seemed to be working fine. For a day or two. Then again, the same problem occurred. This time I created a fresh deployment from scratch and connected it to the second database (the first one I recreated), and it worked again. For a while. Until it didn't. Now I'm here again, facing the same issues, and I don't understand what keeps causing the issue.

There simply must be something about my code base or my environment that is causing this issue, but I don't know enough about the Kentico code under the hood to pinpoint where to look. Anyone with a similar experience, or a Kentico expert who could offer some assistance would be appreciated beyond belief.

NOTE: I do not extend or customize any code in the CMSApp project. The only changes I make inside that folder is web.config app settings, connection strings etc. My project is branched from a fresh install of K12, and all of my custom code and components goes into separate projects.

EDIT: This problem occurs while debugging from Visual Studio (2019 Enterprise on Windows 10 Pro) as well as when deployed on the production server (Windows Server 2016 on Azure VM).


Solution

  • So the answer was a glitch in a Custom Macro Namespace that I was registering from my Custom Module. Apparently something in that registration process brought down the entire Macro Engine. I don't actually know specifically what the glitch is, as for the sake of expedience I've scrapped the custom macros entirely. I may reintroduce them later with caution, now that I know the impact that they can have on the Kentico application as a whole, but for now I need to get this project launched.

    I can't be certain why it started acting up after all these months, as the macros within the namespace were not in use anywhere, but at least I (we) have the answer. I'm surprised that there was no log entry to indicate the issue was related to a custom macro registration, and the lack thereof certainly cost me many hours of diagnostics, but I'm thankful to share that the issue is indeed behind me, at long last.