Discussion:
[influxdb] Unable to drop faulty measurement
Willem D'Haese
2017-02-09 17:35:13 UTC
Permalink
Hello,

I'm having issues dropping a mesaurement:

SHOW MEASUREMENTS
name: measurements
name
----
3ᅵfᅵ
brocade-interface
cpu
disk
diskio
interface
io
kernel
mem
net
netstat
ping
processes
swap
system


<Loading Image...>


What can I do to delete this 3ᅵfᅵ measurement?


Grtz


Willem
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/8abb5a14-bbcd-4420-84f8-f3883a12170b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Willem D'Haese
2017-02-09 22:30:16 UTC
Permalink
So I'm able to see different characters now, nut I'm still not able to
delete the measurement.

curl -u user:pass -G 'https://server:8086/query?pretty=true' --data-urlencode
"db=mydb" --data-urlencode "q=show measurements"
{
"results": [
{
"statement_id": 0,
"series": [
{
"name": "measurements",
"columns": [
"name"
],
"values": [
[
"\u00053\ufffdf\ufffd"
],
[
"brocade-interface"
],
[
"cpu"
],
[
"disk"
],
[
"diskio"
],
[
"interface"
],
[
"io"
],
[
"kernel"
],
[
"mem"
],
[
"net"
],
[
"netstat"
],
[
"ping"
],
[
"processes"
],
[
"swap"
],
[
"system"
]
]
}
]
}
]
}
DROP MEASUREMENT "\u00053\ufffdf\ufffd"
ERR: error parsing query: found \u, expected identifier at line 1, char 20


With curl:

--data-urlencode "q=drop measurement \u00053\ufffdf\ufffd"
{
"error": "error parsing query: found \\, expected identifier at line 1,
char 18"
}

--data-urlencode "q=drop measurement \\u00053\\ufffdf\\ufffd"
{
"error": "error parsing query: found \\, expected identifier at line 1,
char 18"
}

--data-urlencode "q=drop measurement \"u00053\\ufffdf\\ufffd\""
{
"error": "error parsing query: found \\u, expected identifier at line
1, char 26"
}

--data-urlencode "q=drop measurement \"u00053\ufffdf\ufffd\""
{
"error": "error parsing query: found \\u, expected identifier at line
1, char 26"
}

Tx for the help.

Willem
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/dc481392-214b-4cf5-9f6b-dbbcc81c740d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Willem D'Haese
2017-02-14 12:00:54 UTC
Permalink
When I execute with curl:

