Create user fail with "Error: Write:users is unauthorized."

Hello, I create Token via root user in UI and it have user-root read / write access permissions but i use it command for create user i found

Error: Write:users is unauthorized.

so how fix it ?

influx user create -n "new-user" -p "new-password" --org-id "d3fc5e232d22151d" -t "......" --host "http://<IP>:8086" 

Any body has some problem ?

I can replicate it with influxdb:

version=2.0.7 commit=2a45f0c037 build_date=2021-06-04T19:17:40Z

and influx cli:

Influx CLI 2.0.7 (git: 2a45f0c037) build_date: 2021-06-04T19:17:40Z

Not sure what is the cause, but if you take a look at tokens Summary of access permissions for users permissions you should see something like “users-” while for the main token you get just “users”, the same is true for “orgs”.

Maybe this has something to do with the error.

@Sonthaya_Nongnuch I believe this is a bug/limitation in the authorizations API of InfluxDB. The API allows granting permissions within an organization. This doesn’t work for write-user because users are created/scoped outside of any orgs (so they can belong to multiple orggs).

There are ongoing discussions within the team for how best to address this problem. In the meantime, the only way around it is to use the super-user token generated by influx setup or influx upgrade to create new users.

I had the same problem. You probably have two or more orgs. The admin user of the main org, the one which is set up during the influx installation can add/remove users. You should use its token instead.