Problem query runs with beforeTime and afterTime, with exact time in minutes
还没有人认领这个 Issue。
评估
调研方向
从 TasksApiImpl.java:501 开始,其中 TaskApi#getRuns 出现在堆栈跟踪中,并检查 InfluxDbClientTest.java:459 中相关的调用。复现 afterTime 和 beforeTime 恰好处于同一分钟的情况,然后添加或更新回归测试,以展示请求在没有 BadRequestException 的情况下返回 runs。
由索引模型根据 Issue 内容生成。
描述
When execute TaskApi#getRuns with beforeTime and afterTime on exact time in minutes, it throws BadRequestException and can not get result.
Steps to reproduce:
List the minimal actions needed to reproduce the behavior.
- Set afterTime and beforeTime, with exact time
OffsetDateTime afterTime = OffsetDateTime.parse("2023-05-20T10:15:00+09:00");
OffsetDateTime beforeTime = OffsetDateTime.parse("2023-05-20T11:15:00+09:00");
Integer limit = 100;
InfluxDBClient client = getClient();
client.getTasksApi().getRuns(task.getId(), afterTime, beforeTime, limit);
Expected behavior:
Returns the runs without error, executed between afterTime and beforeTime.
Actual behavior:
Got BadGrammerExeception.
The reason is, TaskApi#getRuns ( and InfluxDB itself) expects afterTime and beforeTime as strictly rfc3339 format, but parameter value type is OffsetDateTime which is ISO-8601 format. Therefore, it formats timestamp as ISO-8601 format omitting some part when the timestamp is exact minute time.
HTTP status code: 400; Message: failed to decode request: parsing time "2023-05-20T10:15+09:00" as "2006-01-02T15:04:05Z07:00": cannot parse "+09:00" as ":"
com.influxdb.exceptions.BadRequestException: HTTP status code: 400; Message: failed to decode request: parsing time "2023-05-20T10:15+09:00" as "2006-01-02T15:04:05Z07:00": cannot parse "+09:00" as ":"
at com.influxdb.internal.AbstractRestClient.responseToError(AbstractRestClient.java:113)
at com.influxdb.internal.AbstractRestClient.execute(AbstractRestClient.java:84)
at com.influxdb.client.internal.TasksApiImpl.getRuns(TasksApiImpl.java:501)
at jp.co.iim.collie.ui.common.repository.influxdb.InfluxDbClientTest.taskTest(InfluxDbClientTest.java:459)
Specifications:
- Client Version: 6.7.0
- InfluxDB Version: InfluxDB 2.1.1
- JDK Version: OpenJDK 1.8.0_281
- Platform: CentOS 7
- 主要语言
- Java
- 星标
- 477
- 派生
- 129
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
influxdata/influxdb-client-java 的其他 Issue
-
mTLS Support (Client Certificates)可能已有人在做 @NguyenHoangSon96 于 13 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 52/100
-
难度 4/5 3-5 天 新手友好度 45/100
influxdata/influxdb-client-java#849 · 4 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 35/100
influxdata/influxdb-client-java#830 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 38/100
查看 influxdata/influxdb-client-java 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
lugassawan/swe-workbench#799 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
Vakore/ZappierGames#89 ·
-
1.20.1-FORGE Module-Enhancement
难度 2/5 1-3 小时 新手友好度 65/100
MehVahdJukaar/WoodGood#1340 · 1 条评论 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
PssbleTrngle/dye_depot#123 ·
-
bug question
难度 2/5 1-3 小时 新手友好度 67/100