--data-urlencode $(python -c 'print(u"q=drop measurement
\u00053\ufffdf\ufffd")')
Traceback (most recent call last):
File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in
position 21: ordinal not in range(128)
curl: option --data-urlencode: requires parameter
curl: try 'curl --help' or 'curl --manual' for more information

When executed in cli on the InfluxDB server:

python -c 'print(u"q=drop measurement \u00053\ufffdf\ufffd")'
q=drop measurement 3ᅵfᅵ

The system is running on Centos 7. Not sure what to try next.
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/85cc5e36-b648-49a6-b92f-3055d9f2b768%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
n***@gmail.com
2018-03-26 15:31:06 UTC
Permalink
We have similar issue with having non-printables in tag value and I'd like to drop series with messed-up tag value.

I managed to work around the python exception:
$ q=$(python -c 'import sys; reload(sys); sys.setdefaultencoding("utf8"); print(u"show series where \"type\" = '\''c\ufffdient'\''")')
$ echo $q
show series where "type" = 'cï¿œient'

And then to look for these series:
$ influx -format json -pretty --database ... -execute "$q"
{
"results": [
{}
]
}

No luck.

Please let me know if you find out something.
--data-urlencode $(python -c 'print(u"q=drop measurement \u00053\ufffdf\ufffd")')
  File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 21: ordinal not in range(128)
curl: option --data-urlencode: requires parameter
curl: try 'curl --help' or 'curl --manual' for more information
python -c 'print(u"q=drop measurement \u00053\ufffdf\ufffd")'
q=drop measurement 3ᅵfᅵ
The system is running on Centos 7. Not sure what to try next.
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/0a79bb88-5d8f-410b-9740-ee63816bd4da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
n***@gmail.com
2018-03-26 15:44:20 UTC
Permalink
Also using plain bash printf (https://stackoverflow.com/questions/19938317/converting-escaped-characters-to-utf-8-in-bash) doesn't help:

$ echo "$(printf 'show series where \"type\" = '\''c\ufffdient'\''')"
show series where "type" = 'cï¿œient'

$ influx -format json -pretty --database ... -execute "$(printf 'show series where \"type\" = '\''c\ufffdient'\''')"
{
"results": [
{}
]
}

Not even using curl:
$ curl -G 'http://127.0.0.1:8086/query?pretty=true' --data-urlencode "db=..." --data-urlencode "q=$(printf 'show series where \"type\" = '\''c\ufffdient'\''')"
{
"results": [
{
"statement_id": 0
}
]
}
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/6edd3bdd-ed52-43fb-8a20-ce201f883753%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
n***@gmail.com
2018-03-26 17:09:11 UTC
Permalink
OK, I hacked around this.
drop series from my_measurement where "type" != 'client' AND "type" != "service"
Also I managed to drop the messed up measurement by dropping all series from it:

$ influx -format json -pretty --database ...
show series from /_r[^e]/
{
"results": [
{
"series": [
{
"columns": [
"key"
],
"values": [
[
"_rï¿œqueï¿œts,...redacted..."
],
[
"_rï¿œqueï¿œts,...redacted..."
]
]
}
]
}
]
}
drop series from /_r[^e]/
...
show series from /_r[^e]/
{
"results": [
{}
]
}

... also gone from show measurements output.

I explicitly tested the `drop series from /regexp/` command first on a test database as this used to be bugged - https://github.com/influxdata/influxdb/issues/4276 :

$ cat test.txt
# DDL
CREATE DATABASE test

# DML
# CONTEXT-DATABASE: test

bogus1,tag1=value1 value=1 1439856000
bogus2,tag2=value2 value=2 1439856000
unwanted_measurement,tag3=value3 value=3 1439856000

Import:

$ influx --database test -import -path=test.txt -precision=s
2018/03/26 18:34:01 Processed 1 commands
2018/03/26 18:34:01 Processed 3 inserts
2018/03/26 18:34:01 Failed 0 inserts

$ influx --database test
Connected to http://localhost:8086 version 1.2.0
InfluxDB shell version: 1.2.0
select * from /.*/
name: bogus1
time tag1 tag2 tag3 value
---- ---- ---- ---- -----
1439856000000000000 value1 1

name: bogus2
time tag1 tag2 tag3 value
---- ---- ---- ---- -----
1439856000000000000 value2 2

name: unwanted_measurement
time tag1 tag2 tag3 value
---- ---- ---- ---- -----
1439856000000000000 value3 3
SHOW SERIES FROM /unwanted/
key
---
unwanted_measurement,tag3=value3
DROP SERIES FROM /unwanted/
SHOW SERIES
key
---
bogus1,tag1=value1
bogus2,tag2=value2
show measurements
name: measurements
name
----
bogus1
bogus2


I hope this helps.
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/c67cfe0b-7983-4e54-bbe6-b7708c93409e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Avin
2018-07-18 19:49:44 UTC
Permalink
Hi Nemece,
I tried your steps but unfortunately didn't work for me.

One invalid measurement that have gotten created is as below.
java.lang.IndexOutOfBoundsException: Index: 0
"javax.servlet.ServletException: An external form was specified"

There are more similar invalid measurements that have gotten created, so
please advise how to get rid of this.

Thanks in advance
-Avin
Post by n***@gmail.com
OK, I hacked around this.
I managed to clean up the series with invalid tag value by explicitly
drop series from my_measurement where "type" != 'client' AND "type" !=
"service"
$ influx -format json -pretty --database ...
show series from /_r[^e]/
{
"results": [
{
"series": [
{
"columns": [
"key"
],
"values": [
[
"_rï¿œqueï¿œts,...redacted..."
],
[
"_rï¿œqueï¿œts,...redacted..."
]
]
}
]
}
]
}
drop series from /_r[^e]/
...
show series from /_r[^e]/
{
"results": [
{}
]
}
... also gone from show measurements output.
I explicitly tested the `drop series from /regexp/` command first on a
test database as this used to be bugged -
$ cat test.txt
# DDL
CREATE DATABASE test
# DML
# CONTEXT-DATABASE: test
bogus1,tag1=value1 value=1 1439856000
bogus2,tag2=value2 value=2 1439856000
unwanted_measurement,tag3=value3 value=3 1439856000
$ influx --database test -import -path=test.txt -precision=s
2018/03/26 18:34:01 Processed 1 commands
2018/03/26 18:34:01 Processed 3 inserts
2018/03/26 18:34:01 Failed 0 inserts
$ influx --database test
Connected to http://localhost:8086 version 1.2.0
InfluxDB shell version: 1.2.0
select * from /.*/
name: bogus1
time tag1 tag2 tag3 value
---- ---- ---- ---- -----
1439856000000000000 value1 1
name: bogus2
time tag1 tag2 tag3 value
---- ---- ---- ---- -----
1439856000000000000 value2 2
name: unwanted_measurement
time tag1 tag2 tag3 value
---- ---- ---- ---- -----
1439856000000000000 value3 3
SHOW SERIES FROM /unwanted/
key
---
unwanted_measurement,tag3=value3
DROP SERIES FROM /unwanted/
SHOW SERIES
key
---
bogus1,tag1=value1
bogus2,tag2=value2
show measurements
name: measurements
name
----
bogus1
bogus2
I hope this helps.
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/6728a36f-d813-4deb-82a6-4354aeb2e4b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...