Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert-AzSqlDatabaseVulnerabilityAssessmentScan - An unexpected error occured [sic] #27100

Open
talzayas opened this issue Feb 10, 2025 · 2 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Service Attention This issue is responsible by Azure service team. SQL

Comments

@talzayas
Copy link

talzayas commented Feb 10, 2025

Description

I have a script that uses Convert-AzSqlDatabaseVulnerabilityAssessmentScan to convert the json files generated by Start-AzSqlDatabaseVulnerabilityAssessmentScan to nicely formatted Excel files. This last worked on Friday 1/31.

However, when I ran the same script on Friday 2/7, it failed with "An unexpected error occured [sic] while processing the request."

I tried it again today and encountered the same error.

Issue script & Debug output

DEBUG: AzureQoSEvent:  Module: Az.Sql:6.0.1; CommandName: Start-AzSqlDatabaseVulnerabilityAssessmentScan; PSVersion: 7.5.0; IsSuccess: True; Duration: 00:00:57.1499686; SanitizeDuration: 00:00:00.0005116
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:42 PM - StartAzureSqlDatabaseVulnerabilityAssessmentScan end processing.
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:42 PM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.Accounts], Cmdlet = [Get-AzContext]. Returning default value [True].
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.Accounts:4.0.2; CommandName: Get-AzContext; PSVersion: 7.5.0; IsSuccess: True; Duration: 00:00:00.0022629; SanitizeDuration: 00:00:00.0000294
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:42 PM - GetAzureRMContextCommand end processing.
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:42 PM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.Accounts], Cmdlet = [Get-AzContext]. Returning default value [True].
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.Accounts:4.0.2; CommandName: Get-AzContext; PSVersion: 7.5.0; IsSuccess: True; Duration: 00:00:00.0027381; SanitizeDuration: 00:00:00.0000398
DEBUG: 12:17:42 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:43 PM - GetAzureRMContextCommand end processing.
DEBUG: 12:17:43 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:43 PM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 12:17:43 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.Accounts], Cmdlet = [Get-AzContext]. Returning default value [True].
DEBUG: 12:17:43 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:43 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:43 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.Accounts:4.0.2; CommandName: Get-AzContext; PSVersion: 7.5.0; IsSuccess: True; Duration: 00:00:00.0037380; SanitizeDuration: 00:00:00.0000387
DEBUG: 12:17:43 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:43 PM - GetAzureRMContextCommand end processing.
DEBUG: 12:17:43 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 12:17:43 PM - ConvertAzureSqlDatabaseVulnerabilityAssessmentScan begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 12:17:43 PM - using account id [REDACTED]...  
DEBUG: 12:17:43 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.Sql], Cmdlet = [Convert-AzSqlDatabaseVulnerabilityAssessmentScan]. Returning default value [True].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<rg_id>/providers/Microsoft.Sql/servers/<sql_server>/databases/<database>/vulnerabilityAssessments/default/scans/<scan_name>/export?api-version=2020-11-01-preview

Headers:
Accept-Language               : en-US
x-ms-client-request-id        : c89d83e1-fd3e-40a9-bf92-38bc9043d489

Body:

DEBUG: ============================ HTTP RESPONSE ============================    

Status Code:
InternalServerError

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-request-id               : [REDACTED]
x-ms-failure-cause            : service
x-ms-ratelimit-remaining-subscription-writes: 200
x-ms-ratelimit-remaining-subscription-global-writes: 3000
x-ms-correlation-request-id   : 6688189c-a13a-43d5-b01d-fbdef1c5eb3e
x-ms-routing-request-id       : WESTUS:20250210T202113Z:6688189c-a13a-43d5-b01d-fbdef1c5eb3e
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: F40D2051F0A9453E862B1970D56E1795 Ref B: SJC211051201025 Ref C: 2025-02-10T20:20:26Z
Date                          : Mon, 10 Feb 2025 20:21:13 GMT

Body:
{
  "error": {
    "code": "InternalServerError",
    "message": "An unexpected error occured while processing the request. Tracking ID: '[REDACTED]'"
  }
}


DEBUG: 12:21:13 PM - [ConfigManager] Got nothing from [EnableErrorRecordsPersistence], Module = [Az.Sql], Cmdlet = [Convert-AzSqlDatabaseVulnerabilityAssessmentScan]. Returning default value [False].
Convert-AzSqlDatabaseVulnerabilityAssessmentScan: C:\Scripts\AzSql-IssueDemo.ps1:32:30
Line |
  32 |  … nResult = $sqlScan | Convert-AzSqlDatabaseVulnerabilityAssessmentScan   
     |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     | An unexpected error occured while processing the request. Tracking ID:     
     | '[REDACTED]'

Environment data

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

PS> Get-Module Az*

ModuleType       : Script
Version          : 4.0.2
PreRelease       : 
Name             : Az.Accounts
ExportedCommands : {[Add-AzEnvironment, Add-AzEnvironment], [Clear-AzConfig,      
                   Clear-AzConfig], [Clear-AzContext, Clear-AzContext],
                   [Clear-AzDefault, Clear-AzDefault]…}

