Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

az sql db copy is stalling and leaves databases in error #27587

Open jrunestone opened 1 year ago

jrunestone commented 1 year ago

Describe the bug

Our CLI scripts for copying a database suddenly started to run indefinitely without succeeding or failing. After cancelling, the same CLI command and also performing the action in the portal fails with an error saying that the specified databases are in "replication error". Copying to a database with a new name works through the portal, not the CLI (still doesn't finish in the CLI).

I made one change today removing explicit capacity and service-objective args from the CLI command and then it completes without errors. Changing Standard to S0 also seems to work, at least preliminary. We've been specifying Standard for a long time though. Either that parameter changed or the arguments should be left out since they need to be identical anyway?

No database is created.

Related command

az sql db copy --resource-group rg-xxx --server sql-xxx --name sqldb-xxx --dest-name sqldb2-lxxx --compute-model Provisioned --service-objective Standard --capacity 10

Errors

This is from the portal since the CLI command never completes/fails.

"submissionTimestamp": "2023-09-25T07:55:28Z",

    "subscriptionId": "xxxxxx",
    "tenantId": "xxxxxx",

    "properties": {

        "statusCode": "Conflict",

        "statusMessage": "{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceDeploymentFailure\",\"target\":\"/subscriptions/xxxxxxx/resourceGroups/xxxxx/providers/Microsoft.Sql/servers/xxxxxx/databases/database-1\",\"message\":\"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"DuplicateGeoDrRelation\",\"message\":\"The databases 'database-1' in server 'server-1' and 'database-2' in server 'server-1' are already in a replication relation.\"}]}}",

        "eventCategory": "Administrative",

        "entity": "/subscriptions/xxxxxx/resourcegroups/xxxx/providers/Microsoft.Sql/servers/sql-lrfse-stage-euw/databases/database-2",

        "message": "Microsoft.Sql/servers/databases/write",

        "hierarchy": "xxxxxx"

    }

Issue script & Debug output

cli.knack.cli: Command arguments: ['sql', 'db', 'copy', '--resource-group', 'xxxxxxx', '--server', 'xxxxxx', '--name', 'database-1', '--dest-name', 'database-2', '--compute-model', 'Provisioned', '--service-objective', 'Standard', '--capacity', '10', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7fdde8089360>, <function OutputProducer.on_global_arguments at 0x7fdde7fe8280>, <function CLIQuery.on_global_arguments at 0x7fdde7e0d480>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'sql': ['azure.cli.command_modules.sql', 'azure.cli.command_modules.sqlvm']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: sql                       0.075        56       215
cli.azure.cli.core: sqlvm                     0.029         4        20
cli.azure.cli.core: Total (2)                 0.104        60       235
cli.azure.cli.core: Loaded 59 groups, 235 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : sql db copy
cli.azure.cli.core: Command table: sql db copy
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fdde70aacb0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/xxxxxx/.azure/commands/2023-10-12.11-31-23.sql_db_copy.2674676.log'.
az_command_data_logger: command args: sql db copy --resource-group {} --server {} --name {} --dest-name {} --compute-model {} --service-objective {} --capacity {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7fdde70eb910>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7fdde70eb880>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7fdde7105750>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7fdde7fe8310>, <function CLIQuery.handle_query_parameter at 0x7fdde7e0d510>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7fdde70c37f0>]
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=SqlManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='/home/xxxxxx/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /home/xxxxxx/.azure/msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.application: Broker enabled? False
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Found 1 RTs matching {'environment': 'login.microsoftonline.com', 'home_account_id': '********.9188040d-6c67-4c5b-b112-36a304b66dad', 'family_id': '1'}
msal.telemetry: Generate or reuse correlation_id: xxxxxx
msal.application: Cache attempts an RT
urllib3.connectionpool: Starting new HTTPS connection (1): login.microsoftonline.com:443
urllib3.connectionpool: https://login.microsoftonline.com:443 "POST /xxxxxx/oauth2/v2.0/token HTTP/1.1" 200 5713

cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx/databases/database-1?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'CommandName': 'sql db copy'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-group --server --name --dest-name --compute-model --service-objective --capacity --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.51.0 (DEB) azsdk-python-mgmt-sql/4.0.0b10 Python/3.10.10 (Linux-6.4.6-76060406-generic-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx/databases/database-1?api-version=2022-08-01-preview HTTP/1.1" 200 1180
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Content-Length': '1180'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11988'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENSOUTH:20231012T093124Z:xxxxxx'
cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies:     'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 12 Oct 2023 09:31:24 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"sku":{"name":"Standard","tier":"Standard","capacity":10},"kind":"v12.0,user","properties":{"collation":"Finnish_Swedish_CI_AS","maxSizeBytes":2147483648,"status":"Online","databaseId":"xxxxxx","creationDate":"2023-05-04T21:21:09.857Z","currentServiceObjectiveName":"S0","requestedServiceObjectiveName":"S0","defaultSecondaryLocation":"northeurope","catalogCollation":"SQL_Latin1_General_CP1_CI_AS","zoneRedundant":false,"earliestRestoreDate":"2023-10-05T09:31:24.7346739Z","readScale":"Disabled","currentSku":{"name":"Standard","tier":"Standard","capacity":10},"currentBackupStorageRedundancy":"Geo","requestedBackupStorageRedundancy":"Geo","maintenanceConfigurationId":"/subscriptions/xxxxxx/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default","isLedgerOn":false,"isInfraEncryptionEnabled":false,"availabilityZone":"NoPreference"},"location":"westeurope","id":"/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx/databases/database-1","name":"database-1","type":"Microsoft.Sql/servers/databases"}
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=SqlManagementClient
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.application: Broker enabled? False
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: xxxxx
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'CommandName': 'sql db copy'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-group --server --name --dest-name --compute-model --service-objective --capacity --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.51.0 (DEB) azsdk-python-mgmt-sql/4.0.0b10 Python/3.10.10 (Linux-6.4.6-76060406-generic-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx?api-version=2022-08-01-preview HTTP/1.1" 200 806
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Content-Length': '806'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '6383de53-6cf3-4a1c-95fb-1ebd4a303e7f'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11989'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': 'xxxxxxxxxx'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENSOUTH:20231012T093125Z:xxxxxxxxxx'
cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies:     'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 12 Oct 2023 09:31:24 GMT'
cli.azure.cli.core.sdk.policies: Response content:
xxxx
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: d0819234-a392-4f72-84d9-411592e36868
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'CommandName': 'sql db copy'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-group --server --name --dest-name --compute-model --service-objective --capacity --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.51.0 (DEB) azsdk-python-mgmt-sql/4.0.0b10 Python/3.10.10 (Linux-6.4.6-76060406-generic-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx?api-version=2022-08-01-preview HTTP/1.1" 200 806
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Content-Length': '806'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': 'f2686590-0cf5-4abd-a268-ecc43586fb46'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11994'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '3e31dfaa-8752-4577-b0ea-60f9f195655b'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENCENTRAL:20231012T093125Z:3e31dfaa-8752-4577-b0ea-60f9f195655b'
cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies:     'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.sdk.policies:     'X-MSEdge-Ref': 'Ref A: 61A7B8BF9D434BBB9F99B03D2AC921B6 Ref B: FRA231050411023 Ref C: 2023-10-12T09:31:25Z'
cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 12 Oct 2023 09:31:24 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"kind":"v12.0","properties":{"administratorLogin":"CloudSA97664ba1","version":"12.0","state":"Ready","fullyQualifiedDomainName":"xxxxxx.database.windows.net","privateEndpointConnections":[],"minimalTlsVersion":"1.2","publicNetworkAccess":"Enabled","administrators":{"administratorType":"ActiveDirectory","principalType":"Group","login":"Admins","sid":"xxxxxx","tenantId":"xxxxxx","azureADOnlyAuthentication":false},"restrictOutboundNetworkAccess":"Disabled","externalGovernanceStatus":"Disabled"},"location":"westeurope","tags":{},"id":"/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx","name":"xxxxxx","type":"Microsoft.Sql/servers"}
cli.azure.cli.command_modules.sql.custom: _find_db_sku_from_capabilities input: {'additional_properties': {}, 'name': 'Standard', 'tier': 'Standard', 'size': None, 'family': None, 'capacity': '10'}
cli.azure.cli.command_modules.sql.custom: _find_db_sku_from_capabilities return sku as is
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx/databases/database-2?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies: Request method: 'PUT'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies:     'Content-Length': '314'
cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'CommandName': 'sql db copy'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-group --server --name --dest-name --compute-model --service-objective --capacity --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.51.0 (DEB) azsdk-python-mgmt-sql/4.0.0b10 Python/3.10.10 (Linux-6.4.6-76060406-generic-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: {"location": "westeurope", "sku": {"name": "Standard", "tier": "Standard", "capacity": 10}, "properties": {"createMode": "Copy", "sourceDatabaseId": "/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx/databases/database-1"}}
urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/servers/xxxxxx/databases/database-2?api-version=2022-08-01-preview HTTP/1.1" 202 75
cli.azure.cli.core.sdk.policies: Response status: 202
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Content-Length': '75'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Location': 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/locations/westeurope/databaseOperationResults/xxxxxxxx?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies:     'Retry-After': '15'
cli.azure.cli.core.sdk.policies:     'Azure-AsyncOperation': 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/locations/westeurope/databaseAzureAsyncOperation/xxxxxxxx?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': 'ef426977-3b53-40b3-bd34-9274e2cd4006'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-writes': '1199'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': 'facb0994-d811-42f3-8839-7f52c0901d14'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENCENTRAL:20231012T093126Z:facb0994-d811-42f3-8839-7f52c0901d14'
cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies:     'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.sdk.policies:     'X-MSEdge-Ref': 'Ref A: 74F4436CCEDC4DF4BEF6A85F9F6BB3DA Ref B: FRA231050413023 Ref C: 2023-10-12T09:31:25Z'
cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 12 Oct 2023 09:31:26 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"operation":"CreateDatabaseAsCopy","startTime":"2023-10-12T08:35:24.157Z"}
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/locations/westeurope/databaseAzureAsyncOperation/xxxxxxxx?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'CommandName': 'sql db copy'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-group --server --name --dest-name --compute-model --service-objective --capacity --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.51.0 (DEB) azsdk-python-mgmt-sql/4.0.0b10 Python/3.10.10 (Linux-6.4.6-76060406-generic-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/locations/westeurope/databaseAzureAsyncOperation/xxxxxxxx?api-version=2022-08-01-preview HTTP/1.1" 200 108
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Content-Length': '108'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Retry-After': '15'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '65d65097-164c-4379-a6f7-49a34ea291fa'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11993'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '5ba98029-9424-4e04-9f52-384e484c21a3'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENCENTRAL:20231012T093127Z:5ba98029-9424-4e04-9f52-384e484c21a3'
cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies:     'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.sdk.policies:     'X-MSEdge-Ref': 'Ref A: 42E37945B3E646A8A1DB3B31B968EFB8 Ref B: FRA231050413023 Ref C: 2023-10-12T09:31:26Z'
cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 12 Oct 2023 09:31:26 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"name":"xxxxxxxx","status":"InProgress","startTime":"2023-10-12T08:35:24.157Z"}
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/locations/westeurope/databaseAzureAsyncOperation/xxxxxxxx?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'CommandName': 'sql db copy'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-group --server --name --dest-name --compute-model --service-objective --capacity --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.51.0 (DEB) azsdk-python-mgmt-sql/4.0.0b10 Python/3.10.10 (Linux-6.4.6-76060406-generic-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/locations/westeurope/databaseAzureAsyncOperation/xxxxxxxx?api-version=2022-08-01-preview HTTP/1.1" 200 108
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Content-Length': '108'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Retry-After': '15'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': 'f78469e8-192d-4755-a6fc-58834da4677f'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11996'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': 'f920d42d-f6d2-48e5-a0f9-d691bb04545e'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENCENTRAL:20231012T093142Z:f920d42d-f6d2-48e5-a0f9-d691bb04545e'
cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies:     'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 12 Oct 2023 09:31:41 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"name":"xxxxxxxx","status":"InProgress","startTime":"2023-10-12T08:35:24.157Z"}

..............

cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/locations/westeurope/databaseAzureAsyncOperation/xxxxxxxx?api-version=2022-08-01-preview'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'CommandName': 'sql db copy'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-group --server --name --dest-name --compute-model --service-objective --capacity --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.51.0 (DEB) azsdk-python-mgmt-sql/4.0.0b10 Python/3.10.10 (Linux-6.4.6-76060406-generic-x86_64-with-glibc2.35)'
cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Sql/locations/westeurope/databaseAzureAsyncOperation/xxxxxxxx?api-version=2022-08-01-preview HTTP/1.1" 200 108
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Content-Length': '108'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Retry-After': '15'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': 'ae37cbbb-d28f-4cd5-81d3-ea77bfa225f6'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11992'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': 'xxxxxx'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENCENTRAL:20231012T093415Z:xxxxxx'
cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies:     'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 12 Oct 2023 09:34:14 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"name":"xxxxxxxx","status":"InProgress","startTime":"2023-10-12T08:35:24.157Z"}

Expected behavior

The command should complete successfully and create a new database copy, or give an error.

Environment Summary

azure-cli 2.51.0 *

core 2.51.0 * telemetry 1.1.0

Dependencies: msal 1.24.0b1 azure-mgmt-resource 23.1.0b2

Python location '/opt/az/bin/python3' Extensions directory '/home/runsten/.azure/cliextensions'

Additional context

The debug output seems to just be polling status forever.

azure-client-tools-bot-prd[bot] commented 1 year ago

Hi @jrunestone,

2.51.0 is not the latest Azure CLI(2.53.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 1 year ago

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

jrunestone commented 1 year ago

As an update, I updated to the latest CLI and there was no change in my experience. The github scripts are also running the latest version of the CLI.

sam-orca commented 1 year ago

btw, I saw the issue using copy database api called using Golang as well. I have created a new bug request on Go lib here