Offline Schema-Model Issues

This issue just crept up today and appears to have started happening after the latest update.

Message = Could not synchronize Offline Schema Model: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index.
Data = System.Collections.ListDictionaryInternal
InnerException = System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at RedGate.SQLCompare.Engine.FileGroups.get_Item(Int32 index)
   at RedGate.SQLCompare.Engine.PartitionScheme.<CompareWith>d__26.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   at RedGate.SQLCompare.Engine.PartitionScheme.Equals(IDatabaseObject targetObject, ComparisonContext context)
   at RedGate.SQLCompare.Engine.ScriptableDatabaseObject.Equals(IDatabaseObject target, Options options)
   at RedGate.SQLCompare.Engine.DatabaseCollaborators.DirectObjectsComparison.ProcessDatabaseObject[T](Differences differences, IDatabaseObjects`1 targetObjects, Options options, DatabaseMapper dbmapper, IDatabaseObject t1, ProgressTracker progressTracker)
   at RedGate.SQLCompare.Engine.DatabaseCollaborators.DirectObjectsComparison.<>c__DisplayClass9_0`1.<PopulateDifferences>b__0(IDatabaseObject t1)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )
   at RedGate.SQLCompare.Engine.DatabaseCollaborators.DirectObjectsComparison.PopulateDifferences[T](Differences differences, IDatabaseObjects`1 objects, IDatabaseObjects`1 targetObjects, Options options, DatabaseMapper dbmapper, ProgressTracker progressTracker)
   at RedGate.SQLCompare.Engine.DatabaseCollaborators.DirectObjectsComparison.PopulateDifferences(Differences differences, ICancellable subscriber)
   at RedGate.SQLCompare.Engine.DatabaseComparison.CompareDatabases(Database source, Database target, Options options, SqlCompareOwnerMappings ownerMappings, SqlCompareTableMappings tableMappings)
   at RedGate.SQLCompare.Engine.Database.CompareWith(Database targetDatabase, Nullable`1 optionsParam, SqlCompareOwnerMappings ownerMappings, SqlCompareTableMappings tableMappings)
   at RedGate.Versioning.Engine.Comparison.SqlCompare.SqlCompareDatabase.CompareWith(Database other, IComparisonOptions options, IComparisonFilterSettings comparisonFilterSettings)
   at RedGate.Versioning.Engine.Comparison.SqlCompare.SqlCompareDatabase.CompareWith(IDatabase other, IComparisonOptions options, IComparisonFilterSettings comparisonFilterSettings)
   at RedGate.Versioning.Core.DatabaseRefresh.ProjectComparisonService.CompareDatabaseWithProject(IDatabaseProject databaseProject, ProjectSyncType syncType, IDatabase sourceDb, IDatabase projectDbFolder, IEnumerable`1 pendingChanges, IEnumerable`1 supportedObjectTypes, IComparisonOptions options, DirectoryInfo destinationFolder)
   at RedGate.Versioning.Core.DatabaseRefresh.ProjectComparisonService.CompareWithProject(IDatabaseProject databaseProject, ProjectSyncType syncType, IEnumerable`1 pendingChanges, DirectoryInfo destinationFolder, IEnumerable`1 supportedObjectTypes, Boolean markAsDeployed, DatabaseConnectionInfo syncSource)
   at RedGate.Versioning.Core.DatabaseRefresh.DatabaseProjectSynchronization.SyncDatabaseWithProject(IDatabaseProject databaseProject, ProjectSyncType syncType, IEnumerable`1 pendingChanges, DatabaseConnectionInfo syncSource, IList`1& newFiles, IList`1& modifiedFiles)
   at RedGate.Versioning.Core.DatabaseRefresh.DatabaseRefresh.SyncOfflineSchemaWithProject(IDatabaseProject databaseProject, IList`1& newFiles, IList`1& modifiedFiles, Exception& offlineSchemaThreadException)
TargetSite = System.Collections.Generic.IReadOnlyCollection`1[RedGate.Versioning.Core.PendingChanges.IPendingChange] Refresh(RedGate.Versioning.Core.VersioningProject.IDatabaseProject, System.Collections.Generic.IReadOnlyCollection`1[RedGate.Versioning.Core.PendingChanges.IPendingChange], Boolean, System.Threading.CancellationToken, System.Collections.Generic.IList`1[System.IO.FileInfo] ByRef, System.Collections.Generic.IList`1[System.IO.FileInfo] ByRef, System.String, System.IO.FileInfo)
StackTrace =    at RedGate.Versioning.Core.DatabaseRefresh.DatabaseRefresh.Refresh(IDatabaseProject databaseProject, IReadOnlyCollection`1 inputPendingChanges, Boolean doDataCompare, CancellationToken cancellationToken, IList`1& newFiles, IList`1& modifiedFiles, String sourceDatabaseName, FileInfo sourceSnap)
   at RedGate.Versioning.Client.VsShell.VisualStudio.PendingChangeModel.CompareSandboxToProject()
   at RedGate.Versioning.Client.VsShell.VisualStudio.PendingChangeModel.<CompareSandboxToProjectAsync>d__77.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Client.VsShell.VisualStudio.Commands.RefreshCommand.<ExecuteAsync>d__14.MoveNext()
HelpLink = 
Source = RedGate.Versioning.Core.DatabaseRefresh
HResult = -2146233088
Tagged:

Answers

  • I'm sorry to hear that you've run into a problem with updating the Schema-Model folder.

    Would it be possible to zip your project and send it to me so I can try reproducing the issue? Feel free to send me a private message on here, or alternatively, email support@red-gate.com and mention this thread.
    Daniel Nolan
    Product Manager
    Redgate Software
  • wcullerwculler Posts: 16 Bronze 1
    dnlnln said:
    I'm sorry to hear that you've run into a problem with updating the Schema-Model folder.

    Would it be possible to zip your project and send it to me so I can try reproducing the issue? Feel free to send me a private message on here, or alternatively, email support@red-gate.com and mention this thread.
    Unfortunately, there are quite a few objects in the project that I cannot share due to the nature of our business.  I will say that I did move to SQL Change Automation and the same issue persists.  Is there something else I can do to help you look into it?
  • wcullerwculler Posts: 16 Bronze 1
    wculler said:
    dnlnln said:
    I'm sorry to hear that you've run into a problem with updating the Schema-Model folder.

    Would it be possible to zip your project and send it to me so I can try reproducing the issue? Feel free to send me a private message on here, or alternatively, email support@red-gate.com and mention this thread.
    Unfortunately, there are quite a few objects in the project that I cannot share due to the nature of our business.  I will say that I did move to SQL Change Automation and the same issue persists.  Is there something else I can do to help you look into it?
    I found a work around just now.  I deleted the whole Offline Schema model directory structure and then refreshed.  It recreated everything without the error referenced in my original post.
  • dnlnlndnlnln Posts: 234 Gold 2
    edited June 21, 2018 5:44AM
    I'm glad to hear you found a workaround for the bug.

    I appreciate the sensitivity of the db project information to your business. If it happens again and/or if you're able to come up with a sample project without sensitive information that replicates the problem (perhaps based on a before-and-after diff of the affected files in source control), that would definitely help us to investigate the issue further.
    Daniel Nolan
    Product Manager
    Redgate Software
Sign In or Register to comment.