influxdata / influxdata/influxdb-client-java

Escaping issue with tag values

オープン
#718 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
Java
スター
477
フォーク
129
PR マージ指標
30日以内にマージされた PR はありません

説明

This issue occurs in our case because a user has entered specific meta data fields as just `\`.
According to the Influx docs, `\` does not need to be escaped, but may be.
In our case, however, the backslash is followed with a comma, because it is at the end of the tag value, followed by another tag value, leading to messed up interpretation of the whole record.

In my opinion, the safest way to handle this is to _always_ escape backslashes.

__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.

1. Create as `List<>` with at least one tag containing just a backslash `\`
2. Write this list to InfluxDB using
`client.getWriteApiBlocking().writeMeasurements(WriteParameters.DEFAULT_WRITE_PRECISION, myList);`

__Expected behavior:__
Data would be inserted correctly.

__Actual behavior:__
Influx returns:
`HTTP status code: 400; Message: unable to parse 'metrics,account.companyName=\,account.contactCity=\ [...]`

__Specifications:__
- Client Version: 6.7.0
- InfluxDB Version: 3.7
- JDK Version: 17
- Platform: Linux/Docker/openjdk:17-alpine

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

client.getWriteApiBlocking().writeMeasurements(...) から開始し、バックスラッシュだけを含む tag 値の後に別の tag が続くケースで失敗を再現します。その measurement がリクエスト送信前にどのようにシリアライズされるかを追跡し、結果の record が InfluxDB に受け入れられることを確認して、このケースのカバレッジを追加します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。