Open russorat opened 3 years ago
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.
@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.
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:
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?
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?
@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:
Fix on hold until Telegraf Assistant work is addressed.
@kristinarobinson any idea of the status on this?
To repro:
expected behavior:
i tried to edit the telegraf config to have an explicit bucket instead of an env variable, but that didn't help either.