influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

[0.9.3] DROP SERIES fails with "database not open"

Open sonneym opened this issue 11 years ago • 21 comments

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"}]}

sonneym avatar Jun 22 '15 18:06 sonneym

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

beckettsean avatar Jun 22 '15 19:06 beckettsean

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

desa avatar Jun 26 '15 00:06 desa

I have also experienced this when using influxdb 0.9.1 stable, restarting influxdb means I can drop series without error.

roobert avatar Jul 09 '15 13:07 roobert

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>.

nemesifier avatar Jul 14 '15 17:07 nemesifier

I encountered the same issue in one of my projects while evaluating influxdb 0.9.1. Any idea when this could be fixed?

ustaros-ai avatar Aug 03 '15 19:08 ustaros-ai

@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.

beckettsean avatar Aug 03 '15 19:08 beckettsean

+1 for influx 0.9.2 - I tried to use it to truncate database in my unit tests.

jacek213 avatar Aug 04 '15 14:08 jacek213

@jacekgrzybowski for unit test truncation, DROP MEASUREMENT should work quite well.

beckettsean avatar Aug 04 '15 18:08 beckettsean

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 avatar Sep 14 '15 12:09 AlexeyDmitriev

@AlexeyDmitriev can you provide the output from the CLI or curl? Otherwise there's nothing useful for us in the report.

beckettsean avatar Sep 14 '15 18:09 beckettsean

@beckettsean the error in CLI is exactly the same as was mentioned above.

ERR: database not open

AlexeyDmitriev avatar Sep 15 '15 10:09 AlexeyDmitriev

@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?

beckettsean avatar Sep 15 '15 21:09 beckettsean

+1

> use metrics
Using database metrics
> drop series  where host='test_com'
ERR: database not open

influxdb version:0.9.3

wyzssw avatar Sep 16 '15 13:09 wyzssw

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

> 

beckettsean avatar Sep 16 '15 21:09 beckettsean

thanks ,i will try influxdb 0.9.4

wyzssw avatar Sep 19 '15 02:09 wyzssw

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 avatar Nov 19 '15 05:11 kaoruu

@kaoruu does the database drop the series or is the error output all that happens?

beckettsean avatar Nov 19 '15 20:11 beckettsean

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.

kaoruu avatar Nov 21 '15 08:11 kaoruu

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.

tihomir-kit avatar Jan 09 '16 22:01 tihomir-kit

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.

goyalr41 avatar Jan 13 '16 11:01 goyalr41