influxdata / influxdata/influxdb

Can't access or delete measurement names with \r.

Open
#19,440 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

I'm using InfluxDB 1.7.6-1
While running an automated code it accidentally created measurements with names '\r' and and '\r>'. I can neither delete them from InfluxDB CLI nor by using influxdb python module.
```
client.get_list_measurements()
[{u'name': u'\r'}, {u'name': u'\r>'}, {u'name': u'measurement1'}]
```

When I query measurements from InfluxDB Client I get this -
```
> show measurements
name: measurements
name
----

>
measurement1
```

It seems like \r is being internally processed by influxDB because \r is not visible when list measurements from InfluxDB CLI. I tried to delete the measurement and got this -
```
> delete from >
ERR: error parsing query: found >, expected identifier at line 1, char 15
> delete from "\r>"
ERR: error parsing query: found \r, expected identifier at line 1, char 17
> delete from "\\r>"
> delete from ">"
> delete from "\>"
ERR: error parsing query: found \>, expected identifier at line 1, char 17
> delete from "\\>"
> delete from "\\r >"
> delete from "\\r>"
> delete from "\r >"
ERR: error parsing query: found \r, expected identifier at line 1, char 17
```
I checked if the measurement got deleted after every command but it still exists.

I tried deleting them from python code but still failed.
```
client.drop_measurement("\r>")
Traceback (most recent call last):
File "", line 1, in
File "C:\Python36-32\lib\site-packages\influxdb\client.py", line 774, in drop_measurement
method="POST")
File "C:\Python36-32\lib\site-packages\influxdb\client.py", line 518, in query
expected_response_code=expected_response_code
File "C:\Python36-32\lib\site-packages\influxdb\client.py", line 369, in request
raise InfluxDBClientError(err_msg, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"error parsing query: found BADSTRING, expected identifier at line 1, char 17"}

client.drop_measurement('\\r>')
client.get_list_measurements()
[{u'name': u'\r'}, {u'name': u'\r>'}, {u'name': u'measurement1'}]

```

The same issue exists when I try to select those measurements

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the InfluxDB CLI and the Python client's get_list_measurements and drop_measurement calls, using measurement names containing carriage returns. Trace how those names are parsed in the query path; done means the affected measurements can be selected and deleted without parser errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.