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

When trying to do an initial commit to source control I get the following errors:

(Repeats several time)
10:51:44.427|ERROR |neImpl.CompareLogger|60 |Parse error for: -- No text is available
10:51:44.427|ERROR |neImpl.CompareLogger|60 |line 1:24: unexpected token: ["",<1>,line=1,col=24] [char=23]

(Once as the final error)
10:51:49.607|ERROR |ling.SaErrorReporter|9 |Reporting error originally thrown
at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
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)
at RedGate.SQLSourceControl.CommonUI.Controls.CancellableControl`2.<>c__DisplayClass28_1.<StartOperation>b__1()
at RedGate.SQLSourceControl.Engine.Utils.ErrorReporting.ErrorReporterBase.Do(Action toDo, Predicate`1 isFatalPredicate, Boolean rethrow)
at RedGate.SQLSourceControl.Engine.Utils.ErrorReporting.ErrorReporterBase.Do(Action toDo)
at RedGate.SQLSourceControl.CommonUI.ErrorHandling.BackgroundErrorReporter.RedGate.SQLSourceControl.Engine.Utils.ErrorReporting.IBackgroundErrorReporter.Do(Action action)
at RedGate.SQLSourceControl.Ssms.Common.SsmsBackgroundErrorReporter`1.Do(Action action)
at RedGate.SQLSourceControl.Engine.Utils.Task.ThreadPool.<>c__DisplayClass3_0.<WrapActionWithErrorHandling>b__0()
at RedGate.SQLSourceControl.Engine.Utils.Task.ThreadPool.<>c__DisplayClass2_0.<QueueUserWorkItem>b__0(Object state)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
System.NullReferenceException: Object reference not set to an instance of an object.
at RedGate.SQLCompare.Engine.Utils.EncloseInSquareBrackets(String id)
at RedGate.SQLCompare.Engine.DeploymentScriptSqlGenerator.SqlFor(AlterAuthorizationStatement statement)
at RedGate.SQLCompare.Engine.Deployment.SqlScriptStatements.AlterAuthorizationStatement.Accept(ISqlGenerator visitor)
at RedGate.SQLCompare.Engine.ExecutionBlockBatchBuilder.RedGate.SQLCompare.Engine.Deployment.SyncToScript.IBatchBuilder.AddStatement(IDeploymentScriptStatement statement, DeploymentScriptSqlGenerator sqlGenerator)
at RedGate.SQLCompare.Engine.Deployment.Sections.SectionBuilder.AddBatchProtected(IDeploymentScriptStatement statement)
at RedGate.SQLCompare.Engine.Deployment.Sections.SectionBuilder.AddFilteredBatches(IEnumerable`1 deploymentScriptStatements)
at RedGate.SQLCompare.Engine.Deployment.Sections.SectionBuilder.AddBatch(IDeploymentScriptStatement statement)
at RedGate.SQLCompare.Engine.Deployment.Sections.SqlSectionBuilderExtensions.AddBatches(ISqlSectionBuilder sectionBuilder, IEnumerable`1 objectStatementPairs)
at RedGate.SQLCompare.Engine.DeploymentScriptFromSectionsBuilder.GenerateSql(SqlSections sqlSectionsWithoutHeader)
at RedGate.SQLCompare.Engine.SqlGenerationQueues.GenerateSql()
at RedGate.SQLCompare.Engine.Work.GenerateSql(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareWork.GenerateWarnings(ICompareOptions options, ICompareDifferences differences)
at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareDifferences.<>c__DisplayClass6_0.<GenerateWarnings>b__0(ICompareDifferences differences)
at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareDifferences.WithSelectednessMaintained[T](Func`2 func)
at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareDifferences.GenerateWarnings(ICompareOptions options)
at RedGate.SQLSourceControl.Engine.Diff.DiffBuilding.ToCommitAndRetrieveChangeSetCreator.GetSchemaDiffs(SourceControlOperation operation)
at RedGate.SQLSourceControl.Engine.Diff.DiffBuilding.ToCommitAndRetrieveChangeSetCreator.GetDiffs(SourceControlOperation operation, Boolean& isCompareConfigNoOp)
at RedGate.SQLSourceControl.Engine.Diff.DiffBuilding.ToCommitChangeSetFactory.Create(IThreeWayDiffSession session, ILinkedDatabaseDetailsGetter linkedDatabaseDetailsGetter, ITransientWorkspace transientWorkspace, IToCommitAndRetrieveChangeSetCreator changeSetCreator)
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.BuildToCommitChangeSet(IBoundDatabase boundDatabase, ICancellableOperationStatus status)
at RedGate.SQLSourceControl.Engine.Diff.BoundDatabase.GetNewCommitableChanges(ICancellableOperationStatus status)
at RedGate.SQLSourceControl.Engine.Diff.BoundDatabase.<>c__DisplayClass24_0.<GetCancellableCommitableChanges>b__0(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.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)

