"Query class not found" when moving legacy site (kentico 4) to new server. Need help troubleshootin

e malueg asked on December 8, 2015 15:54

We have both kentico 4 and kentico 7 sites. We are trying to move our kentico 4 sites to a new server. We have the code deployed on the new server, but we receive an exception when trying to get site info (exception stack trace below).

What can i do to track down what is missing or mis-configured? The code works on my development machine, which is hitting the same database as the server throwing the error. I've tried debugging as far into the code as possible, and logged all details i can of the exception, but i can't determine what is missing or misconfigured on the new server.

At it's simplest, i'm just calling: SiteInfoProvider.GetSiteInfo("enzy");

and it will throw the exception, so something on the new server must be missing. But I need help trying to figure out what.

System.Exception: [Query.QueryClassName]: Query class not found. at CMS.SettingsProvider.Query.get_QueryClassName() at CMS.SettingsProvider.QueryProvider.LoadGenerationReader(Int32 generation, IDataConnection conn) at CMS.SettingsProvider.ProviderDictionaryCollection.LoadGeneration(Int32 generation, IDataConnection conn) at CMS.SettingsProvider.ProviderDictionaryCollection.LoadDefaultItems(IDataConnection conn) at CMS.SettingsProvider.QueryProvider.GetQuery(String queryName, IDataConnection conn, Boolean throwException) at CMS.SettingsProvider.SqlHelperClass.ExecuteQuery(String queryName, Object[,] parameters, String columns, String where, String orderBy, Int32 topN, IDataConnection conn) at CMS.SettingsProvider.AbstractProvider.GetModifiedFrom(DateTime from, String columns, String where, String orderBy, Int32 topN, Boolean binaryData, IDataConnection conn) at CMS.SettingsProvider.AbstractProvider.GetData(String columns, String where, String orderBy, Int32 topN, IDataConnection conn) at CMS.SiteProvider.SiteInfoProvider.GetSitesInternal(String where, String orderBy, GeneralConnection conn) at CMS.SiteProvider.SiteInfoProvider.LoadSites() at CMS.SiteProvider.SiteInfoProvider.GetSiteInfoInternal(String siteName, GeneralConnection conn) at CMS.SiteProvider.SiteInfoProvider.GetSiteInfo(String siteName)

Recent Answers

Brenden Kehren answered on December 8, 2015 16:02

I'd check you're DLL's to make sure you have the correct versions updated. Also make sure your web.config has the correct references in it as well for assemblies and such. I'm guessing since you were on v4, you've probably moved to a newer server running the .net framework v4 instead of v2. It's also likely it's something totally different as well but I'd start with those items.

0 votesVote for this answer Mark as a Correct answer

e malueg answered on December 8, 2015 21:40

I've compared the DLLs between the working server and non working server -- they match. I've even explicitly copied everything from the working server \bin to the other server. No luck. I've compared the web.config files on both servers as well, no meaningful differences.

Unfortunately, this isn't about upgrading the sites, just moving them. They are still on .net 2.0 application pools on the new server. For now, we simply need to get them off of old physical servers to our new servers, and we'll tackle recreating them in a newer version of Kentico later.

Are there some supporting/framework dlls that need to be installed or registered on the server (outside of a specific website’s bin) for the settings provider stuff to work?

Are there settings I can turn on to get more detail as to what the parameters are being used down inside the call stack, or what value is missing from where?

0 votesVote for this answer Mark as a Correct answer

e malueg answered on December 9, 2015 20:24

A little more information. I’ve decompiled the code and can look through the code (not debug it). I can see the line it fails, but can’t tell with what data.

It looks to be when it loads the full list of queries from the cms_query & cms_class tables.

Is there anything related to the queries that would be specific to an instance of a site (ie, stored in IIS, or file system) as opposed to in the database?

There are thousands of queries returned by the this stored procedure call:

            exec Proc_CMS_QueryProvider_SelectGeneration @QueryLoadGeneration=0

And it is looping through that list of results and building a collection of query objects that we seem to blow up trying to grab the class name.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.