Influxdb: Drop database will delete /influxdb/data directory

Created on 11 Jan 2017  路  2Comments  路  Source: influxdata/influxdb

Bug report

__System info:__ InfluxDB v1.1.0 (downloaded, not built), Ubuntu 15.04 64-bit Intel

__Steps to reproduce:__

  1. Startup InfluxDB and create a database.
    curl -XPOST "http://influxdb:8086/query" --data-urlencode "q=CREATE DATABASE \"Test1\""

  2. Add content to create measurement.
    curl -XPOST 'http://influxdb:8086/write?db=Test1' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'
    You should see the /var/lib/influxdb/data directory with Test1 and _internal sub-directories.

  3. Execute 'DROP DATABASE' without a name specifically like the following:
    curl -XPOST "http://influxdb:8086/query" --data-urlencode "q=DROP DATABASE \"\""
    No error is returned or logged but the entire /var/lib/influxdb/data is gone (including _internal).

__Expected behavior:__ Return an error if no database name is provided.

__Actual behavior:__ Deleted the entire /influxdb/data directory.

The DROP DATABASE with no name was a bug in my code where a null name got through but the consequences are pretty bad since all the data files are gone. The system worked ok for a couple days until influxdb was restarted of course. Errors about missing files started appearing only in the logs a few seconds after the drop.

kinbug

Most helpful comment

I would be afraid to try that.

All 2 comments

Is it possible to drop database called ../../ ?:)

I would be afraid to try that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

allenbunny picture allenbunny  路  3Comments

airyland picture airyland  路  3Comments

deepujain picture deepujain  路  3Comments

ricco24 picture ricco24  路  3Comments

dandv picture dandv  路  3Comments