fr-ser / grafana-sqlite-datasource

Grafana Plugin to enable SQLite as a Datasource
Apache License 2.0
124 stars 17 forks source link

Failed to start Plugin - expected expression, got '<' ... #12

Closed thefeiter closed 3 years ago

thefeiter commented 3 years ago

On server startup, I get the following message:

EROR[11-10|11:27:54] Failed to start plugin                   logger=plugins.backend pluginId=frser-sqlite-datasource error="fork/exec /home/USER/apps/grafana-7.3.1/data/plugins/grafana-sqlite-datasource/src/gpx_sqlite-datasource_linux_amd64: no such file or directory"

I manually downloaded the code and set allow_loading_unsigned_plugins =frser-sqlite-datasource

When I add a sqlite datasource I get the following: Bildschirmfoto von 2020-11-10 11-33-41

fr-ser commented 3 years ago

The log you posted gives a pretty straight-forward case /home/USER/apps/grafana-7.3.1/data/plugins/grafana-sqlite-datasource/src/gpx_sqlite-datasource_linux_amd64: no such file or directory

How does you plugin directory look like?

Just as an example. This is how my plugin directory looks in a working environment:

$ cd /var/lib/grafana/plugins

$ ls -lah
[...]
drwxrwxr-x    9 1000     1000        4.0K Nov  2 19:41 frser-sqlite-datasource

$ ls -lah frser-sqlite-datasource/
[...]
drwxrwxr-x    3 1000     1000        4.0K Nov  2 19:41 dist
[...]

$ ls -lah frser-sqlite-datasource/dist/
[...]
-rwxr-xr-x    1 1000     1000       19.6M Nov  2 19:41 gpx_sqlite-datasource_linux_amd64
[...]
thefeiter commented 3 years ago

Well, my bad. I assumed that a git clone was sufficient, but that then didnt include the dist folder etc. Thanks anyway!

fr-ser commented 3 years ago

You need to clone the right branch (master and feature branches have no dist folders). The easiest way is to download the zip from the releases, though.

Glad it works now!

AlexandreBonneau commented 3 years ago

Sorry for replying to this issue, but I get a similar error expected expression, got '<' Evaluating http://localhost:3000/public/app/plugins/datasource/sqlite/module Loading app/plugins/datasource/sqlite/module when selecting the sqlite-datasource.

I've tried modifying /etc/grafana/grafana.ini with allow_loading_unsigned_plugins =frser-sqlite-datasource, to no avail. I've tried putting all the files from the latest github release from /usr/share/grafana/public/app/plugins/datasource/ to /var/lib/grafana/plugins but with the latter it did not appear in the plugin list.

This is the files I'm using:

# tree sqlite 

/usr/share/grafana/public/app/plugins/datasource/sqlite
 |-->CHANGELOG.md
 |-->gpx_sqlite-datasource_linux_amd64
 |-->img
 |    |-->logo.svg
 |    |-->sine-wave-example-dashboard.png
 |    |-->sine-wave-timeseries-panel-edit.png
 |-->LICENSE
 |-->MANIFEST.txt
 |-->module.js
 |-->module.js.LICENSE.txt
 |-->module.js.map
 |-->plugin.json
 |-->README.md
fr-ser commented 3 years ago

Since a couple versions ago the plugin is signed, so nothing is needed to be changed in that regard.

Otherwise, your issue looks pretty much like what everyone gets, when putting the plugin not in the correct folder (or missing some files). From my first glance it looks like you have the files you need. The only thing I am to sure about is the datasource part of this path usr/share/grafana/public/app/plugins/datasource/sqlite.

In my docker example the files are located in this directory /var/lib/grafana/plugins/frser-sqlite-datasource. Here is a code snipped for the terminal-savy

bash-5.0$ cd /var/lib/grafana/plugins/
bash-5.0$ ls -la
total 16
drwxrwxrwx    1 grafana  root          4096 Jan  6 16:33 .
drwxrwxrwx    1 grafana  root          4096 Jan  6 16:33 ..
drwxrwxr-x    3 1000     1000          4096 Jan  4 16:15 frser-sqlite-datasource
bash-5.0$ ls -lah frser-sqlite-datasource/
total 88M
drwxrwxr-x    3 1000     1000        4.0K Jan  4 16:15 .
drwxrwxrwx    1 grafana  root        4.0K Jan  6 16:33 ..
-rw-rw-r--    1 1000     1000        1.3K Dec 29 10:48 CHANGELOG.md
-rw-rw-r--    1 1000     1000       11.1K Dec 29 10:48 LICENSE
-rw-rw-r--    1 1000     1000        2.1K Jan  4 16:16 MANIFEST.txt
-rw-rw-r--    1 1000     1000        4.6K Dec 29 10:48 README.md
-rwxrwxr-x    1 1000     1000       20.1M Jan  4 16:15 gpx_sqlite-datasource_linux_amd64
-rwxrwxr-x    1 1000     1000       11.0M Dec 19 19:01 gpx_sqlite-datasource_linux_arm6
-rwxrwxr-x    1 1000     1000       12.1M Dec 19 19:01 gpx_sqlite-datasource_linux_arm64
-rwxrwxr-x    1 1000     1000       10.9M Dec 19 19:01 gpx_sqlite-datasource_linux_arm7
-rwxrwxr-x    1 1000     1000       33.6M Dec 19 19:01 gpx_sqlite-datasource_windows_amd64.exe
drwxrwxr-x    2 1000     1000        4.0K Dec 19 19:01 img
-rw-rw-r--    1 1000     1000       14.4K Dec 29 10:48 module.js
-rw-rw-r--    1 1000     1000         808 Dec 29 10:48 module.js.LICENSE.txt
-rw-rw-r--    1 1000     1000       76.4K Dec 29 10:48 module.js.map
-rw-rw-r--    1 1000     1000        1.1K Dec 29 10:48 plugin.json