LocalDB ErrorSetting up V2 Migration Scripts

shanejokeeffeshanejokeeffe Posts: 19 New member
edited May 27, 2014 6:07AM in Deployment Manager
I've configured SQL Source Control to use V2 migrations and I've installed LocalDB on our build/deployment server.

When I run a deployment after adding a migration script, I'm getting the following error message:

2014-05-19 09:19:14 +01:00 ERROR Error while executing job: Dynamic deployment failed
2014-05-19 09:19:14 +01:00 ERROR System.InvalidOperationException: Dynamic deployment failed ---> System.InvalidOperationException: The SQL LocalDB instance 'RedGateTemp' does not exist.
2014-05-19 09:19:14 +01:00 ERROR at System.Data.SqlLocalDb.SqlLocalDbInstance..ctor(String instanceName, ISqlLocalDbApi localDB)
2014-05-19 09:19:14 +01:00 ERROR at System.Data.SqlLocalDb.SqlLocalDbProvider.GetInstance(String instanceName)
2014-05-19 09:19:14 +01:00 ERROR at System.Data.SqlLocalDb.SqlLocalDbProvider.System.Data.SqlLocalDb.ISqlLocalDbProvider.GetInstance(String instanceName)
2014-05-19 09:19:14 +01:00 ERROR at System.Data.SqlLocalDb.Extensions.GetOrCreateInstance(ISqlLocalDbProvider value, String instanceName)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Migrations.Core.Database.LocalDbFactory`1.CreateInstance()
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Migrations.Core.Database.LocalDbFactory`1.StartInstance()
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Migrations.Core.Database.LocalDbFactory`1.GetNewTempDb(String collation)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Migrations.Core.Database.DatabaseCopier`1.GetTempCopy(IDatabaseSchemaProvider`1 before, String collation, SQLVersion serverMajorVersion)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.SQLCompare.Engine.DatabaseCollaborators.ComparisonWithMigrations.PopulateDifferencesWithMigrations(Differences differences, ICancellable subscriber, MigrationActionPlan migrationActionPlan)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.SQLCompare.Engine.DatabaseCollaborators.ComparisonWithMigrations.PopulateDifferences(Differences differences, ICancellable subscriber)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.SQLCompare.Engine.MigrationsV2DifferencesPopulator.Populate(Differences differences, Options options, Boolean runOnTwo, ICancellable subscriber)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.SQLCompare.Engine.Differences.GetDifferencesAfterMigrations(Options options, ICancellable subscriber, Boolean runOnTwo)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.SQLCompare.Engine.SqlGenerationQueues.GenerateSql(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.SQLCompare.Engine.Work.GenerateSql(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.SQLCompare.Engine.Work.BuildFromDifferences(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.SQLCompare.Engine.Work.BuildFromDifferences(Differences differences, Options options, Boolean runOnTwo)
2014-05-19 09:19:14 +01:00 ERROR at #Vy3c.#AG3c..ctor(IDeployLog , #8gL , Database , #Ub4c , Database , Options )
2014-05-19 09:19:14 +01:00 ERROR at #Vy3c.#df5c.Apply(#1y3c )
2014-05-19 09:19:14 +01:00 ERROR at #Vy3c.#R21c.#UGfd()
2014-05-19 09:19:14 +01:00 ERROR at ##.#mj5c(IDeployLog , String , String , Action )
2014-05-19 09:19:14 +01:00 ERROR --- End of inner exception stack trace ---
2014-05-19 09:19:14 +01:00 ERROR at ##.#mj5c(IDeployLog , String , String , Action )
2014-05-19 09:19:14 +01:00 ERROR at ##.#1Gfd(#R21c )
2014-05-19 09:19:14 +01:00 ERROR at ##.#iz3c(#Ty3c , String , String , #FG3c , #8gL , IDeployLog )
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Deploy.SqlServerDbPackage.AgentPlugin.DbPackageConvention.Apply(IConventionContext context)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Deploy.Agent.Deployment.Conventions.ConventionRunner.<>c__DisplayClassf.<ApplyConventions>b__e(IConvention convention)
2014-05-19 09:19:14 +01:00 ERROR at System.Collections.Generic.List`1.ForEach(Action`1 action)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Deploy.Agent.Deployment.Conventions.ConventionRunner.ApplyConventions(IConventionContext context)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Deploy.Agent.Deployment.DeploymentController.Execute(PackageMetadata package, IVariableDictionary variables, IFolderTracker folderTracker)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Deploy.Agent.Deployment.DeployPackageJobExecutor.Execute(DeployPackageJob job)
2014-05-19 09:19:14 +01:00 ERROR at CallSite.Target(Closure , CallSite , Object , Object )
2014-05-19 09:19:14 +01:00 ERROR at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Deploy.Agent.Services.Jobs.JobRunner.ExecuteJob(IJob job, String& errorMessage, ILogScope additionalLogTarget)
2014-05-19 09:19:14 +01:00 ERROR Command RedGate.Deploy.Agent.Commands.SingleShotDeploymentCommand failed
2014-05-19 09:19:14 +01:00 ERROR RedGate.Deploy.Shared.Startup.CommandException: Dynamic deployment failed
2014-05-19 09:19:14 +01:00 ERROR
2014-05-19 09:19:14 +01:00 ERROR Server stack trace:
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Deploy.Agent.Commands.SingleShotDeploymentCommand.ExecuteInner()
2014-05-19 09:19:14 +01:00 ERROR at System.Threading.Tasks.Task.InnerInvoke()
2014-05-19 09:19:14 +01:00 ERROR at System.Threading.Tasks.Task.Execute()
2014-05-19 09:19:14 +01:00 ERROR
2014-05-19 09:19:14 +01:00 ERROR Exception rethrown at [0]:
2014-05-19 09:19:14 +01:00 ERROR at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
2014-05-19 09:19:14 +01:00 ERROR at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
2014-05-19 09:19:14 +01:00 ERROR at RedGate.Deploy.Shared.Startup.CommandProcessor.<ProcessAsync>d__4.MoveNext()

Do I need to perform further configuration of LocalDB first?

Regards,

Shane.

Comments

  • Hi Shane,
    Sorry it's taken so long to reply.

    We have seen this error happening generally when for some reason or another RedGateTemp instance on LocalDB has got corrupted. You could try to delete RedGateTemp instance if it exists and then try again. To access/ view this instance, youwould have to run PSExec tool as LocalSystem as described in this post on Stackoverflow: http://stackoverflow.com/questions/2069 ... -by-system.

    Hope this helps,
    Sean
Sign In or Register to comment.