microsoftgraph / microsoftgraph/msgraph-sdk-java
com.microsoft.graph.models.odataerrors.ODataError exception when trying to create Subscription
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 444
- 派生
- 154
- 平均合并
- 18 小时 28 分钟
- 30 天内合并 PR
- 4
描述
Describe the bug
In our java springboot app we use the following dependency: https://mvnrepository.com/artifact/com.microsoft.graph/microsoft-graph/5.72.0 (also checked on https://mvnrepository.com/artifact/com.microsoft.graph/microsoft-graph/6.42.1)
When we try to create eventhub subscription for meeting room via that API we are getting error:
com.microsoft.graph.http.GraphServiceException: Error code: ExtensionError\nError message: Operation: Create; Exception: [Status Code: BadRequest; Reason: The value 'https://outlook.office365.com/api/v2.0/Users('Room_Sandbox%40company.com')/Events'of parameter 'Resource' is invalid.]\n\nPOST[https://graph.microsoft.com/v1.0/subscriptions\nSdkVersion] : graph-java/v5.72.0\nSdkVersion : graph-java/v5.72.0\n[...]\n\n400 : \n[...]\n\n[Some information was truncated for brevity, enable debug logging for more details]
Room_Sandbox%40company.com - I changed this here intentionally, in the original response there is a different email.
But the error is only for particular emails, not for all. Other emails work fine.
We've tried to update to the newest dependencies related to this api but till getting the same error.
Stack trace:
com.microsoft.graph.models.odataerrors.ODataError: Operation: Create; Exception: [Status Code: BadRequest; Reason: The value 'https://outlook.office365.com/api/v2.0/Users('Room_Sandbox%40company.com')/Events' of parameter 'Resource' is invalid.] at com.microsoft.graph.models.odataerrors.ODataError.createFromDiscriminatorValue(ODataError.java:36) at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:212) at com.microsoft.kiota.http.OkHttpRequestAdapter.lambda$throwIfFailedResponse$0(OkHttpRequestAdapter.java:704) at com.microsoft.kiota.ApiExceptionBuilder.<init>(ApiExceptionBuilder.java:26) at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:703) at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:307) at com.microsoft.graph.subscriptions.SubscriptionsRequestBuilder.post(SubscriptionsRequestBuilder.java:100) at com.microsoft.graph.subscriptions.SubscriptionsRequestBuilder.post(SubscriptionsRequestBuilder.java:84)
Expected behavior
The subscription should be created without errors.
How to reproduce
Try to create subscription for meeting room
SDK Version
6.42.1
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用 SDK 6.42.1 复现会议室订阅的创建,并将受影响的电子邮件与正常工作的电子邮件进行比较。检查 SubscriptionsRequestBuilder.post 以及报告的 GraphServiceException/ODataError 响应;当受影响会议室的订阅创建成功且没有无效 Resource 错误时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, spring-boot
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100