A few days ago, my system updated form influxdb-1.8.10 to influxdb-2.7.1 and everything seems to be screwed up. The influxes log is flooded with > Error: unknown shorthand flag: 'c' in -config > See 'influxd -h' for help and influxdb terminates immediately. I was unable to migrate my existing influx data, yet and neither telegraph nor other programs continue to work. Telegraf fails too: > # INFLUX_TOKEN='...' /usr/bin/telegraf -test -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d -once > 2023-06-06T16:01:36Z I! Starting Telegraf > 2023-06-06T16:01:36Z W! [outputs.influxdb] When writing to [http://localhost:8086]: database "telegraf" creation failed: 401 Unauthorized > 2023-06-06T16:01:37Z I! [agent] Hang on, flushing any cached metrics before shutdown > 2023-06-06T16:01:37Z E! [outputs.influxdb] When writing to [http://localhost:8086]: 401 Unauthorized > 2023-06-06T16:01:37Z E! [agent] Error writing to outputs.influxdb: could not write any address > 2023-06-06T16:01:37Z I! [agent] Stopping running outputs > 2023-06-06T16:01:37Z E! [telegraf] Error running agent: output plugins unable to send 76 metrics > # :-(
The influx CLI seems to be missing, but I cannot find a use flag to control, wether the CLI is built or not.
Influxdb 2.x introduces a lot of breaking changes. There is an official guide to migrate the DB from 1.x to 2.x here https://docs.influxdata.com/influxdb/v2.7/upgrade/v1-to-v2/. Also Influxdb removed the CLI from the repository and that's why it was not installed by the ebuild. I was searching if it have been moved and I found it was moved to https://github.com/influxdata/influx-cli/. Never tried telegraf but it seems that the current version on ::gentoo is pretty old (more than 2 years ago), maybe it doesn't support influxdb 2.x? When I can I will try to solve at least some of the issues (and add a warning about the potential incompatibility issues). For now probably it's better to keep using 1.x version until all the components you need are updated. Sorry for the inconvenience and thank you for the report.
I manually compiled influx-cli-2.7.3 and telegraf-1.26.3. With the new version of telegraf and after changing the config file to use the new database driver outputs.influxdb_v2, I finally got telegraph recording new samples. I still have to update my own code writing to influxdb. When I setup my system with influxdb, it was working almost on first try, so that I never really learned using influxdb. Now I am missing this knowledge for my transition to influxdb-2.x. :-(
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=220a7926c6592d853c854e1e5709b7971d90a97e commit 220a7926c6592d853c854e1e5709b7971d90a97e Author: William Hubbs <williamh@gentoo.org> AuthorDate: 2023-06-12 18:56:24 +0000 Commit: William Hubbs <williamh@gentoo.org> CommitDate: 2023-06-12 19:00:52 +0000 dev-db/influx-cli: new package, add 2.7.3 This is the command line interface for influxdb-2.x. Bug: https://bugs.gentoo.org/907954 Signed-off-by: William Hubbs <williamh@gentoo.org> dev-db/influx-cli/Manifest | 2 ++ dev-db/influx-cli/influx-cli-2.7.3.ebuild | 28 ++++++++++++++++++++++++++++ dev-db/influx-cli/metadata.xml | 10 ++++++++++ 3 files changed, 40 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a93a860ea862040216c5a4b6845a0fbfe0db926 commit 9a93a860ea862040216c5a4b6845a0fbfe0db926 Author: David Roman <davidroman96@gmail.com> AuthorDate: 2023-06-08 10:32:05 +0000 Commit: William Hubbs <williamh@gentoo.org> CommitDate: 2023-06-14 00:44:31 +0000 dev-db/influxdb: add instructions for upgrading db Closes: https://bugs.gentoo.org/907954 Closes: https://github.com/gentoo/gentoo/pull/31354 Signed-off-by: William Hubbs <williamh@gentoo.org> dev-db/influxdb/influxdb-2.7.1-r1.ebuild | 10 ++++++++++ 1 file changed, 10 insertions(+)
The /etc/init.d/influxdb-script still passes the -config-parameter to influxdb, which is not valid in influxdb version 2.x, anymore. > Error: unknown shorthand flag: 'c' in -config > See 'influxd -h' for help
Also, influx-db is missing the completions from David's PR.
(In reply to Sam James from comment #7) > Also, influx-db is missing the completions from David's PR. influx cli*