influx-cli icon indicating copy to clipboard operation
influx-cli copied to clipboard

influx setup: Error: instance has already been set up

Open cmoulliard opened this issue 4 years ago • 9 comments

Issue

We cannot force the client to reset the influxdb config using this command

influx setup -f
Error: instance has already been set up

This is really weird as this problem still exists even if I remove, delete the files installed on macos using brew

brew uninstall influxdb-cli
brew uninstall influxdb
rm -rf /usr/local/etc/influxdb2
rm -rf ~/.influxdbv2

brew services restart influxdb

brew install influxdb-cli
brew install influxdb
influx setup -f
Error: instance has already been set up

Version: influxdb - 2.2.1

cmoulliard avatar Dec 03 '21 12:12 cmoulliard

You probably need to delete the files at /usr/local/var/lib/influxdb2. I believe the homebrew service creates a config file which stores the engine/metadata in that directory:

cat /usr/local/etc/influxdb2/config.yml | grep engine-path
engine-path: /usr/local/var/lib/influxdb2/engine

Also note that the -f option doesn't forcibly reset the instance. It just makes it so that there is not a confirmation required for setting up the instance if you pass parameters with the command...this would be useful for automated setup scripts.

williamhbaker avatar Dec 23 '21 18:12 williamhbaker

FWIW on my archlinux install, I had to use rm -rf /var/lib/private/influxdb as well to get back to a fresh new state.

andyinsf avatar Aug 07 '22 22:08 andyinsf

note: you have to restart the influxdb service after deleting the relevant files before you can continue with setup.

castis avatar Sep 03 '22 12:09 castis

I'm facing the same issue on Ubuntu 22.04.1 with InfluxDB 2.4.0 and Influx 2.4.0. Can someone provide a solution for this? I removed all files related to InfluxDB.

NilashishC avatar Sep 28 '22 13:09 NilashishC

Same here, with Ubuntu 22.04.1 and influxdb 2.6.1
I've stopped/removed all processes/files (roughly:

sudo systemctl stop influxdb
sudo apt remove influxdb2 influxdb2-cli
sudo apt autoclean && sudo apt autoremove
sudo rm -rf /var/lib/influxdb/
sudo rm -rf /var/log/influxdb/
sudo rm -rf /etc/influxdb/
sudo rm -rf ~/.influxdbv2
sudo apt-get install influxdb2
# do I need to start influx here? if so, sudo systemctl start influxdb
influx setup

Still getting "Error: instance has already been set up" It's interesting that the program "/usr/local/bin/influx" was not removed by all the apt remove business. It sure would be nice if it (/usr/local/bin/influx) told us why it thinks the instance is set up. I'm about ready to destroy the VM and start over.

omnipresense avatar Jan 14 '23 01:01 omnipresense

I've attempted to replicate this and haven't seen it. After you reinstall influxdb, what does your config specify as the path and what files are there?

As an aside, the package should be putting the executables in /usr/bin/ so I'm not sure why you had files in /usr/local/bin/.

jeffreyssmith2nd avatar Jan 17 '23 15:01 jeffreyssmith2nd

I had the same issue on M1 MacBook.

After brew uninstall influxdb in addition to:

If desired, remove them manually with rm -rf: rm -rf /opt/homebrew/etc/influxdb2

need also to remove: rm -rf /opt/homebrew/var/lib/influxdb2

igorkhalitov avatar Aug 14 '23 20:08 igorkhalitov

I too had the same problem on ubuntu 22.04. This problem is really weird and annoying.

I fixed this issue by deleting all directories and files related to influxdb2 as follows:

Remove influx dpkg --purge influxdb2 dpkg --purge influxdb2-cli find / -name influx* /etc/default/influxdb2 /var/cache/apt/archives/influxdb2_2.7.3-1_amd64.deb /var/cache/apt/archives/influxdb2-cli_2.7.3-1_amd64.deb

rm -rf /etc/default/influxdb2 rm -rf /var/cache/apt/archives/influxdb2_2.7.3-1_amd64.deb rm -rf /var/cache/apt/archives/influxdb2-cli_2.7.3-1_amd64.deb rm -rf ~/.influxdbv2/ rm -rf /var/lib/influxdb/

Run the influxdb2 systemctl start influxd.service

Initialize setup influx setup

jk602a avatar Nov 01 '23 02:11 jk602a

It's extremely weird that after apt purge influxdb2 and installing it again can not influx setup

Does that mean influxdb2 package is incorrectly built because it cannot be easily cleaned up from the OS ?

apt purge must definitely remove ~/.influxdb2/ , /var/lib/influxdb/ , /etc/default/influxdb2 , otherwise what's the point if the package can not be correctly uninstalled from the system?

AlexTaran avatar Sep 04 '24 15:09 AlexTaran