microsoftgraph / msgraph-sdk-java

Microsoft Graph SDK for Java
https://docs.microsoft.com/en-us/graph/sdks/sdks-overview
MIT License
353 stars 128 forks source link

Empty payload exception when creating meeting with sdk 6.7.0 #1972

Open slowcar opened 2 weeks ago

slowcar commented 2 weeks ago

I try to create a meeting using the graph sdk 6.7.0 on Android

Expected behavior

A meeting is created

Actual behavior

An ODataError is returned: Empty Payload. JSON content expected.

The log shows the body that is being sent and a content-length header of 506, but also logs "0-byte body":

`GraphService - --> POST https://graph.microsoft.com/v1.0/users/xxx/calendars/xxx/events

GraphService - Content-Length: 506 GraphService - authorization: Bearer xxx GraphService - accept: application/json GraphService - content-type: application/json GraphService - SdkVersion: graph-java, graph-java-core/3.1.9 (featureUsage=1203; android/29) GraphService - client-request-id: 69289c71-2a09-41f7-a505-9872e6705c5a GraphService - User-Agent: kiota-java/1.1.1 GraphService - GraphService - {"changeKey":null,"id":null,"@odata.type":"#microsoft.graph.event","attendees":[],"body":{"content":"","contentType":"html"},"end":{"dateTime":"2024-04-29T10:00:00.000","timeZone":"W. Europe Standard Time"},"isAllDay":false,"isOnlineMeeting":true,"isReminderOn":true,"location":{"displayName":"Microsoft Teams"},"onlineMeetingProvider":"teamsForBusiness","reminderMinutesBeforeStart":15,"showAs":"busy","start":{"dateTime":"2024-04-29T09:00:00.000","timeZone":"W. Europe Standard Time"},"subject":"onlein"} GraphService - --> END POST (0-byte body)`

Steps to reproduce the behavior

create a meeting with graph sdk (on android?)

Ndiritu commented 2 weeks ago

@slowcar did this work in previous versions of the SDK? Do other POST requests fail? Would you mind sharing a code sample?

slowcar commented 2 weeks ago

no, downgrading to 6.6 or 6.4 did not resolve the issue. our production build is still on 5.8.0 due to the number of issues we had with 6.x so far. The request works with 5.8.0.

The request is fairly simple, with email and folderId being set by parameters: Event createdEvent = graphClient.users().byUserId(email).calendars().byCalendarId(folderId).events().post(event);

We only use graph for online meetings with a meeting provider, for everything else we are still using EWS.

slowcar commented 1 week ago

Just saw that i reported the issue before and it was marked as fixed with a kiota update https://github.com/microsoftgraph/msgraph-sdk-java/issues/1872