influxdata / influxdata/influxdb
'influx write' returns 'bad timestamp' with valid line protocol
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
When using `influx write` to write data to InfluxDB 2.0, it returns a `bad timestamp` error for valid line protocol. If you add the same line protocol through the UI, it works.
__Steps to reproduce:__
1. Run the following commands:
```sh
curl https://raw.githubusercontent.com/influxdata/influxdb2-sample-data/master/bird-migration-data/bird-migration.line --output ./tmp-data
influx write -b test-bucket @./tmp-data
```
__Expected behavior:__
I expect the data to write successfully.
__Actual behavior:__
It returned a `bad timestamp` error for each line of line protocol.
__Environment info:__
* System info: Darwin 19.3.0 x86_64
* InfluxDB version: InfluxDB dev (git: b0d459fccf) build_date: 2020-03-17T20:02:22Z
__Output example:__
```
': bad timestamp'migration,id=91823A,s2_cell_id=468e554 lat=61.3295,lon=24.6195 1560931200000000000
': bad timestamp'migration,id=91823A,s2_cell_id=468e554 lat=61.32967,lon=24.61917 1560974400000000000
': bad timestamp'migration,id=91823A,s2_cell_id=468e554 lat=61.32967,lon=24.61917 1561017600000000000
': bad timestamp'migration,id=91823A,s2_cell_id=468e554 lat=61.32967,lon=24.61917 1561039200000000000
': bad timestamp'migration,id=91823A,s2_cell_id=468e554 lat=61.33017,lon=24.62 1561060800000000000
': bad timestamp.migration,id=91823A,s2_cell_id=468e554 lat=61.33033,lon=24.61933 1561093200000000000
```
Contributor guide
Research direction
Start by downloading bird-migration.line to ./tmp-data and running the reported `influx write -b test-bucket @./tmp-data` command. Investigate the `influx write` entry point and compare its timestamp handling with the UI path. Done means the sample line protocol writes successfully without `bad timestamp` errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100