Invalid object name 'MetaClass'.

Vote:
 

Hi,

I get an error after uploading my website to DXC.
If I run it locally (but connect to the same database) It works fine.

Error message (both CMS and Commerce have the same exception)

Server Error in '/' Application.
Invalid object name 'MetaClass'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'MetaClass'.

Source Error: 


[No relevant source lines]

Source File: d:\local\Temporary ASP.NET Files\root\d0e2cce6\afd7f897\App_global.asax.0.cs    Line: 0 

Stack Trace: 


[SqlException (0x80131904): Invalid object name 'MetaClass'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +274
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +720
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4284
   System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +108
   System.Data.SqlClient.SqlDataReader.get_MetaData() +103
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) +601
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +3152
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +717
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +117
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +1250
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +193
   System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +403
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +150
   Mediachase.Data.Provider.<>c__DisplayClass16_2.b__0() +122
   EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute(Func`1 method) +665
   Mediachase.Data.Provider.SqlDataProvider.LoadTable(DataCommand command) +511
   Mediachase.MetaDataPlus.Common.DBHelper.ExecuteDataTable(String connectionString, CommandType commandType, String commandText, Int32 commandTimeout, DataParameter[] commandParameters) +197
   Mediachase.MetaDataPlus.Configurator.StoredProcedure.ExecuteDataTable(MetaDataContext context) +54
   Mediachase.MetaDataPlus.Configurator.MetaClass.LoadFromDb(MetaDataContext context, Func`2 dbLoader) +41
   EPiServer.Framework.Cache.ObjectInstanceCacheExtensions.ReadThroughWithWait(IObjectInstanceCache cache, String cacheKey, Func`1 readValue, Func`2 evictionPolicy) +1019
   Mediachase.MetaDataPlus.Configurator.MetaClass.ReadThroughCache(String cacheKey, MetaDataContext context, Func`2 dbLoader, Func`2 additionalCacheKeyCreator) +245
   Mediachase.MetaDataPlus.Configurator.MetaInstaller.LoadMetaClassVersion10(MetaDataContext context, XmlNode xmlMetaClass, MetaClass parent) +139
   Mediachase.MetaDataPlus.Configurator.MetaInstaller.RestoreFromVersion10(MetaDataContext context, XmlNode root) +566
   Mediachase.MetaDataPlus.Configurator.MetaInstaller.Restore(MetaDataContext context, XmlNode root) +175
   Mediachase.Commerce.Catalog.CatalogConfiguration.ConfigureMetaData() +118
   EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +55
   EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context) +131
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +248

[InitializationException: Initialize action failed for Initialize on class Mediachase.Commerce.Initialization.CatalogInitialization, Mediachase.Commerce, Version=11.6.1.0, Culture=neutral, PublicKeyToken=6e58b501b34abce3]
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +774
   EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +203
   EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +876
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +167
   EPiServer.Global..ctor() +83
   PartenaCMS.EPiServerApplication..ctor() +37
   ASP.global_asax..ctor() in d:\local\Temporary ASP.NET Files\root\d0e2cce6\afd7f897\App_global.asax.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +197
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +114
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1514
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +300
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +27
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +80
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +225
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +318

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +444
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +113
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +604

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2558.0


Any thoughts?

Thanks in advance!

Brecht Vanneste

#186879
Jan 08, 2018 11:43
Vote:
 

Hi,

Which versions are you using?

And did you make sure the connection strings are correct? it seems to me that the EcfSqlConnection is pointing to a database which has no "MetaClass" table. 

#186882
Jan 08, 2018 12:01
Vote:
 

Oh sorry I forgot:

CMS:

EPiServer.CMS.Core 11.3.1
EpiServer.Azure 9.4.1
EPiServer.Commerce.Core 11.6.1
EPiServer.Commerce.Azure 11.6.1

Commerce
EPiServer.CommerceManager 11.6.1
EPiServer.CommerceManager.Azure 11.6.1

I'm using the same connection string as I do local.
In the commerce db there is a table "MetaClass"

Thank you for the fast response.

#186889
Jan 08, 2018 12:51
Vote:
 

Hmm - strange. Does that MetaClass table belong to "dbo" schema? 

#186890
Jan 08, 2018 12:54
Vote:
 

Yes it does.

Strange indeed :)

#186894
Jan 08, 2018 13:20
Vote:
 

Can you catch the sql call with sql profiler?

Could it be a security issue?

Does the database allow traffic from all ip-adresses?

#186918
Jan 08, 2018 17:06
Vote:
 

I cleared the folder trough ftp, after that everything worked as normal.

Thank you for your time!

#187376
Jan 22, 2018 9:51
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.