Problem with import package in flux / chronograf

I’m trying to import a package within the Flux plugin on chronograf.
Actually, I’m just interested in using “date” package.
For that, I put the following statement at the beginning of the query:

import "date"

However, an error occurs when running the query saying the import path “date” is unknown.
The same happens for the “math” package.
What is even stranger is the fact to be able to use math directly without import.
But this doesn’t hold for “date” package…
I failed to find any information about this behavior on internet.

@gaetan_wuilloud What version of InfluxDB/Flux are you using?

Hello,

We are using 1.7.9 for influxDb But I do not know which version we have for flux and I think that it is the problem. Do you know how can we retrieve the flux version?

Thank you?

As per releasenotes for 1.7.9 Flux version is v0.50.2.

Yes I read that. But I am not sure that it is really the 0.50 . Is it possible that when I upgrade influxdb the flux version did not upgrade? I did some test and import math for example seems working while import date or import runtime does not work… It is like the flux version is not the good one

I did some tests:

  • with influx -type=flux the command import “date” works

  • with grafana and the flux plugin or with chronograf, the import “date” does not work. The error is "error “error in evaluating AST while starting program: type error 1:1-1:14: unknown import path: ““date”””

Which operating system have you tested this on?
Windows or Linux?

Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-74-generic x86_64)

Ok, I have not got a chance to test the latest on Ubuntu, but i did test 1.7.9 on Windows and import “data” does work.

When you type import “date” does intelligence suggests you options:

image

What version of Chronograf you are using?

version chronograf 1.7.17

I have also the suggestion

but then when I run script:

It worked for me when I tested with the same version of chronograf of course the only difference was OS.

Its odd that in your case, it does not seem to recognize the latest flux and throwing the same error as i got when tested with 1.7.8.
May be try resinstalling and/or restart services.

I try on a docker with the last version for chronograf and influxdb and it seems to work. Therefore it is really a problem coming from the upgrade of influxdb. So what is the good process to do without lose all the data and the configuration?

Flux is packaged with InfluxDB, so when you upgrade InfluxDB, you should get a newer version of Flux. It looks like an issue with the AST that Chronograf is submitting to the Flux engine, so may be a Chronograf issue, although I’m testing with 1.7.17 on macOS and it’s working…

For your information:
By rebooting the server, it seems that the problem has been corrected… If you want to explain the problem on a issue github, let’s me know.