Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

Unable to run redis export from CLI #30408

Open cesarqdt opened 4 days ago

cesarqdt commented 4 days ago

Describe the bug

The az redis export is completely broken and does not seem to work with any of the permissions assigned to a service principal. There are no errors for the operation, simply returning a (Conflict) without details as below:

(Conflict) : 
RequestID=7c77a3dc-1a2d-4c27-b7ef-c069269e65a8
Code: Conflict
Message: : 
RequestID=7c77a3dc-1a2d-4c27-b7ef-c069269e65a8

I created the SAS in the container giving a long time range (1 year), from any IP with the permissions of Read Write Delete and List. There are no errors displayed, the operation does not complete.

I can run an export of the data from Redis to the container in the storage account from the portal, both using the Key and the managed identities. But this does not work with the Azure CLI export command. The user that's running the az commands is Owner of Redis and Owner of Storage for the record.

The full command that I'm running in az redis export -n redis-cluster \ -g resourcegroupname \ --prefix redis-cluster/2024/11/25/00/00/00 \ --container "https://XXXXXX.blob.core.windows.net/redis-backups?sp=rwdl&st=2024-11-25T01:00:00Z&se=2025-11-25T13:00:00Z&sip=0.0.0.0&spr=https&sv=2022-11-02&sr=c&sig=xxxxxxx"

The Attached screenshot of the error: Image

Related command

az redis export -n redis-cluster \ -g resourcegroupname \ --prefix redis-cluster/2024/11/25/00/00/00 \ --container "https://XXXXXX.blob.core.windows.net/redis-backups?sp=rwdl&st=2024-11-25T01:00:00Z&se=2025-11-25T13:00:00Z&sip=0.0.0.0&spr=https&sv=2022-11-02&sr=c&sig=xxxxxxx"

Errors

(Conflict) : 
RequestID=7c77a3dc-1a2d-4c27-b7ef-c069269e65a8
Code: Conflict
Message: : 
RequestID=7c77a3dc-1a2d-4c27-b7ef-c069269e65a8

Issue script & Debug output

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': '02b16fea-aad8-11ef-8458-321c7f7226e1' cli.azure.cli.core.sdk.policies: 'CommandName': 'redis export' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-n -g --prefix --container --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.67.0 (HOMEBREW) azsdk-python-core/1.31.0 Python/3.12.7 (macOS-15.0.1-arm64-arm-64bit)' 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/9929674f-cd69-42d4-af13-4a24606ffe76/providers/Microsoft.Cache/locations/East%20US/operationresults/8b0e3f65-7c11-4e84-b8f1-8c6cbe23f142?api-version=2024-03-01&t=638680999156457867&c=MIIHhzCCBm-gAwIBAgITfAWHixR6wHSVKvzJqAAABYeLFDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTIyMTIwMzM3WhcNMjUwMzIxMTIwMzM3WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAODaneMH7bvpChlVJD14el3LT7kY0_mTgTGw27YN2egYyqVgr2JJ__4u4CemYBZA98CYLPGW-Cw8U161HayJliizFas4h0YURYj7miTJ_4qskZJzcIcr5Qn1N6hhGFRkk7L2J1hr9thlSqivZLSPWRw3k6zKUt4dNI1RH-zroOlIjZpIoH2vqCc617v-KkfKhKLvZ-mykBpOtM8hO9RT5EJmuZA474MIOIrEOuQhNalDdfyDdE2lRKKyOG1YGfHNsdRyN4oiTqxFQxuBxahDUNORAf8ZbQ_s6Y6NewgxOhw_yZm7aZrBDraDPJHwNI9Phy-kcYwtzigQxU1u7hQcu60CAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQ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o70U_7WYmLKfXUhRVgCGkWWKqCMBWeTNfTCsA&h=TUs8TubZSdcp0YOrqSRDNRdmqWPDg806NvBWaNY4e-s HTTP/1.1" 409 108 cli.azure.cli.core.sdk.policies: Response status: 409 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: 'x-ms-request-id': 'b40ff86c-860e-4902-8392-a818179f5b3e' cli.azure.cli.core.sdk.policies: 'x-rp-server-mvid': 'ad7004de-5893-4f30-ac1e-113f2615ab6f' 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-ms-ratelimit-remaining-subscription-reads': '249' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-global-reads': '3749' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '1273ffe2-c917-4099-9493-7424c6d72b23' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'BRAZILSOUTH:20241125T025226Z:1273ffe2-c917-4099-9493-7424c6d72b23' cli.azure.cli.core.sdk.policies: 'X-Cache': 'CONFIG_NOCACHE' cli.azure.cli.core.sdk.policies: 'X-MSEdge-Ref': 'Ref A: CBF5993F257E4F0AA70E3008E2CBF1A8 Ref B: RIO201060612033 Ref C: 2024-11-25T02:52:25Z' cli.azure.cli.core.sdk.policies: 'Date': 'Mon, 25 Nov 2024 02:52:25 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"Conflict","message":": \r\nRequestID=b40ff86c-860e-4902-8392-a818179f5b3e","target":null}} cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 757, in run self._poll() File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 786, in _poll self.update_status() File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 809, in update_status _raise_if_bad_http_status_and_method(self._pipeline_response.http_response) File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 156, in _raise_if_bad_http_status_and_method raise BadStatus("Invalid return status {!r} for {!r} operation".format(code, response.request.method)) azure.core.polling.base_polling.BadStatus: Invalid return status 409 for 'GET' operation

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute raise ex File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 733, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 714, in _run_job result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 1075, in call raise exception File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 1062, in call result = poller.result() ^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 251, in result self.wait(timeout) File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/tracing/decorator.py", line 94, in wrapper_use_tracer return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 270, in wait raise self._exception # type: ignore ^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 185, in _start self._polling_method.run() File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 761, in run raise HttpResponseError(response=self._pipeline_response.http_response, error=err) from err azure.core.exceptions.HttpResponseError: (Conflict) : RequestID=b40ff86c-860e-4902-8392-a818179f5b3e Code: Conflict Message: : RequestID=b40ff86c-860e-4902-8392-a818179f5b3e

cli.azure.cli.core.azclierror: (Conflict) : RequestID=b40ff86c-860e-4902-8392-a818179f5b3e Code: Conflict Message: : RequestID=b40ff86c-860e-4902-8392-a818179f5b3e az_command_data_logger: (Conflict) : RequestID=b40ff86c-860e-4902-8392-a818179f5b3e Code: Conflict Message: : RequestID=b40ff86c-860e-4902-8392-a818179f5b3e cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x10887a5c0>]



### Expected behavior

The command should run, or show an explanation of the error, and if run successfully, should export the data to the right container.

### Environment Summary

azure-cli                         2.67.0

core                              2.67.0
telemetry                          1.1.0

Extensions:
aks-preview                     13.0.0b2

Dependencies:
msal                              1.31.0
azure-mgmt-resource               23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/bin/python'
Extensions directory '/Users/cesar/.azure/cliextensions'

Python (Darwin) 3.12.7 (main, Oct  1 2024, 02:05:46) [Clang 16.0.0 (clang-1600.0.26.3)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

### Additional context

_No response_
yonzhan commented 4 days ago

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

microsoft-github-policy-service[bot] commented 4 days ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @shariq-mcs, @MSFTeegarden.