msgraph-sdk-go icon indicating copy to clipboard operation
msgraph-sdk-go copied to clipboard

`HTTP/1.x transport connection broken: malformed HTTP response`

Open AlessioC31 opened this issue 1 year ago • 4 comments

Hello,

Since a couple of days, when I execute something like err := client.UsersById(user).EventsById(eventID).Delete(context.Background(), nil) it happens that I receive an error with HTTP/1.x transport connection broken: malformed HTTP response. When this does not happen and err == nil, I still get Unsolicited response received on idle HTTP channel starting with "0\r\n\r\n"; err=<nil> in stdout and the event is deleted.

Am I doing something wrong or is something happening with MSGraph API? The error started appearing randomly, I haven't redeployed my application

AlessioC31 avatar Mar 01 '23 16:03 AlessioC31

We are making the same calls directly to the API using a http.Client and we are getting the same error:

Delete "https://graph.microsoft.com/v1.0/me/events/XXXXX?%24select=Id%2CSubject%2CBody%2CStart%2CEnd%2CIsAllDay%2CLocation%2CReminderMinutesBeforeStart": net/http: HTTP/1.x transport connection broken: malformed HTTP response "0"

Has the API changed? For context, these calls are made from an AWS ECS machine behind an AWS ALB, whose configuration hasn't been changed.

dumim avatar Mar 07 '23 23:03 dumim

Hi @dumim , @AlessioC31 , thanks for the extra information.

This issue looks like it's from the service and not an issue with the SDK itself. This repo is however dedicated to the SDK and not issues with the services. In such a case, the best thing to do is to post a question to Microsoft Q&A forums where members of the service teams are providing answers.

rkodev avatar Mar 08 '23 10:03 rkodev

@AlessioC31 @dumim Did you happen to file a ticket on the forum? Could you share a link to the discussion in case you did?

meain avatar Mar 24 '23 11:03 meain

@rkodev @baywet here is a very similar report from the Q&A forums - https://learn.microsoft.com/en-us/answers/questions/1184068/has-the-email-delete-message-endpoint-started-to-r

This implies that there is indeed a server issue that can break HTTP clients that make assumptions about what is returned with a 204.

While this is a server issue, it is creating real problems for us as users of the SDK as calls using the same client after a delete fail.

Is there anything that can be done in terms of defensive coding in the SDK to alleviate this issue? Alternatively do you have a suggestion how to work around it in the SDK.

gmatev avatar Mar 29 '23 05:03 gmatev

Hi @gmatev Were you able to find a work around for this problem. If not, I would suggest recreating the client when such an error occurs while the service team is still working on that issue. And if this is an idempotence endpoint , i.e DELETE , GET , PUT you can retry the endpoint.

rkodev avatar May 30 '24 09:05 rkodev

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.