Unable to create auth

Hello, I have a problem creating auth for new user.

Command line:

$ influx auth create -d test --user grafana --read-orgs
Error: could not write auth with provided arguments: 400 Bad Request: invalid json structure: id must have a length of 16 bytes

influxdb logs:

influxdb | ts=2021-09-10T14:45:13.859808Z lvl=debug msg=Request log_id=0WV_qyDW000 service=http method=GET host=influx path=/metrics query= proto=HTTP/1.1 status_code=200 response_size=2854 content_length=0 referrer= remote=10.10.20.13:53602 user_agent=Go-http-client took=3.751ms body=
influxdb | ts=2021-09-10T14:45:23.308231Z lvl=debug msg=“user find by ID” log_id=0WV_qyDW000 store=new took=0.066ms
influxdb | ts=2021-09-10T14:45:23.309071Z lvl=debug msg=“orgs find” log_id=0WV_qyDW000 store=new took=0.296ms
influxdb | ts=2021-09-10T14:45:23.309158Z lvl=debug msg=“Orgs retrieved” log_id=0WV_qyDW000 handler=org org=[0xc003b44d80]
influxdb | ts=2021-09-10T14:45:23.310218Z lvl=debug msg=Request log_id=0WV_qyDW000 service=http method=GET host=influx path=/api/v2/orgs query=“org=Home” proto=HTTP/1.1 status_code=200 response_size=699 content_length=0 referrer= remote=10.10.20.13:53602 user_agent=influx took=2.635ms body=
influxdb | ts=2021-09-10T14:45:23.314902Z lvl=debug msg=“user find by ID” log_id=0WV_qyDW000 store=new took=0.053ms
influxdb | ts=2021-09-10T14:45:23.315198Z lvl=debug msg=“users find” log_id=0WV_qyDW000 store=new took=0.124ms
influxdb | ts=2021-09-10T14:45:23.315260Z lvl=debug msg=“Users retrieved” log_id=0WV_qyDW000 handler=user users=[0xc00178e4c0]
influxdb | ts=2021-09-10T14:45:23.315881Z lvl=debug msg=Request log_id=0WV_qyDW000 service=http method=GET host=influx path=/api/v2/users query=“name=grafana” proto=HTTP/1.1 status_code=200 response_size=206 content_length=0 referrer= remote=10.10.20.13:53602 user_agent=Date took=1.519ms body=
influxdb | ts=2021-09-10T14:45:23.320606Z lvl=debug msg=“user find by ID” log_id=0WV_qyDW000 store=new took=0.077ms
influxdb | ts=2021-09-10T14:45:23.320918Z lvl=error msg=“api error encountered” log_id=0WV_qyDW000 error=“invalid json structure: id must have a length of 16 bytes”
influxdb | ts=2021-09-10T14:45:23.321199Z lvl=debug msg=Request log_id=0WV_qyDW000 service=http method=POST host=influx path=/api/v2/authorizations query= proto=HTTP/1.1 status_code=400 response_size=95 content_length=-1 referrer= remote=10.10.20.13:53602 user_agent=Sha took=1.371ms error=invalid error_code=invalid body="{“description”:“test”,“orgID”:“72c497b17f12d6ee”,“permissions”:[{“action”:“read”,“resource”:{“id”:"",“orgID”:“72c497b17f12d6ee”,“type”:“orgs”}}],“userID”:“081f85db9b952000”}\n"

Thank you.

Hello @apl,
Have you set up an InfluxDB CLI configuration already?

And what type of token did you use to create it? You have to use the UI to create an all-access token that enables you to create a CLI config that has permissions to create new tokens.

@apl if you were running with v2.1.0 of the influx CLI, there was a bug in auth create that caused empty resource IDs to incorrectly be sent in requests. It’s been fixed as of v2.1.1 of the CLI.

./influx auth create --org my_org_name --all-access
Error: could not write auth with provided arguments: 403 Forbidden: permission read:orgs/2d8226e2e09XXXX/instance is not allowed: read:orgs/2d8226e2e0929XXXX/instance is unauthorized

I am getting this while creating the token, need it so that I can use the influx config create further

Hello @Aakarshit_Agarwal,
Welcome!
To get your first token, you either have to setup through the UI or through the CLI.