influxdata / influx-cli

CLI for managing resources in InfluxDB v2
MIT License
61 stars 23 forks source link

`influx replication delete` does not recognize the ID of the created replication stream and hence does not delete it #427

Closed shantanoo-desai closed 1 year ago

shantanoo-desai commented 1 year ago

Description

I am currently running some simple EDR (Edge Data Replication) tests on some industrial hardware and I am unable to delete a previously create replication stream

Environment

Problem reproduction

I am trying to replicate a simple bucket (where data for the CPU of the machine is stored in a bucket called data). The data is to be replicated from one industrial machine to another (both identical)

Steps

Add a remote machine information using:

influx remote create --name=mach2 \
--remote-url=http://192.30.4.108:8086 \
--remote-api-token=customAdminToken \
--remote-org-id=600acd40df42bc62

Create a one-to-one replication stream for the data bucket using:

influx replication create --name replicate-test \
--local-bucket d39b36cb709e70fd \
--remote-bucket-id bb2f8f90c40388c1 \
--remote-id 09b04dfc34efa000 

Verification of replication stream:

bash-5.1# influx replication ls
ID                      Name            Org ID                  Remote ID               Local Bucket ID         Remote Bucket ID        Current Queue Bytes     Max Queue Bytes Latest Status CodeDrop Non-Retryable Data
09b04e9ef83a1000        replicate-test  ec352e8449310565        09b04dfc34efa000        d39b36cb709e70fd        bb2f8f90c40388c1        1649                    67108860        204              false

The information is available in the dedicated bucket-id and the replication works well.

Trying to delete the created replication stream causes the problem:

influx replication delete --id 09b04e9ef83a1000 # ID from the above ls command

throws the following error:

Error: could not find replication stream with ID "09b04e9ef83a1000": 404 Not Found: replication not found

I am not sure why should I add information such as host, skip-verify in order to delete a stream that is uniquely identified by an ID.

Help options do not provide much information

bash-5.1# influx replication delete -h
NAME:
   influx replication delete - Delete an existing replication stream

USAGE:
   influx replication delete [command options] [arguments...]

COMMON OPTIONS:
   --host value                     HTTP address of InfluxDB [$INFLUX_HOST]
   --skip-verify                    Skip TLS certificate chain and host name verification [$INFLUX_SKIP_VERIFY]
   --configs-path value             Path to the influx CLI configurations [$INFLUX_CONFIGS_PATH]
   --active-config value, -c value  Config name to use for command [$INFLUX_ACTIVE_CONFIG]
   --http-debug                     
   --json                           Output data as JSON [$INFLUX_OUTPUT_JSON]
   --hide-headers                   Hide the table headers in output data [$INFLUX_HIDE_HEADERS]
   --token value, -t value          Token to authenticate request [$INFLUX_TOKEN]

OPTIONS:
   --id value, -i value  ID of the replication stream to be deleted

Any clarifications on deleting the stream might be helpful

shantanoo-desai commented 1 year ago

closing issue at the moment. If time permits I will go through the process again and re-open it if need be.