-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
Data MigrationService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reported
Description
Description
Trying to run the sqlschemMigration function.
from a local SQL database to AZURE SQL db.
Issue script & Debug output
PS WindowsPowerShell> New-AzDataMigrationSqlServerSchema -Action "GenerateScript" -SourceConnectionString $sourceConnectionString -TargetConnectionString $TargetconnectionString
#
Starting schema script generation...
In progress...
Total number of object collected: 4
Total elapsed time: 00:00:00.6310934
Schemas: 1
Tables: 2
Users: 1
The number of scripted objects: 0
Progress: 0%
Total elapsed time: 00:00:00.7207858The event and error logs folder path: C:\Users\BC-ADMIN2\AppData\Local\Microsoft\SqlSchemaMigration
Finishing schema script generation.
SqlSchemaMigration.exe : Unhandled exception. System.IO.IOException: The handle is invalid.
At C:\Program Files\WindowsPowerShell\Modules\Az.DataMigration\0.14.1\DataMigration.Autorest\custom\Cmdlets\New-AzDataMigrationSqlServerSchema.ps1:
133 char:17
+ & $ExePath $Action @splat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Unhandled excep...dle is invalid.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at System.ConsolePal.GetCursorPosition()
at System.Console.get_CursorTop()
at SchemaMigration.ConsoleApp.Program.StartSchemaScriptGenerationWorkflow(GenerateScriptOptions options) in C:\__w\1\s\src\SqlMigrationSchema\Sc
hemaMigration.Console\Program.cs:line 191
at SchemaMigration.ConsoleApp.Program.Main(String[] args) in C:\__w\1\s\src\SqlMigrationSchema\SchemaMigration.Console\Program.cs:line 48
at SchemaMigration.ConsoleApp.Program.<Main>(String[] args)
DEBUG: AzureQoSEvent: Module: Az.DataMigration:0.14.1; CommandName: New-AzDataMigrationSqlServerSchema; PSVersion: 5.1.17763.4644; IsSuccess: True;
Duration: 00:00:02.7370873
Logfile contains:
ErrorTraceSource Error: 0 : Error ID: ScriptingObjectsFailure; Message: The handle is invalid.; Helper Link: ; Raw exception: System.IO.IOException: The handle is invalid.
at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at System.ConsolePal.GetCursorPosition()
at SqlSchemaMigration.Utils.ConsoleProgressSubscriber.CalculateProgress() in C:\__w\1\s\src\SqlMigrationSchema\SchemaMigration.Console\Utils\ConsoleProgressSubscriber.cs:line 89
at Microsoft.SqlServer.Migration.Schema.Contracts.Monitor.SchemaMigrationProgressSubscriberBase.OnNext(IScriptGenerationStartEvent evt) in C:\__w\1\s\src\SqlMigrationSchema\Microsoft.SqlServer.Migration.Schema.Contracts\Monitor\SchemaMigrationProgressSubscriberBase.cs:line 79
at Microsoft.SqlServer.Migration.Schema.Actions.GenerateSchemaScripts.GenerateSchemaMigrationScriptAction.<>c__DisplayClass4_0.<ExecuteAsync>b__0(IObserver`1 o) in C:\__w\1\s\src\SqlMigrationSchema\Microsoft.SqlServer.Migration.Schema\Actions\GenerateSchemaScripts\GenerateSchemaMigrationScriptAction.cs:line 70
at Microsoft.SqlServer.Migration.Schema.Contracts.Monitor.Observers.ForEach[T](IEnumerable`1 observers, Action`1 observerCallback) in C:\__w\1\s\src\SqlMigrationSchema\Microsoft.SqlServer.Migration.Schema.Contracts\Monitor\Observers.cs:line 61
at Microsoft.SqlServer.Migration.Schema.Contracts.Monitor.Observers.ForEach[T,T2](IDictionary`2 observers, Action`1 observerCallback) in C:\__w\1\s\src\SqlMigrationSchema\Microsoft.SqlServer.Migration.Schema.Contracts\Monitor\Observers.cs:line 35
at Microsoft.SqlServer.Migration.Schema.Actions.GenerateSchemaScripts.GenerateSchemaMigrationScriptAction.ExecuteAsync(CancellationToken cancellationToken) in C:\__w\1\s\src\SqlMigrationSchema\Microsoft.SqlServer.Migration.Schema\Actions\GenerateSchemaScripts\GenerateSchemaMigrationScriptAction.cs:line 70.Environment data
Name Value
---- -----
PSVersion 5.1.17763.4644
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.4644
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1Module versions
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.12.5 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault...}
Script 0.14.1 Az.DataMigration {Get-AzDataMigrationProject, Get-AzDataMigrationService, Get-AzDataMigrationTask, Invo...Error output
DEBUG: 23:33:39 - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 23:33:39 - using account id '[askme]'...
DEBUG: 23:33:39 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
HistoryId: -1
Message : at SchemaMigration.ConsoleApp.Program.<Main>(String[] args)
StackTrace :
Exception : System.Management.Automation.RemoteException
InvocationInfo : {SqlSchemaMigration.exe}
Line : & $ExePath $Action @splat
Position : At C:\Program Files\WindowsPowerShell\Modules\Az.DataMigration\0.14.1\DataMigration.Autorest\custom\Cmdlets\New-AzDataMigrationSql
ServerSchema.ps1:133 char:17
+ & $ExePath $Action @splat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : -1
Message : at SchemaMigration.ConsoleApp.Program.Main(String[] args) in C:\__w\1\s\src\SqlMigrationSchema\SchemaMigration.Console\Program.
cs:line 48
StackTrace :
Exception : System.Management.Automation.RemoteException
InvocationInfo : {SqlSchemaMigration.exe}
Line : & $ExePath $Action @splat
Position : At C:\Program Files\WindowsPowerShell\Modules\Az.DataMigration\0.14.1\DataMigration.Autorest\custom\Cmdlets\New-AzDataMigrationSql
ServerSchema.ps1:133 char:17
+ & $ExePath $Action @splat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : -1
Message : at SchemaMigration.ConsoleApp.Program.StartSchemaScriptGenerationWorkflow(GenerateScriptOptions options) in C:\__w\1\s\src\SqlM
igrationSchema\SchemaMigration.Console\Program.cs:line 191
StackTrace :
Exception : System.Management.Automation.RemoteException
InvocationInfo : {SqlSchemaMigration.exe}
Line : & $ExePath $Action @splat
Position : At C:\Program Files\WindowsPowerShell\Modules\Az.DataMigration\0.14.1\DataMigration.Autorest\custom\Cmdlets\New-AzDataMigrationSql
ServerSchema.ps1:133 char:17
+ & $ExePath $Action @splat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : -1
Message : at System.Console.get_CursorTop()
StackTrace :
Exception : System.Management.Automation.RemoteException
InvocationInfo : {SqlSchemaMigration.exe}
Line : & $ExePath $Action @splat
Position : At C:\Program Files\WindowsPowerShell\Modules\Az.DataMigration\0.14.1\DataMigration.Autorest\custom\Cmdlets\New-AzDataMigrationSql
ServerSchema.ps1:133 char:17
+ & $ExePath $Action @splat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : -1
Message : at System.ConsolePal.GetCursorPosition()
StackTrace :
Exception : System.Management.Automation.RemoteException
InvocationInfo : {SqlSchemaMigration.exe}
Line : & $ExePath $Action @splat
Position : At C:\Program Files\WindowsPowerShell\Modules\Az.DataMigration\0.14.1\DataMigration.Autorest\custom\Cmdlets\New-AzDataMigrationSql
ServerSchema.ps1:133 char:17
+ & $ExePath $Action @splat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : -1
Message : at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
StackTrace :
Exception : System.Management.Automation.RemoteException
InvocationInfo : {SqlSchemaMigration.exe}
Line : & $ExePath $Action @splat
Position : At C:\Program Files\WindowsPowerShell\Modules\Az.DataMigration\0.14.1\DataMigration.Autorest\custom\Cmdlets\New-AzDataMigrationSql
ServerSchema.ps1:133 char:17
+ & $ExePath $Action @splat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : -1
Message : Unhandled exception. System.IO.IOException: The handle is invalid.
StackTrace :
Exception : System.Management.Automation.RemoteException
InvocationInfo : {SqlSchemaMigration.exe}
Line : & $ExePath $Action @splat
Position : At C:\Program Files\WindowsPowerShell\Modules\Az.DataMigration\0.14.1\DataMigration.Autorest\custom\Cmdlets\New-AzDataMigrationSql
ServerSchema.ps1:133 char:17
+ & $ExePath $Action @splat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : -1
HistoryId: 3
Message : The specified module 'SQLASCmdlets' was not loaded because no valid module file was found in any module directory.
StackTrace :
Exception : System.IO.FileNotFoundException
InvocationInfo : {Import-Module}
Line : Import-Module SQLASCmdlets -ErrorAction SilentlyContinue -Global
Position : At C:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\SQLPS\SqlPsPostScript.ps1:18 char:1
+ Import-Module SQLASCmdlets -ErrorAction SilentlyContinue -Global
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 3
DEBUG: 23:33:39 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.12.5; CommandName: Resolve-AzError; PSVersion: 5.1.17763.4644; IsSuccess: True; Duration: 00:00:00.1668
175
DEBUG: 23:33:39 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 23:33:39 - ResolveError end processinMetadata
Metadata
Assignees
Labels
Data MigrationService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reported