Skip to content
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

error generating telegraf token #577

Open
russorat opened this issue Jan 29, 2021 · 7 comments
Open

error generating telegraf token #577

russorat opened this issue Jan 29, 2021 · 7 comments
Labels
blocked there's nothing to do right now for this one and wont-fix doesn't capture the same spirit IceBox Old issues kind/bug Something isn't working regression team/dumplings More suited for the Dumplings squad of the UI team team/ui

Comments

@russorat
Copy link
Contributor

russorat commented Jan 29, 2021

To repro:

  1. in cloud, load this template through the UI: https://github.com/influxdata/community-templates/blob/master/raspberry-pi/raspberry-pi-system.yml
  2. then go to the telegrafs page and click "setup instructions" on the telegraf config
  3. Click generate token, and see the error message

expected behavior:

  1. if possible, generate the token and insert it into the script
  2. if not possible, provide a better error message letting the user know how to fix.

i tried to edit the telegraf config to have an explicit bucket instead of an env variable, but that didn't help either.

image

@russorat russorat added kind/bug Something isn't working team/ui regression labels Jan 29, 2021
@timhallinflux
Copy link
Contributor

timhallinflux commented Jan 29, 2021

Error message could be enriched to highlight the specific problem. Currently, it is too generic to figure out how to resolve or even where to look.

@jrenee42
Copy link
Contributor

jrenee42 commented Jan 29, 2021

@timhallinflux i'm looking at it now.
the bucket for that template is not there at all. it's an NPE on the bucket. i will definitely enrich the error message;
and look at the template config right now.

@timhallinflux
Copy link
Contributor

yeah...when the template is imported, it is using an environment variable to pick-up the bucket.

However, we recently introduced a capability to edit the telegraf config from the UI. I edited the config to supply the specific bucket that I wanted to use.

I think there are potentially a few possible scenarios here to address that, but open to collaborating on the options further:

  1. if there is no bucket specified (like in this case) -- when the setup instructions pop up, allow the user to select the desired bucket and ensure the config (and UI) gets updated with the selected bucket. We actually ask the use to select the bucket in the "create Telegraf config" workflow:
    Screen Shot 2021-01-29 at 11 12 59 AM

  2. if the user manually edits the Telegraf config and changes the bucket, we need to check to see if that is indeed a valid bucket when they go to save the config, if it isn't... we shouldn't allow it. A nice to have would be to pop-up the bucket selector at that point and ask which one they really want?

  3. upon template import, force the user to resolve the bucket if it's a variable.... essentially at time of import, check the telegraf config resources to see if there is a defined bucket and prompt the user to replace that env_var with a valid value?

@russorat other thoughts?

@kristinarobinson
Copy link
Contributor

For scenario #1, where no bucket is specified AT ALL, that's a template configuration (.yml) file issue. Best practices for templates are to use an environment variable for the telegraf config file when variables are used in dashboards. I ran into this when developing the community template for Air Quality. @mhall119 can verify.

For scenario #2, this is an issue that @ssoroka has mentioned as a known problem with editable config files for telegraf. @ssoroka recommends that wide open config files be replaced with "forms" that allow only certain, defined values which can be validated. Trying to implement this in its current form would be difficult.

For scenario #3, again, this is a .yml file issue. NO variables should be used in the telegraf config file. A bucket should be defined in the telegraf config file as either hard-coded or an environment variable. There's no way to enforce that in the current paradigm unless we enforce it at the time that the community template is created. @mhall119, any comments?

@kristinarobinson
Copy link
Contributor

@russorat and @mhall119 --would popping up the same panel as the Generate button in Tokens tab be sufficient? That panel allows you to specify buckets or ALL buckets for an ALL ACCESS token. Here's the panel:

Screen Shot 2021-01-29 at 4 00 02 PM

@kristinarobinson
Copy link
Contributor

Fix on hold until Telegraf Assistant work is addressed.

@drdelambre drdelambre added the blocked there's nothing to do right now for this one and wont-fix doesn't capture the same spirit label Mar 3, 2021
@kristinarobinson kristinarobinson added the team/dumplings More suited for the Dumplings squad of the UI team label Jun 11, 2021
@jzahnd
Copy link

jzahnd commented Feb 1, 2022

@kristinarobinson any idea of the status on this?

@kristinarobinson kristinarobinson added the IceBox Old issues label Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked there's nothing to do right now for this one and wont-fix doesn't capture the same spirit IceBox Old issues kind/bug Something isn't working regression team/dumplings More suited for the Dumplings squad of the UI team team/ui
Projects
None yet
Development

No branches or pull requests

6 participants