Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Missing dbo.GetExistingScopesForDefinition in epi-site on Azure

Vote:
 

I´m using Azure website to publish an EPiServer site, but after a while working with the site from localhost I get the error: "Invalid object name 'dbo.GetExistingScopesForDefinition'.". Do I have to change anything in the database in order to make it work in Azure SQL? I´ve used SQL Database Migration Wizard (https://sqlazuremw.codeplex.com/) to migrate my local SQL database to Azure version. 

Stacktrace:

EPiServer.DataAccess.PropertyDefinitionDB.Delete(PropertyDefinition propertyDefinition) +54
   EPiServer.DataAbstraction.DefaultPropertyDefinitionRepository.Delete(PropertyDefinition propertyDefinition) +47
   EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelRegister.CommitProperties(Boolean deleteUnusedTypes) +99
   EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.Sync(Boolean commitChanges) +302
   EPiServer.Initialization.ModelSyncInitialization.Initialize(InitializationEngine context) +387
   EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key) +64
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +719
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +168
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +285
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +104
   EPiServer.Global..ctor() +110
   OneVinn.Web.EPiServerApplication..ctor() +40
#112312
Oct 27, 2014 17:12
Vote:
 

Which version are you using?

Did you update EPi packages with nuget at some point?

#132825
Aug 19, 2015 9:06
Vote:
 

I'm seeing this error now too.

Server Error in '/' Application.

Invalid object name 'dbo.GetExistingScopesForDefinition'.

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 'dbo.GetExistingScopesForDefinition'.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.


Stack Trace:

[SqlException (0x80131904): Invalid object name 'dbo.GetExistingScopesForDefinition'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2434922
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5736592
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +225
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2026
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +375
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +337
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +280
   EPiServer.DataAccess.<>c__DisplayClass43_0.<ExecPageDefinitionTransactedProc>b__0() +119
   EPiServer.Data.Providers.<>c__DisplayClass29_0.<ExecuteTransaction>b__0() +10
   EPiServer.Data.Providers.<>c__DisplayClass30_0`1.<ExecuteTransaction>b__0() +138
   EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute(Func`1 method) +706
   EPiServer.Data.Providers.SqlDatabaseHandler.ExecuteTransaction(Func`1 action) +124
   EPiServer.Data.Providers.SqlDatabaseHandler.ExecuteTransaction(Action action) +90
   EPiServer.DataAccess.PropertyDefinitionDB.ExecPageDefinitionTransactedProc(String proc, Int32 propertyDefinitionID) +82
   EPiServer.DataAccess.PropertyDefinitionDB.DeleteFromDb(Int32 id) +20
   EPiServer.DataAccess.PropertyDefinitionDB.Delete(PropertyDefinition propertyDefinition) +33
   EPiServer.DataAbstraction.DefaultPropertyDefinitionRepository.Delete(PropertyDefinition propertyDefinition) +37
   EPiServer.DataAbstraction.RuntimeModel.PropertyDefinitionSynchronizer.Delete(PropertyDefinition propertyDefinition) +11
   EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelRegister.CommitProperties(Boolean deleteUnusedTypes) +89
   EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.Sync(Boolean commitChanges) +253
   EPiServer.Initialization.ModelSyncInitialization.Initialize(InitializationEngine context) +375
   EPiServer.Framework.Initialization.<>c__DisplayClass3_0.<Initialize>b__0() +19
   EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key) +52
   EPiServer.Framework.Initialization.ModuleNode.Initialize(InitializationEngine context) +80
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +173

[InitializationException: Initialize action failed for Initialize on class EPiServer.Initialization.ModelSyncInitialization, EPiServer, Version=9.7.2.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +471
   EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +114
   EPiServer.Framework.Initialization.InitializationEngine.Initialize() +32
   EPiServer.Framework.Initialization.<>c.<FrameworkInitialization>b__7_0(InitializationEngine e) +9
   EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +366
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +170
   EPiServer.Global..ctor() +76
   ASP.global_asax..ctor() +5

[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) +113
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +206
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1065
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +124
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +20
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +276
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

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


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

#147689
Apr 21, 2016 13:23
Vote:
 

I found the cause of the error. I had deleted two properties from code and then tried to publish a new version of my site.

To get by the error I set episerver - applicationSettings - enableModelSyncCommit to false. Then I got back into the UI... When trying to click "Synchronize" on the content type or when trying to delete the properties by hand I got "Invalid object name 'dbo.GetExistingScopesForDefinition'" in the yellow error msg box at the top of the page.

For now I just put the properties back in the code and hid them. Now the site starts up again even when adding back enableModelSyncCommit to true.

#147691
Apr 21, 2016 13:50
Vote:
 

Hi,
We just had the exact same problem. The dbo.GetExistingScopesForDefinition function was not copied due to collation differences. Scary part is that we did not see any errors. We tried to create it manually but got the following error:

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Danish_Norwegian_CI_AS" in the like operation.

Creating a new Azure DB with collaction Danish_Norwegian_CI_AS fixed the issue.

#160714
Oct 04, 2016 12:48
Vote:
 

Thx for sharing! That's a scary bug!

#160719
Oct 04, 2016 14:07
* 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.