[0.9.3] DROP SERIES fails with "database not open"
DROP SERIES FROM measurement WHERE tag filters gives error database not open in 0.9.0 stable
example:
curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb"
curl -i -XPOST 'http://localhost:8086/write?db=mydb' -d 'cpu,host=server01 value=0.64'
curl -G 'http://localhost:8086/query' --data-urlencode "db=mydb" --data-urlencode "q=drop series from cpu where host='server01'"
gives error: {"results":[{"error":"database not open"}]}
This appears to be related to it being a new database or a new series. I suspect there's a metadata race going on.
When I do the query against an established measurement it works fine:
name: slashy
------------
_key tag
slashy,tag=123\ 456 123 456
slashy,tag=123\,456 123,456
slashy,tag=123\\456 123\\456
> drop series from slashy where "tag" = '123 456'
> show series
name: slashy
------------
_key tag
slashy,tag=123\,456 123,456
slashy,tag=123\\456 123\\456
When I do it on a new measurement it fails:
> use mydb
Using database mydb
> insert cpu1,host=server01 value=0.64
> select * from cpu1
name: cpu1
tags: host=server01
time value
---- -----
2015-06-22T19:53:28.009594867Z 0.64
> drop series from cpu1 where host = 'server01'
ERR: database not open
Noticed similar issue.
If you start a continuous query that writes into a measurement, but then drop that measurement you get the same database not open error.
CREATE CONTINUOUS QUERY "10m_cpu_count" ON telegraf BEGIN SELECT count(value) INTO "telegraf"."default".idk FROM "telegraf"."default".cpu_user GROUP BY time(10m) END
> show measurements
name: measurements
------------------
name
cpu_idle
cpu_nice
cpu_system
cpu_user
disk_free
disk_inodes_free
disk_inodes_total
disk_inodes_used
disk_total
disk_used
idk
then
> drop measurement idk
ERR: database not open
but the measurement is actually gone
> show measurements
name: measurements
------------------
name
cpu_idle
cpu_nice
cpu_system
cpu_user
disk_free
disk_inodes_free
disk_inodes_total
disk_inodes_used
disk_total
disk_used
I have also experienced this when using influxdb 0.9.1 stable, restarting influxdb means I can drop series without error.
I confirm that I incurred in the same problem by creating a new series and deleting it straight away.
I'm on influxdb 0.9.1 installed via dpkg -i on ubuntu.
Happens also with DROP MEASUREMENT <name>.
I encountered the same issue in one of my projects while evaluating influxdb 0.9.1. Any idea when this could be fixed?
@mayudong07 it's currently scheduled for the upcoming release on August 13th, although it might not be in that release. If you are evaluating InfluxDB, please upgrade to the latest. 0.9.2 has substantial improvements over 0.9.1, and that will be true for each of the minor releases in the 0.9 line.
+1 for influx 0.9.2 - I tried to use it to truncate database in my unit tests.
@jacekgrzybowski for unit test truncation, DROP MEASUREMENT should work quite well.
For me it doesn't work with not-so-new series too.
I have series created 5 days ago and I'm not able to delete them.
@AlexeyDmitriev can you provide the output from the CLI or curl? Otherwise there's nothing useful for us in the report.
@beckettsean the error in CLI is exactly the same as was mentioned above.
ERR: database not open
@AlexeyDmitriev can you provide the full CLI session, showing the DROP SERIES command? I want to make sure there are no syntax issues, although it doesn't sound like there are.
Have you previously dropped and recreated the series?
+1
> use metrics
Using database metrics
> drop series where host='test_com'
ERR: database not open
influxdb version:0.9.3
Confirming that for any DROP SERIES command I now get ERR: database not open.
However, this appears to be fixed in 0.9.4:
> select * from lala
name: lala
----------
time a value z
2015-09-16T21:21:45.893405872Z b 12 b
2015-09-16T21:21:50.115252442Z b 12
> drop series where z = 'b'
> select * from lala
name: lala
----------
time a value
2015-09-16T21:21:50.115252442Z b 12
>
thanks ,i will try influxdb 0.9.4
still not working on 0.9.4.2
I have user:pass on my db. user have all the privileges.
/opt/influxdb/influx -username **** -password ****
Connected to http://localhost:8086 version 0.9.4.2
InfluxDB shell 0.9.4.2
> show databases;
> use dbname
Using database dbname
> DROP SERIES FROM measureme WHERE data='testdata'
ERR: database not open
>
@kaoruu does the database drop the series or is the error output all that happens?
hi @beckettsean based on the result, in CLI, it does not drop the series. As for the API, it does drop the series, but still show the "database not open". These errors do not show if there is no authentication based on my tests.
Hi,
+1
I just made a unit/integration test for the InfluxData.Net library and tested it with v0.9.6 and I'm getting the "database not open" error (the library uses the line protocol). In my case the series also does not get dropped. If I go to the web administration and try to drop, the same thing happens (this is actually logical because as far as I can see the administration also uses the line protocol). After I restart the daemon I can execute the drop and it responds with success.
Hi @beckettsean I am also facing the same issue on version 0.9.4 while creating a measurement and then deleting it, even after waiting for a more than minute to drop the measurement "database not open" error appears. Is this issue fixed in other versions?
It is deleting the measurement/series but still throwing the error.