-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Add Instructions for Bring-your-own-InfluxDB with restricted access token #249
Comments
First thing to note: the Regarding the |
Ok, I changed to use web and collector images. Web container still not working, this is what I see in the logs:
The influxdb url is correct and the organization exists. Running InfluxDB v2.2.0 Why it cannot connect? |
That error message is in the influxdb client SDK/library, not code under my control. Weird, I'm not sure why it would be throwing an error, unless the Org doesnt exist, or the token doesnt have access to the Org. How did you create your token? is it namespaced to a different organization? |
Okey, I think I found my problem. In influxDB, I created a token for scrutiny with write/read permissions in scrutiny bucket and that did not work. Then, I tried with admin token and it worked, and I also noticed that it created three new buckets (monthly, weekly and yearly) so I created a new token with write/read permissions in all that buckets...but it did not worked again. So, it only works with admin token, not sure why need admin permission it needs, but I think it would be better if it is possible to scrutiny to only need permissions in scrutiny buckets and not admin permssions. |
@goliath888 Scrutiny also registers 3 background tasks for down-sampling. Can you check if that's the reason why it needs admin permissions? |
How can I check that? EDIT: The problem is that in influxDB I only can create two types of token:
So I cannot give some permissions one by one to try to find which one is the cause of not working. |
Looks like the UI is limited in which resources you can scope your token to. however it looks like the API allows you to add additional resource scopes. https://docs.influxdata.com/influxdb/cloud/api/#operation/PostAuthorizations |
After a few tries, I got it. The API Token needs read permission in "orgs" and "tasks". Maybe also write for tasks to create the task the first time, not sure of that. |
@goliath888 would you be willing to share your curl command/token auth payload? I'd like to add it to the troubleshooting guide. Thanks! |
Sure, not problem. I did it with postman, but adapting to curl should be easy (but a very long command): POST: Headers: Body:
In permissions you also need to add scrutiny, scrutiny_weekly, scrutiny-monthly and scrutiny_yearly read and write like this:
To make it easy, I just create a new api token from the UI for scrutiny. Then, get that with the api, copy all and make a new one token with the api and add the new permissions (I think you cannot edit the one you create, just create a new one and delete the older). I |
Thank you both @AnalogJ for the brilliant app - something that I was looking for and @goliath888 describing what you did to resolve the issue. I also faced the same thing with an existing influxdb instance. Followed the same process above, created the buckets and tasks using the admin token and scoped it down later with the above template. Not sure if we would want to expand the config more to support multiple buckets in the config file to help with the retention policies with
|
Let me reopen this issue (and rename it) to keep track of this request. |
…token for use with Scrutiny. - fixes #249
…token for use with Scrutiny. - fixes #249
Hey @theryecatcher @goliath888 @thvd I added steps in the InfluxDB troubleshooting guide that walk you though the steps to create a scope restricted InfluxDB API token for scrutiny. Can you take a look and test them if possible? |
Hi @AnalogJ, My previous token stop working, so I just tried following your steps and generate a new token and everything is working fine again ;) |
Awesome, that's great to hear. Yeah, I added the ability to "update" InfluxDB task scripts, which means that your existing token would have failed unless you gave it write permissions to the Glad to hear my instructions worked for you! |
I want to use my existing influxdb in the same server, but it is not working and I need some help.
This is my compose file:
This is my scrutiny.yaml file
I have configured a new bucket in my influxdb instance called scrutiny and a new API token with read and write permissions in that bucket.
In logs, there is this error:
It seems it cannot found my organization? The name is correct, I have other services working fine with that influxedb instance.
I am missing something?
The text was updated successfully, but these errors were encountered: