question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Python.Azure] LRO delete failed with exception

See original GitHub issue

I was using a LRO delete method from Azure Python SDK for IoT Hub. An exception was thrown when polling the status of the operation status. Not sure whether this error is related to Azure Python SDK or msrest. Could someone help take a look? Thanks!

Also I have a question regarding what is the correct behavior of LRO delete method. After the resource is deleted completely, the status link will return 404 (in the case of IoT Hub). But looks like 404 is not handled right now.

Paste msrest logging as below for your reference. I’ve removed subscription related information. BTW, I am using msrestazure-0.4.4, but the version is not updated in the package. So the agent info is showing msrest_azure/0.4.3.

msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxxxx/resourceGroups/iot-sample-kevinzha/providers/Microsoft.Devices/IotHubs/kevinzha-iot-hub?api-version=2016-02-03'
msrest.http_logger : Request method: 'DELETE'
msrest.http_logger : Request headers:
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'User-Agent': 'python/3.5.0 (Windows-10.0.14393) requests/2.11.1 msrest/0.4.4 msrest_azure/0.4.3 iothubclient/0.1.0 Azure-SDK-For-Python AZURECLI/0.1.0b7'
msrest.http_logger :     'Authorization': 'Bearer xxxxxxxxxx'
msrest.http_logger :     'CommandName': 'iot hub delete'
msrest.http_logger :     'x-ms-client-request-id': 'xxxxxxxxxx'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger :     'Content-Length': '0'
msrest.http_logger : Request body:
msrest.http_logger : None
requests.packages.urllib3.connectionpool : "DELETE /subscriptions/xxxxxxxxxx/resourceGroups/iot-sample-kevinzha/providers/Microsoft.Devices/IotHubs/kevinzha-iot-hub?api-version=2016-02-03 HTTP/1.1" 202 4
msrest.pipeline : Received status: 202 for method 'DELETE'
msrest.pipeline : Is forced retry: False
msrest.http_logger : Response status: 202
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Content-Length': '4'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Location': 'https://management.azure.com/subscriptions/xxxxxxxxxx/resourceGroups/iot-sample-kevinzha/providers/Microsoft.Devices/IotHubs/kevinzha-iot-hub/operationResults/NWM2MDU1NzMtNzMxOS00ODc5LTk0NWYtYTIyYzU2MTg5Mzcz?api-version=2016-02-03'
msrest.http_logger :     'Retry-After': '15'
msrest.http_logger :     'Azure-AsyncOperation': 'https://management.azure.com/subscriptions/xxxxxxxxxx/resourceGroups/iot-sample-kevinzha/providers/Microsoft.Devices/IotHubs/kevinzha-iot-hub/operationResults/NWM2MDU1NzMtNzMxOS00ODc5LTk0NWYtYTIyYzU2MTg5Mzcz?api-version=2016-02-03&asyncinfo'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-writes': '1198'
msrest.http_logger :     'x-ms-request-id': 'xxxxxxxxxx'
msrest.http_logger :     'x-ms-correlation-request-id': 'xxxxxxxxxx'
msrest.http_logger :     'x-ms-routing-request-id': 'JAPANEAST:20161024T024101Z:xxxxxxxxxx'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'Date': 'Mon, 24 Oct 2016 02:41:01 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'null'
...
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxxxx/resourceGroups/iot-sample-kevinzha/providers/Microsoft.Devices/IotHubs/kevinzha-iot-hub/operationResults/NWM2MDU1NzMtNzMxOS00ODc5LTk0NWYtYTIyYzU2MTg5Mzcz?api-version=2016-02-03&asyncinfo'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'User-Agent': 'python/3.5.0 (Windows-10.0.14393) requests/2.11.1 msrest/0.4.4 msrest_azure/0.4.3 iothubclient/0.1.0 Azure-SDK-For-Python AZURECLI/0.1.0b7'
msrest.http_logger :     'Authorization': 'Bearer xxxxxxxxxx'
msrest.http_logger :     'CommandName': 'iot hub delete'
msrest.http_logger :     'x-ms-client-request-id': 'xxxxxxxxxx'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
requests.packages.urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
requests.packages.urllib3.connectionpool : "GET /subscriptions/xxxxxxxxxx/resourceGroups/iot-sample-kevinzha/providers/Microsoft.Devices/IotHubs/kevinzha-iot-hub/operationResults/NWM2MDU1NzMtNzMxOS00ODc5LTk0NWYtYTIyYzU2MTg5Mzcz?api-version=2016-02-03&asyncinfo HTTP/1.1" 200 None
msrest.pipeline : Received status: 200 for method 'GET'
msrest.pipeline : Is forced retry: False
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14997'
msrest.http_logger :     'x-ms-request-id': 'xxxxxxxxxx'
msrest.http_logger :     'x-ms-correlation-request-id': 'xxxxxxxxxx'
msrest.http_logger :     'x-ms-routing-request-id': 'JAPANEAST:20161024T024118Z:xxxxxxxxxx'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'Date': 'Mon, 24 Oct 2016 02:41:18 GMT'
msrest.http_logger : Response content:
msrest.http_logger : Body contains chunked data.
msrest.exceptions : Unknown error

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
xscriptcommented, Dec 26, 2016

Fixed by PR https://github.com/Azure/azure-rest-api-specs/pull/593 . Thanks everyone on this thread!

0reactions
xscriptcommented, Nov 9, 2016

Any update?

Read more comments on GitHub >

github_iconTop Results From Across the Web

BackupInstancesOperations Class
Sync backup instance again in case of failure This action will retry last failed operation and will bring backup instance to valid state....
Read more >
azure-sdk-for-python/database_management.py at main
This repository is for active development of the Azure SDK for Python. For consumers of the SDK ... Delete a Database given its...
Read more >
Solved: User Delete - not licensed by user error
Our code for deleting inactive users on AGOL is failing on the user.delete() command after upgrade to Pro 2.7.0 using the python api...
Read more >
Fail to retrieve package from pypi.org though Azure Artifacts ...
Hello,. I am trying to install the pypi package using Artifacts on Azure DevOps 2019 Update1.1. The package cannot be retrieved due to...
Read more >
How to import Azure BlobService in python?
foo = azure.storage.BlobService(...) But that received the following error: AttributeError: 'module' object has no ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found