Can't delete data in InfluxDB 2.0

On https://docs.influxdata.com/influxdb/v2.0/write-data/delete-data/ I read that the "--predicate flag is currently disabled", so I’m trying to delete data directly using the API.

Initially, I tried the following:

curl --request POST "http://192.168.0.31:8086/api/v2/delete/?org=test&bucket=loggerdownsampled" \                                                                                           
  --header 'Authorization: Token XXXXXXXX==' \
  --header 'Content-Type: application/json' \                                                                                                                                               
  --data '{                                                                                                                                                                                 
    "start": "1970-01-01T00:00:00.00Z",                                                                                                                                                       
    "stop": "2021-01-01T00:00:00.00Z",                                                                                                                                                        
    "predicate": "_measurement=\"KVMWIN10\""                                                                                                                                                  }'     

Nothing was deleted.

I also tried “measurement” (without the leading underscore) in the predicate, and eventually - as a test -I removed the predicate altogether. In none of the cases was any data deleted.
Another thing I noticed is that, as long as my token is correct, the server does not reply with any data. (not even an empty JSon response, but literally 0 bytes)

Am I correct in concluding that deleting data is not yet implemented in InfluxDB 2.0?

Edit: I’m using InfluxDB 2.0.0-rc.4 (git: 778b9ff9eb) build_date: 2020-11-10T05:19:31Z

Edit: It looks like InlfuxDB doesn’t evaluate the posted JSON data. The following does not return any error:

curl --request POST "http://192.168.0.31:8086/api/v2/delete/?org=test&bucket=loggerdownsampled" \                                                                                         
  --header 'Authorization: Token XXXXXXXXXXXXXXX==' \
  --header 'Content-Type: application/json' \ 
  --data 'This is certainly not valid JSON data'  

Regards,
Tom

Hello @twim,
It’s disabled with the API. That functionality wasn’t carried over yet in favor of supporting other functionalities to help migrate users.
It’s available with Cloud though and has just been added. https://github.com/influxdata/influxdb/issues/20237
Delete data from the bucket

1 Like

Delete functionality will be re-enabled in InfluxDB OSS 2.0.3 which should roll out some time next week.

2 Likes