Unusual export error

Ozgur Ozguven asked on June 26, 2015 16:21

I started getting a strange error when I attempt to export sites from Kentico. Error is:

Message:

SELECT * FROM View__Joined WHERE NodeSiteID = 5 ORDER BY NodeLevel ASC, NodeID

Caused exception:

Invalid object name 'View__Joined'.

It is as if something that is meant to be in the middle, like View_XXX_Joined, but not getting injected!

Has anyone seen this before? If so, how can I solve the issue?

I restored the DB to a backup from a couple of days ago. The problem went away, so, I was able to export sites again but after a sucessful export - import on the same instance, it started happening again. Very odd!

Correct Answer

Ozgur Ozguven answered on July 1, 2015 11:49

In case it happens to someone else, this issue turned out to be caused by a custom page type with a corresponding row in CSM_Class table whose ClassTableName was blank. This page type was created for test purposes and lurked around in the DB. As a result, the export process was not able to determine 'ClassTableName' and it was trying to issue a query like 'SELECT * FROM View__Joined WHERE ...'.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Roman Koníček answered on June 28, 2015 21:53

Hi Ozgur,

I have never seen anything like this where it removed the text out of the middle. I have reviewed all ticket history and it doesn't appear to have come up in the past either. Could you please tell me what version and hotfix do you have?

Also could you please go to Modules application -> E-commerce -> Classes -> SKU -> Fields section and add a new custom field? That should generate the views again from scratch. By the way did you make any customizations which could be related to the issue?

Best regards, Roman Konicek

0 votesVote for this answer Mark as a Correct answer

Ozgur Ozguven answered on June 29, 2015 12:26

We are on v8.1.17 and, yes, we have various custom tables. And we have DB views for these custom tables such as View_CustomTableName_Joined. The problem only occuring after an import (from an export of an existing site). When the problem start occuring, it happens for the export of any site not just one.

0 votesVote for this answer Mark as a Correct answer

Ozgur Ozguven answered on June 29, 2015 18:18

By the way, this weird export problem is only happening if I choose to export Pages. Below is the full trace from the Event Viewer:

Message:

SELECT * FROM View__Joined WHERE NodeSiteID = 3 ORDER BY NodeLevel ASC, NodeID

Caused exception: Invalid object name 'View__Joined'.

Exception type: System.Exception Stack Trace: at CMS.DataEngine.AbstractDataConnection.HandleError(String queryText, Exception ex) at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction) at CMS.DataEngine.GeneralConnection.RunQuery(QueryParameters query) at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query) at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query, Int32& totalRecords) at CMS.DataEngine.DataQueryBase1.GetDataFromDB() at CMS.DataEngine.DataQueryBase1.GetData() at CMS.DataEngine.DataQueryBase1.get_Result() at CMS.DocumentEngine.TreeProvider.ExecuteQuery(String queryName, QueryDataParameters parameters, String where, String orderBy, Int32 topN, String columns, Int32 offset, Int32 maxRecords, Int32& totalRecords) at CMS.DocumentEngine.TreeProvider.GetDocumentTypeData(String className, String where, String orderBy, Int32 topN, String columns, Int32& tables) at CMS.DocumentEngine.TreeProvider.SelectNodes(NodeSelectionParameters parameters) at CMS.DocumentEngine.DocumentExport.GetDocuments(SiteExportSettings settings) at CMS.DocumentEngine.DocumentExport.GetExportData_Before(Object sender, ExportGetDataEventArgs e) at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler1 h, TArgs e) at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List1 list, TArgs e, Boolean important) at CMS.Base.AdvancedHandler2.RaiseBefore(TArgs e) at CMS.Base.AdvancedHandler2.RaiseBefore(TArgs e) at CMS.Base.AdvancedHandler2.StartEvent(TArgs e, Boolean allowEvent) at CMS.CMSImportExport.ExportProvider.GetExportData(SiteExportSettings settings, QueryDataParameters parameters, String where, String objectType, Boolean childData, Boolean selectionOnly, TranslationHelper th) at CMS.CMSImportExport.ExportProvider.ExportObjects(SiteExportSettings settings, String objectType, Boolean siteObjects, Boolean childData, Boolean selectionOnly, TranslationHelper th, GeneralizedInfo infoObj, ProcessObjectEnum processType) at CMS.CMSImportExport.ExportProvider.GetExportData(SiteExportSettings settings, String objectType, Boolean siteObjects, Boolean childData, Boolean selectionOnly, TranslationHelper th) at CMS.DocumentEngine.DocumentExport.ExportDocumentsData(SiteExportSettings settings, TranslationHelper th) at CMS.DocumentEngine.DocumentExport.ExportObjects_Before(Object sender, ExportEventArgs e) at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler1 h, TArgs e) at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List1 list, TArgs e, Boolean important) at CMS.Base.AdvancedHandler2.RaiseBefore(TArgs e) at CMS.Base.AdvancedHandler2.RaiseBefore(TArgs e) at CMS.Base.AdvancedHandler`2.StartEvent(TArgs e, Boolean allowEvent) at CMS.CMSImportExport.ExportProvider.ExportObjectType(SiteExportSettings settings, TranslationHelper th, String objectType, Boolean siteObjects) at CMS.CMSImportExport.ExportProvider.ExportObjectsData(SiteExportSettings settings) at CMS.CMSImportExport.ExportManager.Export(Object parameter)

Message: Invalid object name 'View__Joined'.

Exception type: System.Data.SqlClient.SqlException Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)

0 votesVote for this answer Mark as a Correct answer

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