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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphClient me().events().byEventid(...) throws RuntimeException on unexpected request response type text/html #2234

Open
etcoyvindf opened this issue Nov 25, 2024 · 0 comments
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@etcoyvindf
Copy link

Describe the bug

We run an outlook calendar integration through Graph API, using msgraph-sdk-java.

When syncing calendar items to our internal DB we fetch an existing event with code:
graphClient.me().events().byEventId(id).get(rc -> addStandardOutlookRequestHeaders(rc.headers));

Today, we experienced some issues, possibly related to MS365 Issue ID MO941162. See stacktrace below

Expected behavior

Unexpected response from the API should be handled by the SDK properly and not throw a raw RuntimeException.
Other errors throw a kiota ApiException which might be fitting here

How to reproduce

Since the issue seems to be intermittent, we have not been able to reproduce it. Possibly setting up a proxy server that returns html instead of JSON might provoke the same behaviour.

SDK Version

6.20.0

Latest version known to work for scenario above?

6.20.0

Known Workarounds

Catch and parse exception message and retry the request.

Debug output

Click to expand log ``` The request above resulted in the following stacktrace:

java.lang.RuntimeException: Content type text/html does not have a factory to be parsed
at com.microsoft.kiota.serialization.ParseNodeFactoryRegistry.getParseNode(ParseNodeFactoryRegistry.java:56)
at com.microsoft.kiota.http.OkHttpRequestAdapter.getRootParseNode(OkHttpRequestAdapter.java:582)
at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:649)
at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:280)
at com.microsoft.graph.users.item.events.item.EventItemRequestBuilder.get(EventItemRequestBuilder.java:176)
... internal code stack here

</details>


### Configuration

Linux: x64
Java 21

### Other information

_No response_
@etcoyvindf etcoyvindf added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

1 participant