Unable to execute influx CLI commands

Hi,

I installed influxdb-2.0.4 Docker version. It’s working fine when accessing it via UI (URL), but I can’t quey it via CLI.

i.e. executing a influx org list, I get the error below:

$ docker exec -it <container_id> influx org list
Error: Failed find orgs: attempted to unmarshal error as JSON but failed: "invalid character 'C' looking for beginning of value": Client sent an HTTP request to an HTTPS server.
Error: Attempted to unmarshal error as JSON but failed: "invalid character 'C' looking for beginning of value": Client sent an HTTP request to an HTTPS server.
See 'influx org list -h' for help

Any help would be appreciated,
Thanks

docker exec <CONTAINER_ID> influx org list -t YOUR_TOKEN

Hi @srbp ,
Yeah I tried passing the token, but I still get errors (below):

Error: Failed find orgs: attempted to unmarshal error as JSON but failed: "invalid character 'C' looking for beginning of value": Client sent an HTTP request to an HTTPS server.
Error: Attempted to unmarshal error as JSON but failed: "invalid character 'C' looking for beginning of value": Client sent an HTTP request to an HTTPS server.
See 'influx org list -h' for help

Indeed, by server runs over HTTPS, and I didn’t figure out why this message saying CLI sending it over HTTP.

list your config:

#influx config ls
Active Name URL Org

  •   default http://localhost:8086   foookin_paavel
    

update:
#influx config set -u ‘https://your_domain:8086’ --config-name default
Active Name URL Org

  •   default https://your_domain:8086  foookin_paavel
    

verify:
#influx config ls
Active Name URL Org

  •   default https://YOUR_DOMAIN:8086  foookin_paavel
    

#influx auth list
ID Description Token User Name User ID Permissions
12345 uuu Token ttt

should be ok for now, pavel

Hi Pavel,

I have the same problem and when i do influx config ls, it doesn’t even show anything - so nothing to update…

When i try to create a config with ‘influx config create --active -n default -u https://mydomain:8086’ , it asks for a token… ??

How do i fix this?

Koen

Okidoki - sorry, I figured it out.

See:

Where it says to create the config as I thought - But I only afterwards realised that the token was the token that i could find through the GUI.

Simple…

Koen

1 Like