Potential ArgumentOutOfRangeException during deployment to Fabric SQL DB
- Dominant language
- C#
- Stars
- 460
- Forks
- 29
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 7
Description
- SqlPackage or DacFx Version: 170.1.61
- .NET Framework (Windows-only) or .NET Core: .NET 8
- Environment (local platform and source/target platforms): Fabric SQL DB
**Steps to Reproduce:**
1. Create table with a few columns and an index in a project, deploy to Fabric SQL DB
2. Remove the last column from the table in source project, deploy again
>"Specified argument was out of the range of valid values. (Parameter 'index')"}],"callStack":" at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.ForwardModelRelationship.GetElementMultiRelationshipImpl[TTo](Int32 index)\r\n at Microsoft.Data.Tools.Schema.SchemaModel.ModelStore.MultiRelationship`2.get_Item(Int32 index)\r\n at Microsoft.Data.Tools.Schema.Sql.Deployment.Analyzers.TableAnalyzer.ValidateIndexDependenciesChange(SqlTable sourceTable, SqlTable targetTable, SqlIndex index)\r\n at Microsoft.Data.Tools.Schema.Sql.Deployment.Analyzers.TableAnalyzer.AnalyzeDrop(IModelElement element)\r\n at Microsoft.Data.Tools.Schema.Sql.Deployment.Analyzers.PlanMediator.CollectChangesFromDrops()\r\n at Microsoft.Data.Tools.Schema.Sql.Deployment.Analyzers.PlanMediator.BuildOperations()\r\n at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.OnGeneratePlan()\r\n at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.GeneratePlan(List`1 drops)\r\n at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.BuildPlan()\r\n at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.Controller.CreatePlan()\r\n at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass24_1.b__1()\r\n at Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action)\r\n at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass24_0.b__0(Object operation, CancellationToken token)\r\n at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)\r\n at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)\r\n at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)\r\n at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)\r\n at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)\r\n at Microsoft.SqlServer.Dac.OperationExtension.Execute(IOperation operation, DacLoggingContext loggingContext, CancellationToken cancellationToken)\r\n at Microsoft.SqlServer.Dac.DacServices.InternalDeploy(IPackageSource packageSource, Boolean isDacpac, String targetDatabaseName, DacDeployOptions options, CancellationToken cancellationToken, DacLoggingContext loggingContext, Action`3 reportPlanOperation, Boolean executePlan, DacTask action, DacPackage dacPackage)
**Did this occur in prior versions? If not - which version(s) did it work in?**
(DacFx/SqlPackage/SSMS/Azure Data Studio)
Contributor guide
Research direction
Reproduce the two-step deployment against Fabric SQL DB using DacFx 170.1.61, then start at TableAnalyzer.ValidateIndexDependenciesChange in the stack trace and trace the failing index relationship lookup. Done means removing the final table column no longer causes ArgumentOutOfRangeException during deployment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100