Options

SQL Source Control Object reference not set to an instance of an object

I am unable to pull or push changes due to the following error.  It appears that my Source Control is crashing on a foreign key or constraint somewhere.  Is there a way to find which key the comparison is crashing on?

|Error|RedGate.SQLSourceControl.CommonUI.Controls.CancellableControl`2[[RedGate.SQLSourceControl.Engine.Diff.IChangeSetWithWorkspace, RedGate.SQLSourceControl.Engine, Version=7.6.0.17104, Culture=neutral, PublicKeyToken=7f465a1c156d4d57],[RedGate.SQLSourceControl.CommonUI.Controls.DifferencesViewerControl, RedGate.SQLSourceControl.CommonUI, Version=7.6.0.17104, Culture=neutral, PublicKeyToken=7f465a1c156d4d57]]|91| An exception occurred whilst performing an operation
System.NullReferenceException: Object reference not set to an instance of an object.
   at RedGate.SQLCompare.Engine.Fields.Add(IField value)
   at RedGate.SQLCompare.Engine.Registration.ModelFactory.Populators.ConstraintPopulator.PopulateForeignKeys(Database database, IDmvModel dmvModel, Boolean caseSensitive, ProgressTracker progressTracker)
   at RedGate.SQLCompare.Engine.Registration.ModelFactory.DatabasePopulator.Populate(DBPopulationOptions popOptions)
   at RedGate.SQLCompare.Engine.Registration.ModelFactory.DatabasePopulator.RegisterFromFactory(Database database, Options options, Boolean includeViewColumnDetails, DatabasePopulator databasePopulator, String databaseName)
   at RedGate.SQLCompare.Engine.Registration.ModelFactory.DatabaseFromLivePopulator.RegisterFromLive(Database database, LiveConnectionInstructions connectionDetails, Options options, IDmvModelFactory dmvModelFactory, Boolean includeViewColumnDetails)
   at RedGate.SQLCompare.Engine.Database.<>c__DisplayClass120_0.<Register>b__0()
   at RedGate.SQLCompare.Engine.Utils.GetTimeToRun(Action action)
   at RedGate.SQLCompare.Engine.Database.Register(LiveConnectionInstructions connectionDetails, Nullable`1 optionsParam, IDmvModelFactory factory)
   at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareDatabase.RegisterLive(IDatabaseConnection databaseConnection, ICompareOptions options)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.CompareDatabaseRegistrar.<>c__DisplayClass6_0.<Register>b__0()
   at RedGate.SQLSourceControl.Engine.Utils.Task.SharedUtilsUtils.DoActionWithCancel(ICancellableOperationStatus status, ICancellable cancellable, Action action)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.CompareDatabaseRegistrar.Register(LiveDatabaseSource source, ICancellableOperationStatus status)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.SocDatabaseRegistrar.<>c__DisplayClass4_0.<Register>b__0()
   at RedGate.SQLSourceControl.Engine.DatabasePolling.DatabasePolling.DatabasePollingManager.RunWithoutBackgroundPolling[T](Func`1 func)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.SocDatabaseRegistrar.Register(LiveDatabaseSource databaseSource, ICancellableOperationStatus status)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.TwoWorkspaceRegistrar.<>c__DisplayClass14_0.<GetRegisterWorkspacesActions>b__1(ICancellableOperationStatus s)
   at RedGate.SQLSourceControl.Engine.Utils.Task.NamedOperation.Operation(ICancellableOperationStatus cancellableOperation)
   at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableUtils.<>c__DisplayClass3_0.<StartTask>b__0()
   at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableUtils.ExceptionHandler.ThrowIfErrored()
   at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableUtils.DoInParallel(ICancellableOperationStatus status, INamedOperation[] namedActions)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.TwoWorkspaceRegistrar.RegisterWorkspaces(IWorkspaces workspaces, ICompareScriptDatabaseInformation scriptDatabaseInformation)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.ThreeWayDiffSession.RegisterWorkspaces(IWorkspaces workspaces, SourceControlRevision transientRevision)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.ThreeWayDiffSession.BuildCommon()
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.DiffBuilder.GetChangeSetResolvingNoOps[T](String source, IBoundDatabase boundDatabase, IChangeSetFactory`1 changeSetFactory, ICancellableOperationStatus status, SourceControlOperation sourceControlOperation)
   at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.DiffBuilder.BuildToRetrieveChangeSet(IBoundDatabase boundDatabase, ICancellableOperationStatus status)
   at RedGate.SQLSourceControl.Engine.Diff.BoundDatabase.GetNewRetrievableChanges(ICancellableOperationStatus status)
   at RedGate.SQLSourceControl.Engine.Utils.Task.MutexedCancellableOperation`1.<>c__DisplayClass7_0.<Invoke>b__0()
   at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableOperationBase.PerformAction(Action action)
   at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableOperationBase.InvokeWithTracker(Action action)
   at RedGate.SQLSourceControl.Engine.Utils.Task.MutexedCancellableOperation`1.Invoke()
   at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableOperationTypeConverter`2.Invoke()
   at RedGate.SQLSourceControl.Engine.Utils.Task.AggregateCancellableOperation`2.<>c.<Invoke>b__8_0(ICancellableOperation`1 operation)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
   at RedGate.SQLSourceControl.Engine.Utils.Task.AggregateCancellableOperation`2.Invoke()
   at RedGate.SQLSourceControl.CommonUI.Controls.CancellableControl`2.<>c__DisplayClass30_0.<InvokeOperation>b__1()
   at RedGate.SQLSourceControl.Engine.Utils.ErrorReporting.ErrorReporterBase.Do(Action toDo, Predicate`1 isFatalPredicate, Boolean rethrow)
   at RedGate.SQLSourceControl.CommonUI.ErrorHandling.SaErrorReporter.DoWithObviousExceptionsRethrowAll(Action action)
   at RedGate.SQLSourceControl.CommonUI.Controls.CancellableControl`2.InvokeOperation(ICancellableOperation`1 operation, Object token)
Sign In or Register to comment.