microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.6k forks source link

AzureMySqlDeployment - Cannot read property 'getFullyQualifiedName' of undefined #17609

Closed luis3199correia closed 1 year ago

luis3199correia commented 1 year ago

Question, Bug, or Feature?
Type: bug

Enter Task Name: AzureMySqlDeployment

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

Issue Description

Recently upgraded MySQL database to MySQL Flexible server, and when I changed my pipelines to use the new database server, this error occurred. I've found this issue. I think it's the same problem. When I rollback to my previous database server name, everything works fine. I cannot understand why this is not working for flexible server.

`steps:

Error logs

` 2023-01-16T15:01:14.4898239Z ##[debug]Evaluating condition for step: 'Create Azure Database Schema and User' 2023-01-16T15:01:14.4900159Z ##[debug]Evaluating: succeeded() 2023-01-16T15:01:14.4900680Z ##[debug]Evaluating succeeded: 2023-01-16T15:01:14.4901755Z ##[debug]=> True 2023-01-16T15:01:14.4902305Z ##[debug]Result: True 2023-01-16T15:01:14.4902889Z ##[section]Starting: Create Azure Database Schema and User 2023-01-16T15:01:14.5018052Z ============================================================================== 2023-01-16T15:01:14.5018335Z Task : Azure Database for MySQL deployment 2023-01-16T15:01:14.5018516Z Description : Run your scripts and make changes to your Azure Database for MySQL 2023-01-16T15:01:14.5018752Z Version : 1.208.0 2023-01-16T15:01:14.5019029Z Author : Microsoft Corporation 2023-01-16T15:01:14.5019186Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-mysql-deployment 2023-01-16T15:01:14.5019439Z ============================================================================== 2023-01-16T15:01:14.5485354Z ##[debug]Using node path: C:\agents\2.214.1\externals\node10\bin\node.exe 2023-01-16T15:01:14.6974142Z ##[debug]agent.TempDirectory=D:\a_temp 2023-01-16T15:01:14.6998767Z ##[debug]loading inputs and endpoints 2023-01-16T15:01:14.7010776Z ##[debug]loading ENDPOINTAUTH 2023-01-16T15:01:14.7028032Z ##[debug]loading ENDPOINT_AUTHPARAMETER_AUTHENTICATIONTYPE 2023-01-16T15:01:14.7030542Z ##[debug]loading ENDPOINT_AUTHPARAMETER_SERVICEPRINCIPALID 2023-01-16T15:01:14.7032800Z ##[debug]loading ENDPOINT_AUTHPARAMETER_SERVICEPRINCIPALKEY 2023-01-16T15:01:14.7034945Z ##[debug]loading ENDPOINT_AUTHPARAMETER_TENANTID 2023-01-16T15:01:14.7037060Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2023-01-16T15:01:14.7039193Z ##[debug]loading ENDPOINT_AUTHSCHEME 2023-01-16T15:01:14.7041207Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2023-01-16T15:01:14.7043244Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2023-01-16T15:01:14.7050469Z ##[debug]loading INPUT_CONNECTEDSERVICENAME 2023-01-16T15:01:14.7053097Z ##[debug]loading INPUT_DELETEFIREWALLRULE 2023-01-16T15:01:14.7055656Z ##[debug]loading INPUT_IPDETECTIONMETHOD 2023-01-16T15:01:14.7058073Z ##[debug]loading INPUT_SERVERNAME 2023-01-16T15:01:14.7060609Z ##[debug]loading INPUT_SQLFILE 2023-01-16T15:01:14.7063009Z ##[debug]loading INPUT_SQLINLINE 2023-01-16T15:01:14.7065435Z ##[debug]loading INPUT_SQLPASSWORD 2023-01-16T15:01:14.7067849Z ##[debug]loading INPUT_SQLUSERNAME 2023-01-16T15:01:14.7070358Z ##[debug]loading INPUT_TASKNAMESELECTOR 2023-01-16T15:01:14.7117797Z ##[debug]loading SECRET_DATABASE_USER_ADMINISTRATOR_PASSWORD 2023-01-16T15:01:14.7121389Z ##[debug]loading SECRET_DATABASE_USER_ADMINISTRATOR_USERNAME 2023-01-16T15:01:14.7179506Z ##[debug]loading SECRET_DATABASE_USER_DATAMANAGEMENT_PASSWORD 2023-01-16T15:01:14.7180736Z ##[debug]loading SECRET_DATABASE_USER_DATAMANAGEMENT_USERNAME 2023-01-16T15:01:14.7181546Z ##[debug]loading SECRET_DEVOPS_CONTAINERREGISTRY_PASSWORD 2023-01-16T15:01:14.7182353Z ##[debug]loading SECRET_DEVOPS_CONTAINERREGISTRY_USERNAME 2023-01-16T15:01:14.7183068Z ##[debug]loaded 24 2023-01-16T15:01:14.7183747Z ##[debug]Agent.ProxyUrl=undefined 2023-01-16T15:01:14.7184476Z ##[debug]Agent.CAInfo=undefined 2023-01-16T15:01:14.7185178Z ##[debug]Agent.ClientCert=undefined 2023-01-16T15:01:14.7185888Z ##[debug]Agent.SkipCertValidation=undefined 2023-01-16T15:01:14.7491389Z ##[debug]agent.proxyurl=undefined 2023-01-16T15:01:14.7492584Z ##[debug]VSTS_ARM_REST_IGNORE_SSL_ERRORS=undefined 2023-01-16T15:01:14.7493627Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_8c3e173d-3647-442c-984a-9b77979f6381_Release__3732_137812 2023-01-16T15:01:14.7521121Z ##[debug]check path : D:\a_tasks\AzureMysqlDeployment\1.208.0\nodemodules\azure-pipelines-tasks-azure-arm-rest-v2\module.json 2023-01-16T15:01:14.7524356Z ##[debug]adding resource file: D:\a_tasks\AzureMysqlDeployment\1.208.0\nodemodules\azure-pipelines-tasks-azure-arm-rest-v2\module.json 2023-01-16T15:01:14.7525798Z ##[debug]system.culture=en-US 2023-01-16T15:01:14.7568420Z ##[debug]Resource file has already set to: D:\a_tasks\AzureMysqlDeployment\1.208.0\nodemodules\azure-pipelines-tasks-azure-arm-rest-v2\module.json 2023-01-16T15:01:14.7616208Z ##[debug]Resource file has already set to: D:\a_tasks\AzureMysqlDeployment\1.208.0\nodemodules\azure-pipelines-tasks-azure-arm-rest-v2\module.json 2023-01-16T15:01:14.8899562Z ##[debug]Resource file has already set to: D:\a_tasks\AzureMysqlDeployment\1.208.0\nodemodules\azure-pipelines-tasks-azure-arm-rest-v2\module.json 2023-01-16T15:01:14.8900798Z ##[debug]Agent.TempDirectory=D:\a_temp 2023-01-16T15:01:14.8901816Z ##[debug]Resource file has already set to: D:\a_tasks\AzureMysqlDeployment\1.208.0\nodemodules\azure-pipelines-tasks-azure-arm-rest-v2\module.json 2023-01-16T15:01:14.8907653Z ##[debug]Task execution started 2023-01-16T15:01:14.8908566Z ##[debug]check path : D:\a_tasks\AzureMysqlDeployment\1.208.0\task.json 2023-01-16T15:01:14.8909574Z ##[debug]adding resource file: D:\a_tasks\AzureMysqlDeployment_\1.208.0\task.json 2023-01-16T15:01:14.8910424Z ##[debug]system.culture=en-US 2023-01-16T15:01:14.8920667Z ##[debug]check path : D:\a_tasks\AzureMysqlDeployment_\1.208.0\nodemodules\azure-pipelines-tasks-webdeployment-common-v4\module.json 2023-01-16T15:01:14.8921931Z ##[debug]adding resource file: D:\a_tasks\AzureMysqlDeployment\1.208.0\node_modules\azure-pipelines-tasks-webdeployment-common-v4\module.json 2023-01-16T15:01:14.8922890Z ##[debug]system.culture=en-US 2023-01-16T15:01:14.8936286Z ##[debug]ConnectedServiceName= 2023-01-16T15:01:14.8937968Z ##[debug]ServerName=-flex.mysql.database.azure.com 2023-01-16T15:01:14.8938763Z ##[debug]DatabaseName=undefined 2023-01-16T15:01:14.8939534Z ##[debug]SqlUsername="" 2023-01-16T15:01:14.8940319Z ##[debug]SqlPassword="" 2023-01-16T15:01:14.8941322Z ##[debug]TaskNameSelector=InlineSqlTask 2023-01-16T15:01:14.8942536Z ##[debug]SqlFile=D:\a\r1\a 2023-01-16T15:01:14.8944276Z ##[debug]SqlInline=CREATE USER IF NOT EXISTS '' IDENTIFIED BY '';