ModuleType       : Script
Version          : 6.0.1
PreRelease       : 
Name             : Az.Sql
ExportedCommands : {[Add-AzSqlDatabaseToFailoverGroup,
                   Add-AzSqlDatabaseToFailoverGroup], [Add-AzSqlElasticJobStep,   
                   Add-AzSqlElasticJobStep], [Add-AzSqlElasticJobTarget,
                   Add-AzSqlElasticJobTarget], [Add-AzSqlInstanceKeyVaultKey,     
                   Add-AzSqlInstanceKeyVaultKey]…}

Error output

PS> Resolve-AzError

RequestId      : [REDACTED]
Message        : An unexpected error occured while processing the request.        
                 Tracking ID: '[REDACTED]'
ServerMessage  : InternalServerError: An unexpected error occured while
                 processing the request. Tracking ID:
                 '[REDACTED]' (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError])
ServerResponse : {InternalServerError}
RequestMessage : {POST https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<rg_id>/providers/Microsoft.Sql/servers/<sql_server>/databases/<database>/vulnerabilityAssessments/default/scans/<scan_name>/export?api-version=2020-11-01-preview}
InvocationInfo : {Convert-AzSqlDatabaseVulnerabilityAssessmentScan}
Line           :     $scanResult = $sqlScan |
                 Convert-AzSqlDatabaseVulnerabilityAssessmentScan

Position       : At C:\Scripts\AzSql-IssueDemo.ps1:32        
                 char:30
                 + … nResult = $sqlScan |
                 Convert-AzSqlDatabaseVulnerabilityAssessmentScan
                 +
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StackTrace     :    at Microsoft.Azure.Management.Sql.DatabaseVulnerabilityAssess 
                 mentScansOperations.ExportWithHttpMessagesAsync(String
                 resourceGroupName, String serverName, String databaseName,       
                 String scanId, Dictionary`2 customHeaders, CancellationToken     
                 cancellationToken)
                    at Microsoft.Azure.Management.Sql.DatabaseVulnerabilityAssess 
                 mentScansOperationsExtensions.ExportAsync(IDatabaseVulnerability 
                 AssessmentScansOperations operations, String resourceGroupName,  
                 String serverName, String databaseName, String scanId,
                 CancellationToken cancellationToken)
                    at Microsoft.Azure.Management.Sql.DatabaseVulnerabilityAssess 
                 mentScansOperationsExtensions.Export(IDatabaseVulnerabilityAsses 
                 smentScansOperations operations, String resourceGroupName,       
                 String serverName, String databaseName, String scanId)
                    at Microsoft.Azure.Commands.Sql.VulnerabilityAssessment.Servi 
                 ces.VulnerabilityAssessmentEndpointsCommunicator.ConvertDatabase 
                 VulnerabilityAssessmentScan(String resourceGroupName, String     
                 serverName, String databaseName, String scanId)
                    at Microsoft.Azure.Commands.Sql.VulnerabilityAssessment.Servi 
                 ces.SqlVulnerabilityAssessmentScanAdapter.ConvertVulnerabilityAs 
                 sessmentScan(String resourceGroup, String serverName, String     
                 databaseName, String scanId, ApplyToType applyToType)
                    at Microsoft.Azure.Commands.Sql.VulnerabilityAssessment.Cmdle 
                 t.VulnerabilityAssessmentScan.ConvertAzureSqlVulnerabilityAssess 
                 mentScanBase.PersistChanges(VulnerabilityAssessmentScanExportMod 
                 el model)
                    at Microsoft.Azure.Commands.Sql.Common.AzureSqlCmdletBase`2.< 
                 >c__DisplayClass16_0.<ExecuteCmdlet>b__0()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCm 
                 dlet.ConfirmAction(String processMessage, String target, Action  
                 action)
                    at Microsoft.Azure.Commands.Sql.Common.AzureSqlCmdletBase`2.E 
                 xecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExt 
                 ensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)        
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExt 
                 ensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1        
                 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExt 
                 ensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCm 
                 dlet.ProcessRecord()
@talzayas talzayas added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Feb 10, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported needs-triage This is a new issue that needs to be triaged to the appropriate team. and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Feb 10, 2025
@talzayas talzayas changed the title Convert-AzSqlDatabaseVulnerabilityAssessmentScan - An unexpected error occured[sic] Convert-AzSqlDatabaseVulnerabilityAssessmentScan - An unexpected error occured [sic] Feb 10, 2025
@isra-fel isra-fel added SQL Service Attention This issue is responsible by Azure service team. and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Feb 13, 2025
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureSQLGitHub.

1 similar comment
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureSQLGitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Service Attention This issue is responsible by Azure service team. SQL
Projects
None yet
Development

No branches or pull requests

2 participants