Installed Grafana:
cd /usr/local/src
curl -O --insecure https ://dl.grafana.com/oss/release/grafana-11.0.0-1.x86_64.rpm
yum install grafana-11.0.0-1.x86_64.rpm
vi /etc/grafana/grafana.ini
systemctl start grafana-server
Downloaded and compiled couchbase plugin:
git clone https ://github.com/couchbaselabs/grafana-plugin.git
cd grafana-plugin/
yarn install && yarn build
cd /usr/share/grafana/public/app/plugins/datasource
cp -R /usr/local/src/grafana-plugin/couchbase-datasource/ .
export GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=couchbase-datasource
export GF_PLUGIN_APP_TLS_SKIP_VERIFY_INSECURE=true
NOTE: couchbase-plugin directory does not work in the default plugins directory - needs to be in
/usr/share/grafana/public/app/plugins/datasource to be seen by GUI
vim /etc/grafana/grafana.ini
#[plugins]
allow_loading_unsigned_plugins = couchbase-datasource
systemctl restart grafana-server
Problem:
When adding the new couchbase-datasource and clicking the SAVE & TEST button an error - “Plugin Unavailable” occurs
Logs indicate failed to open plugins path:
/var/log/grafana/grafana.log:
It appears the default installation is this path:
/usr/share/grafana/public/app/plugins/datasource
I cannot see my plugin even show up in the GUI without moving it there.
The /var/lib/grafana path does not have a plugins directory:
(base) # ls -l /var/lib/grafana/
total 980
drwx------. 2 grafana grafana 6 Jun 24 12:33 csv
-rw-r-----. 1 grafana grafana 1003520 Jun 24 14:36 grafana.db
drwx------. 2 grafana grafana 6 Jun 24 12:33 pdf
drwx------. 2 grafana grafana 6 Jun 24 12:33 png
I can update the grafana.ini or make a plugins directory in /var/lib/grafana/ and try moving the couchbase-connector there
Note sure why the base install did not create the directory that the config is pointing to, but I went ahead and added the directory with correct permissions and now at least the logs are showing it is attempting to load the plugin, but now there are file related errors:
logger=plugin.signature.validator t=2024-06-24T14:47:46.728261478-05:00 level=warn msg="Permitting unsigned plugin. This is not recommended" pluginId=couchbase-datasource
logger=plugins.registration t=2024-06-24T14:47:46.729043945-05:00 level=info msg="Plugin registered" pluginId=couchbase-datasource
logger=plugins.backend.start t=2024-06-24T14:47:46.729410437-05:00 level=error msg="Could not start plugin" pluginId=couchbase-datasource error="fork/exec /var/lib/grafana/plugins/couchbase-datasource/dist/gpx_couchbase_linux_amd64: no such file or directory"
logger=plugins.initialization t=2024-06-24T14:47:46.729445383-05:00 level=error msg="Could not initialize plugin" pluginId=couchbase-datasource error="fork/exec /var/lib/grafana/plugins/couchbase-datasource/dist/gpx_couchbase_linux_amd64: no such file or directory"
Not sure why there are files not in the correct directory for the plugin as I did not get any errors compiling it.
(base) [root@r-server2 dist]# pwd
/var/lib/grafana/plugins/couchbase-datasource/dist
(base) [root@r-server2 dist]# ls -l
total 40
-rw-r--r--. 1 grafana grafana 53 Jun 24 12:40 CHANGELOG.md
drwxr-xr-x. 2 grafana grafana 44 Jun 24 12:40 img
-rw-r--r--. 1 grafana grafana 1094 Jun 24 12:40 LICENSE
-rw-r--r--. 1 grafana grafana 5083 Jun 24 12:40 module.js
-rw-r--r--. 1 grafana grafana 13064 Jun 24 12:40 module.js.map
-rw-r--r--. 1 grafana grafana 1193 Jun 24 12:40 plugin.json
-rw-r--r--. 1 grafana grafana 701 Jun 24 12:40 README.md
I believe so, but we have not used it as of yet. I think the git source distribution is missing files. If I download the .zip for windows I can see that dist folder contains the missing gpx files and if I manually copy those into the /var/lib/grafana/plugins/couchbase-datasource/dist directory I can get the plugin to pass the TEST & SAVE without the error. So I think it is fixed now. Thanks
(base) [root@r-server2 dist]# chmod 755 gpx_couchbase*
(base) [root@r-server2 dist]# ls -l
total 98232
-rw-r--r--. 1 grafana grafana 53 Jun 24 12:40 CHANGELOG.md
-rwxr-xr-x. 1 grafana grafana 18070128 Jun 24 16:02 gpx_couchbase_darwin_amd64
-rwxr-xr-x. 1 grafana grafana 18009090 Jun 24 16:02 gpx_couchbase_darwin_arm64
-rwxr-xr-x. 1 grafana grafana 16293888 Jun 24 16:02 gpx_couchbase_linux_amd64
-rwxr-xr-x. 1 grafana grafana 15597568 Jun 24 16:02 gpx_couchbase_linux_arm
-rwxr-xr-x. 1 grafana grafana 15728640 Jun 24 16:02 gpx_couchbase_linux_arm64
-rwxr-xr-x. 1 grafana grafana 16846336 Jun 24 16:02 gpx_couchbase_windows_amd64.exe
drwxr-xr-x. 2 grafana grafana 44 Jun 24 12:40 img
-rw-r--r--. 1 grafana grafana 1094 Jun 24 12:40 LICENSE
-rw-r--r--. 1 grafana grafana 5083 Jun 24 12:40 module.js
-rw-r--r--. 1 grafana grafana 13064 Jun 24 12:40 module.js.map
-rw-r--r--. 1 grafana grafana 1193 Jun 24 12:40 plugin.json
-rw-r--r--. 1 grafana grafana 701 Jun 24 12:40 README.md
Grafana logs:
logger=plugin.signature.validator t=2024-06-24T16:04:40.116683333-05:00 level=warn msg="Permitting unsigned plugin. This is not recommended" pluginId=couchbase-datasource
logger=plugins.registration t=2024-06-24T16:04:40.116882691-05:00 level=info msg="Plugin registered" pluginId=couchbase-datasource
Previous errors:
logger=plugin.signature.validator t=2024-06-24T14:51:53.1465639-05:00 level=warn msg="Permitting unsigned plugin. This is not recommended" pluginId=couchbase-datasource
logger=plugins.registration t=2024-06-24T14:51:53.146842776-05:00 level=info msg="Plugin registered" pluginId=couchbase-datasource
logger=plugins.backend.start t=2024-06-24T14:51:53.147268135-05:00 level=error msg="Could not start plugin" pluginId=couchbase-datasource error="fork/exec /var/lib/grafana/plugins/couchbase-datasource/dist/gpx_couchbase_linux_amd64: no such file or directory"
logger=plugins.initialization t=2024-06-24T14:51:53.147303032-05:00 level=error msg="Could not initialize plugin" pluginId=couchbase-datasource error="fork/exec /var/lib/grafana/plugins/couchbase-datasource/dist/gpx_couchbase_linux_amd64: no such file or directory"
We’ll start testing tomorrow and see if copying the gpx from the ZIP linked at https://github.com/couchbaselabs/grafana-plugin/releases works, but the installation documentation is not clear about additional steps for compiling the backend gpx files - it seems to imply the yarn install & yarn build should just work which for me does not. The only hint I see are some warnings, but it still seems to complete without an error:
warning Resolution field "rxjs@7.3.0" is incompatible with requested version "rxjs@7.8.1"
warning Resolution field "rxjs@7.3.0" is incompatible with requested version "rxjs@7.8.1"
warning Resolution field "rxjs@7.3.0" is incompatible with requested version "rxjs@7.8.1"
warning Resolution field "rxjs@7.3.0" is incompatible with requested version "rxjs@^7.5.1"
Unfortunately it appears the hacked version of gpx files being copied from the ZIP does not work as the queries do make it to our couchbase environment but return various errors such as this: logger=context userId=1 orgId=1 uname=admin t=2024-06-24T16:54:09.304292129-05:00 level=error msg="Internal server error" error="[plugin.downstreamError] client: failed to query data: Failed to query data: rpc error: code = Unavailable desc = error reading from server: EOF" remote_addr=10.100.1.48 traceID=
And Grafana reports as a plugin error. So I’ll have to figure out how to get those gpx binaries to compile to see if that fixes this issue.
The instructions for the plugin only mention to execute: yarn install & yarn build
There are no additional “backend” tasks mentioned. I am not a developer and just assume the link you provided to the release.yml file which includes:
Implies the Magefile.go file will be executed which seems to have a broken URL: build "github.com/grafana/grafana-plugin-sdk-go/build"
That URL responds with 404 NOT FOUND, however if I update the URL to: build "github.com/grafana/grafana-plugin-sdk-go/tree/main/build"
It appears to work. but still the gpx files still are not built and stored in the ./couchbase-datasource/dist so I am lost on what to do. It seems the gpx_couchbase_linux_amd64 file is not provided in the installation process
Hi,
Grafana changed build process last year and, while I updated the ./run.sh script with new build commands, I never updated the readme with them. I’ve fixed that today, apologies for the confusion. Here’s the full command: yarn install && yarn build && mage -v.