Azure / go-autorest

This package implements an HTTP request pipeline suitable for use across multiple go-routines and provides the shared routines relied on by AutoRest generated Go code.

Home Page:https://github.com/Azure/autorest.go/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

204 not handled correctly for long-running operations

mikhailshilkov opened this issue · comments

I'm invoking this endpoint for private endpoint connections but it returns 204 (no content) and the invocation fails with an obscure "autorest/azure: error response cannot be parsed: "" error: EOF".

It's likely I miss some other resource that is required for the successful operation, but I'd love to see a more obvious message about what went wrong.

Is that a service bug or should the library handle this use case with a user-friendly error?

Request-response log:

PUT /subscriptions/sub/resourceGroups/rg83b5fa91/providers/Microsoft.DBforPostgreSQL/servers/server9087158b/privateEndpointConnections/pec?api-version=2018-06-01 HTTP/1.1
Content-Type: application/json; charset=utf-8
{"properties":{"privateLinkServiceConnectionState":{"description":"For private connectivity from Self-Hosted Pulumi Service.","status":"Approved"}}}

HTTP/1.1 204 No Content
Content-Length: 0

GET https://management.azure.com/subscriptions/sub/resourceGroups/rg83b5fa91/providers/Microsoft.DBforPostgreSQL/servers/server9087158b/privateEndpointConnections/pec?api-version=2018-06-01

HTTP/1.1 204 No Content
Content-Length: 0

GET https://management.azure.com/subscriptions/subresourceGroups/rg83b5fa91/providers/Microsoft.DBforPostgreSQL/servers/server9087158b/privateEndpointConnections/pec?api-version=2018-06-01

HTTP/1.1 204 No Content
Content-Length: 0