CREATE SCHEMA IF NOT EXISTS integrations; GRANT ALL ON integrations.* to '***';

CREATE SCHEMA IF NOT EXISTS eapydata; GRANT ALL ON eapydata.* to ''; 2023-01-16T15:01:14.8945403Z ##[debug]SqlAdditionalArguments=undefined 2023-01-16T15:01:14.8946118Z ##[debug]IpDetectionMethod=AutoDetect 2023-01-16T15:01:14.8946832Z ##[debug]StartIpAddress=undefined 2023-01-16T15:01:14.8947522Z ##[debug]EndIpAddress=undefined 2023-01-16T15:01:14.8948220Z ##[debug]DeleteFirewallRule=true 2023-01-16T15:01:14.8948899Z ##[debug]parsed task inputs 2023-01-16T15:01:14.8953687Z ##[debug] auth scheme = ServicePrincipal 2023-01-16T15:01:14.8954745Z ##[debug] data subscriptionid = 2023-01-16T15:01:14.8955698Z ##[debug] data subscriptionname = 2023-01-16T15:01:14.8956965Z ##[debug] auth param serviceprincipalid = 2023-01-16T15:01:14.8957907Z ##[debug] data environmentAuthorityUrl = https://login.windows.net/ 2023-01-16T15:01:14.8958892Z ##[debug] auth param tenantid = 2023-01-16T15:01:14.8959810Z ##[debug]=https://management.azure.com/ 2023-01-16T15:01:14.8961512Z ##[debug] data environment = AzureCloud 2023-01-16T15:01:14.8962452Z ##[debug] auth scheme = ServicePrincipal 2023-01-16T15:01:14.8963309Z ##[debug] data msiclientId = undefined 2023-01-16T15:01:14.8964252Z ##[debug] data activeDirectoryServiceEndpointResourceId = https://management.core.windows.net/ 2023-01-16T15:01:14.8965283Z ##[debug] data AzureKeyVaultServiceEndpointResourceId = https://vault.azure.net 2023-01-16T15:01:14.8966239Z ##[debug] data AzureKeyVaultDnsSuffix = vault.azure.net 2023-01-16T15:01:14.8967241Z ##[debug] data ScopeLevel = Subscription 2023-01-16T15:01:14.8968100Z ##[debug] auth param authenticationType = spnKey 2023-01-16T15:01:14.8968944Z ##[debug]credentials spn endpoint 2023-01-16T15:01:14.8969906Z ##[debug] auth param serviceprincipalkey = 2023-01-16T15:01:14.8970794Z ##[debug] data EnableAdfsAuthentication = false 2023-01-16T15:01:14.8971654Z ##[debug] auth param apitoken = undefined 2023-01-16T15:01:14.8974566Z ##[debug]{"subscriptionID":"","subscriptionName":"","servicePrincipalClientID":"","environmentAuthorityUrl":"https://login.windows.net/","tenantID":"","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://management.azure.com/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription","authenticationType":"spnKey","servicePrincipalKey":***,"isADFSEnabled":false,"applicationTokenCredentials":{"clientId":"***","domain":"***","baseUrl":"https://management.azure.com/","authorityUrl":"https://login.windows.net/","activeDirectoryResourceId":"https://management.azure.com/","isAzureStackEnvironment":false,"authType":"spnKey","secret":***,"isADFSEnabled":false}} 2023-01-16T15:01:14.9051590Z ##[debug]Processed: ##vso[telemetry.publish area=TaskEndpointId;feature=AzureMysqlDeployment]{"endpointId":""} 2023-01-16T15:01:14.9052840Z ##[debug][POST]https://login.windows.net//oauth2/token/ 2023-01-16T15:01:15.0846959Z ##[debug][GET]https://management.azure.com/subscriptions/***/providers/Microsoft.DBforMySQL/servers?api-version=2017-12-01 2023-01-16T15:01:15.1926682Z ##[debug]Correlation ID from ARM api call response : c7151e55-3817-47ad-adbd-72886d8fbc10 2023-01-16T15:01:15.1935784Z ##[debug]Mysql server details from server name: undefined 2023-01-16T15:01:15.1944191Z ##[debug]Getting executable path of mysql client for registry path: \Software\Wow6432Node\MySQL AB 2023-01-16T15:01:15.2082394Z ##[debug]Error during finding of Window Wow6432 mysql executable path: Error: Unable to find MySQL using the registry. Error: %25s . 2023-01-16T15:01:15.2083671Z ##[debug]Getting executable path of mysql client for registry path: \Software\MySQL AB 2023-01-16T15:01:15.2136932Z ##[debug]Error during fetching registry key from path: ProcessUncleanExitError: QUERY command exited with code 1:

ERROR: The system was unable to find the specified registry key or value. 2023-01-16T15:01:15.2179169Z ##[debug]Error during finding of Window mysql executable path: Error: Unable to find MySQL using the registry. Error: %25s . 2023-01-16T15:01:15.2180473Z ##[debug]which 'mysql' 2023-01-16T15:01:15.2323479Z ##[debug]found: 'C:\mysql\bin\mysql.exe' 2023-01-16T15:01:15.2324582Z ##[debug]Window mysql executable path from enviroment variable: C:\mysql\bin\mysql.exe 2023-01-16T15:01:15.2325715Z ##[debug]Getting exception: TypeError: Cannot read property 'getFullyQualifiedName' of undefined 2023-01-16T15:01:15.2326567Z ##[debug]task result: Failed 2023-01-16T15:01:15.2353774Z ##[error]TypeError: Cannot read property 'getFullyQualifiedName' of undefined 2023-01-16T15:01:15.2364883Z ##[debug]Processed: ##vso[task.issue type=error;]TypeError: Cannot read property 'getFullyQualifiedName' of undefined 2023-01-16T15:01:15.2367318Z ##[debug]Processed: ##vso[task.complete result=Failed;]TypeError: Cannot read property 'getFullyQualifiedName' of undefined 2023-01-16T15:01:15.2368168Z ##[debug]Task completed. 2023-01-16T15:01:15.2369967Z ##[debug]Error during fetching registry key from path: ProcessUncleanExitError: QUERY command exited with code 1: ERROR: The system was unable to find the specified registry key or value. 2023-01-16T15:01:15.2408345Z ##[section]Finishing: Create Azure Database Schema and User

`

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

mosoftwareenterprises commented 12 months ago

@luis3199correia Did you fix this? I am seeing the same problem today after an upgrade to flexible server