Comments

  • There is one more error which arrives after the "Send Error Report" window is closed:

    10:56:08.403|ERROR |n=7f465a1c156d4d57]]|9 |An exception occurred whilst performing an operation
    System.NullReferenceException: Object reference not set to an instance of an object.
    at RedGate.SQLCompare.Engine.Utils.EncloseInSquareBrackets(String id)
    at RedGate.SQLCompare.Engine.DeploymentScriptSqlGenerator.SqlFor(AlterAuthorizationStatement statement)
    at RedGate.SQLCompare.Engine.Deployment.SqlScriptStatements.AlterAuthorizationStatement.Accept(ISqlGenerator visitor)
    at RedGate.SQLCompare.Engine.ExecutionBlockBatchBuilder.RedGate.SQLCompare.Engine.Deployment.SyncToScript.IBatchBuilder.AddStatement(IDeploymentScriptStatement statement, DeploymentScriptSqlGenerator sqlGenerator)
    at RedGate.SQLCompare.Engine.Deployment.Sections.SectionBuilder.AddBatchProtected(IDeploymentScriptStatement statement)
    at RedGate.SQLCompare.Engine.Deployment.Sections.SectionBuilder.AddFilteredBatches(IEnumerable`1 deploymentScriptStatements)
    at RedGate.SQLCompare.Engine.Deployment.Sections.SectionBuilder.AddBatch(IDeploymentScriptStatement statement)
    at RedGate.SQLCompare.Engine.Deployment.Sections.SqlSectionBuilderExtensions.AddBatches(ISqlSectionBuilder sectionBuilder, IEnumerable`1 objectStatementPairs)
    at RedGate.SQLCompare.Engine.DeploymentScriptFromSectionsBuilder.GenerateSql(SqlSections sqlSectionsWithoutHeader)
    at RedGate.SQLCompare.Engine.SqlGenerationQueues.GenerateSql()
    at RedGate.SQLCompare.Engine.Work.GenerateSql(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
    at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareWork.GenerateWarnings(ICompareOptions options, ICompareDifferences differences)
    at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareDifferences.<>c__DisplayClass6_0.<GenerateWarnings>b__0(ICompareDifferences differences)
    at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareDifferences.WithSelectednessMaintained[T](Func`2 func)
    at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareDifferences.GenerateWarnings(ICompareOptions options)
    at RedGate.SQLSourceControl.Engine.Diff.DiffBuilding.ToCommitAndRetrieveChangeSetCreator.GetSchemaDiffs(SourceControlOperation operation)
    at RedGate.SQLSourceControl.Engine.Diff.DiffBuilding.ToCommitAndRetrieveChangeSetCreator.GetDiffs(SourceControlOperation operation, Boolean& isCompareConfigNoOp)
    at RedGate.SQLSourceControl.Engine.Diff.DiffBuilding.ToCommitChangeSetFactory.Create(IThreeWayDiffSession session, ILinkedDatabaseDetailsGetter linkedDatabaseDetailsGetter, ITransientWorkspace transientWorkspace, IToCommitAndRetrieveChangeSetCreator changeSetCreator)
    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.BuildToCommitChangeSet(IBoundDatabase boundDatabase, ICancellableOperationStatus status)
    at RedGate.SQLSourceControl.Engine.Diff.BoundDatabase.GetNewCommitableChanges(ICancellableOperationStatus status)
    at RedGate.SQLSourceControl.Engine.Diff.BoundDatabase.<>c__DisplayClass24_0.<GetCancellableCommitableChanges>b__0(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.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)
  • Hi Jdmello, I am experiencing the same problem. I linked my database to SQL Source Control and got the error on the first attempt to commit. Did you get this issue resolved?
  • ydyachenko wrote: »
    Hi Jdmello, I am experiencing the same problem. I linked my database to SQL Source Control and got the error on the first attempt to commit. Did you get this issue resolved?

    I needed View Database permission on the database. I had that permission on the other databases and didn't realise it was missing from this one.
Sign In or Register to comment.