Object reference not set to an instance of an object errors

I managed to commit quite a few objects to SVN, but on many I am getting an Object reference not set to an instance of an object exception.

Anyone else getting this?

Some system information:

- Using SQL Server 2008 R2
- Running local database committing to local Visual SVN repository

Happens on various types of objects (Schema, Stored Procs, Roles, Users) - didn't seem to happen on Tables, and didn't happen on ALL of the objects of those types (some were successfully committed).

Comments

  • Thanks for letting us know.

    Would you be able to to try synching your database schema to a blank database (newly created) using SQL Compare 8, just so we can narrow it down? It would be great for us to identify the troublesome object.

    Kind regards,

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
  • I am not sure if it's related but I hit an error trying out SQL Source Control this morning. My steps were as follow,

    1.Created svn folder (F1)
    2.Link database DB1 to the svn folder
    3.Successfuly committed DB1 to subversion
    4.Unlinked DB1 from source control
    5.Link DB2 (same as DB1 but with modifications) to svn folder F1
    6.Go to Commit Changes tab (hoping to see differences)
    ...a lot of processing happens for a while but then the following error occured:

    RedGate.SQLSourceControl.Engine.InvalidStateException: Can't find a file path for User name SunBrowser ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 298, offset:56 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1796, offset:370 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1795, offset:13 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2202, offset:28 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 219, offset:134 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 203, offset:11 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 217, offset:109 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 239, offset:28 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 244, offset:8 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2165, offset:204 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1764, offset:99 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1763, offset:52 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1229, offset:25 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1226, offset:0 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2065, offset:0 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1928, offset:117 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 203, offset:11 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 248, offset:137 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 724, offset:26 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2314, offset:31 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1357, offset:120 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1359, offset:21 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1504, offset:13
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    at #oEc.#i3l.GetFullPath(IDatabaseObject dbObject)
    at RedGate.SQLSourceControl.Engine.ToRetrieveChangeSet.#paj(ScriptSynchronizationActions scriptActions, Differences differences)
    at RedGate.SQLSourceControl.Engine.ToRetrieveChangeSet.#oaj(ICancellableOperationStatus status, WarningsAccepter accepter, ISourceControlUserCallBacks callBacks, FilesToUpgrade& filesToUpgrade)
    at RedGate.SQLSourceControl.Engine.ToRetrieveChangeSet.#t.#TXd.#Xkz(ICancellableOperationStatus x)
    at RedGate.SQLSourceControl.Engine.Cancellables.CancellableOperation.#i5f()
    at RedGate.SQLSourceControl.Engine.Cancellables.CancellableOperationBase.InvokeWithTracker(Action action)
    at RedGate.SQLSourceControl.Engine.Cancellables.CancellableOperation.Invoke()
    at RedGate.SQLSourceControl.Engine.Cancellables.MultiStepCancellableOperation.#m1f(ICancellableOperationStatus status, IMultiStepCancellableOperation operation)
    at #eEc.#jfd.#m1f(ICancellableOperationStatus status, #jfd operation)
    at #oEc.#i7c.#t.#z2.#hOi()
    at #oEc.#i7c.#bOi[TDiffType](ICancellableOperationStatus status, Func`1 innerBuild)
    at #oEc.#i7c.#q1f(ICancellableOperationStatus status, IReadOnlySourceControlServerCallBacks sourceControlUserCallBacks, ScriptDatabaseInformation folderOptions)
    at #oEc.#4Ec.#z7c(ICancellableOperationStatus status, IReadOnlySourceControlServerCallBacks sourceControlUserCallBacks)
    at #oEc.#4Ec.#7Jc(ICancellableOperationStatus status, IReadOnlySourceControlServerCallBacks sourceControlUserCallBacks)
    at #oEc.#4Ec.#t.#A2.#D7c(ICancellableOperationStatus status)
    at #eEc.#iEc.#t.#u3.#k5f()
    at RedGate.SQLSourceControl.Engine.Cancellables.CancellableOperationBase.InvokeWithTracker(Action action)
    at #eEc.#iEc.Invoke()
    at #JLc.#Qlg.Invoke()
    at #JLc.#PLc.#t.#Jfb.#EJf()
    at RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.Do(Action toDo, Predicate`1 shouldReportPredicate, Boolean rethrow)
    at RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.DoWithObviousExceptionsRethrowAll(Action action)
    at RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog.DoWithObviousExceptionsRethrowAll(Action action)
    at #JLc.#PLc.#CTc(ICancellableOperation`1 operation, Object token)
  • Silence is golden! :D
  • Apologies. This has been escalated to the project team. We'll try to give you a more meaningful response by the end of today.

    Thanks for bearing with us.

    David
    David Atkinson
    Product Manager
    Redgate Software
  • luan_au,

    Sorry for the delay in replying. Thanks for submitting the problem you had, both here and from within the product.

    The problem you have seen occurs when the working copy of the database contains a statement such as

    EXEC sp_addrolemember N'role_name', N'SunBrowser'
    GO

    But not the corresponding
    CREATE USER SunBrowser

    statement.

    We are working on a fix for this issue (SOC-845). You should be able to carry on working if you SVN update (using tortoise, or any other SVN client) the Security\Users and Security\Schemas folders in your working base in order to make sure that the create user statement exists. I will PM you with the precise details for your case.
Sign In or Register to comment.