influxdata / influxdata/influxdb-client-java

Problem query runs with beforeTime and afterTime, with exact time in minutes

Abierto
#565 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Java
Estrellas
477
Forks
129
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

  1. 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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en TasksApiImpl.java:501, donde TaskApi#getRuns aparece en el stack trace, e inspecciona la llamada relacionada en InfluxDbClientTest.java:459. Reproduce el caso en el que afterTime y beforeTime están en el mismo minuto exacto y, después, añade o actualiza una prueba de regresión que muestre que la solicitud devuelve runs sin una BadRequestException.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
api, backend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.