Installation of Influxdb fails

  • Platform information:
    • Hardware: RaspberryPi4
    • OS:openhabian
    • openHAB version: 4.2.2

When installing influxdb+Grafana fron openhabin-config menu 20/24 installation of influxdb fails. Log message:

Preparing to unpack .../influxdb_1.11.8-1_arm64.deb ...
useradd: invalid user ID '-m'
dpkg: error processing archive /var/cache/apt/archives/influxdb_1.11.8-1_arm64.deb (--unpack):
 new influxdb package pre-installation script subprocess returned error exit status 3

Can you please help me what´s the problem is and what i can do to install influxdb ?

Thanks

best regards

Martin

I think the package’s preinst script has a bug. It fails to create/add the user influxdb and because of this the package fails to be installed.

Manually create the influxdb user. Then try to install the package again.

Content of the preinst script uses:

...
DATA_DIR=/var/lib/influxdb

if ! id influxdb &>/dev/null; then
    useradd --system -u -m influxdb -s /bin/false -d "${data_dir}"
fi
....

I would assume that “${data_dir}” needs to be “${DATA_DIR}”

Thank you very much for the hint.

Creating the user manually did not work but i realized that the -u option of the useradd command needs a unique number which is missing in the preinst script.
The error message interpets the next -m option as the UID…

Where can i find the preinst script ? Would it be a good idea to insert a UID value there ?

Thanks

Martin

It is part of the deb package in the control.tar.gz file.
The row with !id influxdb checks if the user id exists. If it does not exist the useradd command will be called. Just manually add the user then install the package again. Which means you need to correct the wrong useradd command.

When the user exists I run into the next issue:

2024-11-20_21:55:35_CET [openHABian] Setting up InfluxDB service...
$ sed -i -e s|auth-enabled = true|# auth-enabled = false|g /etc/influxdb/influxdb.conf
sed: can't read /etc/influxdb/influxdb.conf: No such file or directory

The directory does not exist, why wasn´t it created ?

Did you run the installation with sudo resp. root privileges ?