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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

IoTHub doesn't handle deletion correctly #2661

Open
tombuildsstuff opened this issue Mar 14, 2018 · 3 comments
Open

IoTHub doesn't handle deletion correctly #2661

tombuildsstuff opened this issue Mar 14, 2018 · 3 comments
Labels
IoTHub Service Attention This issue is responsible by Azure service team.

Comments

@tombuildsstuff
Copy link
Contributor

tombuildsstuff commented Mar 14, 2018

馃憢

Hey - so we've been working through this PR hashicorp/terraform-provider-azurerm#887 which adds support for IoTHubs to Terraform, via the Azure SDK for Go (v12.5.0-beta, but it appears this is also present in v14 / the latest, so I believe it to be a valid bug).

We're encountering a bug when attempting to delete the IoTHub that appears to be a bug in the Swagger; when deleting the IoTHub a long-running operation (LRO) is returned:

DELETE /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-devrg/providers/Microsoft.Devices/IotHubs/tom-iothub?api-version=2017-07-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.9.3 (amd64-darwin) go-autorest/8.0.0 Azure-SDK-For-Go/v12.5.0-beta services;HashiCorp-Terraform-v0.10.6
Authorization: Bearer REDACTED
Accept-Encoding: gzip

.. which initially returns a 200 OK:

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-HTTPAPI/2.0
x-ms-ratelimit-remaining-subscription-reads: 14963
x-ms-request-id: 6b3ef430-6462-4a81-b62b-c88bac788960
x-ms-correlation-request-id: 6b3ef430-6462-4a81-b62b-c88bac788960
x-ms-routing-request-id: CANADAEAST:20180314T212325Z:6b3ef430-6462-4a81-b62b-c88bac788960
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Date: Wed, 14 Mar 2018 21:23:24 GMT

{"status":"Running"}

.. and subsequently with a 404:

HTTP/1.1 404 Not Found
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
x-ms-failure-cause: gateway
x-ms-request-id: b02634b1-e845-40d9-8cf3-bcfcd12ac0e8
x-ms-correlation-request-id: b02634b1-e845-40d9-8cf3-bcfcd12ac0e8
x-ms-routing-request-id: CANADAEAST:20180314T212527Z:b02634b1-e845-40d9-8cf3-bcfcd12ac0e8
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Date: Wed, 14 Mar 2018 21:25:26 GMT
Content-Length: 149

{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Devices/IotHubs/tom-iothub' under resource group 'tom-devrg' was not found."}}

which should be detected by the SDK as a successfully deleted status code, however it continues polling until the timeout is reached in our case, an hour), at which point an error is thrown:

screen shot 2018-03-14 at 16 27 42

Would it be possible to fix the Swagger so the SDK can return successful when deleted?

Thanks!

@anuchandy
Copy link
Member

@akumardu can you please take a look or route this to right team

@tombuildsstuff
Copy link
Contributor Author

ping @akumardu :)

@JackTn JackTn added IoTHub Service Attention This issue is responsible by Azure service team. labels Jan 8, 2021
@ghost
Copy link

ghost commented Jan 8, 2021

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

Issue Details

馃憢

Hey - so we've been working through this PR hashicorp/terraform-provider-azurerm#887 which adds support for IoTHubs to Terraform, via the Azure SDK for Go (v12.5.0-beta, but it appears this is also present in v14 / the latest, so I believe it to be a valid bug).

We're encountering a bug when attempting to delete the IoTHub that appears to be a bug in the Swagger; when deleting the IoTHub a long-running operation (LRO) is returned:

DELETE /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-devrg/providers/Microsoft.Devices/IotHubs/tom-iothub?api-version=2017-07-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.9.3 (amd64-darwin) go-autorest/8.0.0 Azure-SDK-For-Go/v12.5.0-beta services;HashiCorp-Terraform-v0.10.6
Authorization: Bearer REDACTED
Accept-Encoding: gzip

.. which initially returns a 200 OK:

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-HTTPAPI/2.0
x-ms-ratelimit-remaining-subscription-reads: 14963
x-ms-request-id: 6b3ef430-6462-4a81-b62b-c88bac788960
x-ms-correlation-request-id: 6b3ef430-6462-4a81-b62b-c88bac788960
x-ms-routing-request-id: CANADAEAST:20180314T212325Z:6b3ef430-6462-4a81-b62b-c88bac788960
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Date: Wed, 14 Mar 2018 21:23:24 GMT

{"status":"Running"}

.. and subsequently with a 404:

HTTP/1.1 404 Not Found
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
x-ms-failure-cause: gateway
x-ms-request-id: b02634b1-e845-40d9-8cf3-bcfcd12ac0e8
x-ms-correlation-request-id: b02634b1-e845-40d9-8cf3-bcfcd12ac0e8
x-ms-routing-request-id: CANADAEAST:20180314T212527Z:b02634b1-e845-40d9-8cf3-bcfcd12ac0e8
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Date: Wed, 14 Mar 2018 21:25:26 GMT
Content-Length: 149

{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Devices/IotHubs/tom-iothub' under resource group 'tom-devrg' was not found."}}

which should be detected by the SDK as a successfully deleted status code, however it continues polling until the timeout is reached in our case, an hour), at which point an error is thrown:

screen shot 2018-03-14 at 16 27 42

Would it be possible to fix the Swagger so the SDK can return successful when deleted?

Thanks!

Author: tombuildsstuff
Assignees: akumardu
Labels:

IotHub, Service Attention

Milestone: -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IoTHub Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants