Reputation: 87
I am new to Influx and I have installed both InfluxDB and Influx CLI in my Linux Ubuntu 18.04 local environment.
bernardo@BDi-laptop:~$ influxd version
InfluxDB v1.8.10 (git: 1.8 688e697c51fd)
bernardo@BDi-laptop:~$ influx version
Influx CLI 2.3.0 (git: 88ba346) build_date: 2022-04-06T19:30:53Z
I have set up the CLI as indicated in the official instructions (https://docs.influxdata.com/influxdb/cloud/tools/influx-cli/):
bernardo@BDi-laptop:~$ influx config create --config-name local-config \
> --host-url http://localhost \
> --org pengon \
> --token secret-token \
> --active
Active Name URL Org
* local-config http://localhost pengon
I have loaded some simple test data in the database:
> SELECT * FROM periodic_measurements_test WHERE sensor_id='8';
name: periodic_measurements_test
time apartment_id metric mvalue original_db original_id room_id sens_id sensor_id
---- ------------ ------ ------ ----------- ----------- ------- ------- ---------
2021-01-11T07:00:00Z 69 3 5 1 1 77 8
2021-01-11T07:10:00Z 0 3 5 1 2 77 8
2021-01-11T07:20:00Z 69 3 5 1 3 0 8
2021-01-11T08:00:00Z 69 18 25 1 5 77 8
2021-01-11T08:10:00Z 69 20 25 1 6 77 8
2021-01-11T08:20:00Z 69 7 25 1 7 77 8
2021-01-11T08:30:00Z 69 4 25 1 8 77 8
2021-01-11T08:40:00Z 69 8 25 1 9 77 8
2021-01-11T09:00:00Z 69 150 25 1 10 77 8
2021-01-11T10:00:00Z 69 5 1 11 77 8
2021-01-11T10:10:00Z 69 5 1 12 77 8
When I am trying to list the buckets, I get an error:
bernardo@BDi-laptop:~$ influx bucket list
Error: failed to list buckets: 502 Bad Gateway:
unable to decode response content type "text/html"
The same happens when trying to create a bucket:
bernardo@BDi-laptop:~$ influx bucket create -n bucket1 -o pengon -r 52w
Error: failed to lookup org with name "pengon": 502 Bad Gateway:
unable to decode response content type "text/html"
Any hint what is wrong?
Thanks,
Bernardo
Upvotes: 0
Views: 1600
Reputation: 1639
InfluxDB version 1 and version 2 are not that compatible. I assume you intend to use InfluxDB version 2 as you are creating bucket and list bucket. However, the database server you are now using is v1.8 indicated by
bernardo@BDi-laptop:~$ influxd version
InfluxDB v1.8.10 (git: 1.8 688e697c51fd)
While your database client is v2.3 indicated by
bernardo@BDi-laptop:~$ influx version
Influx CLI 2.3.0 (git: 88ba346) build_date: 2022-04-06T19:30:53Z
You were trying to use client of v2.x to talk to server of v1.x and it will prompt you with unclear messages such as "502 Bad Gateway"
Could you uninstall the v1.8 from database server and install v2.X?
Upvotes: 2