• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx

  • We are developing a new feature in Plesk that will help you promote your websites or business on social media. We want to conduct a one-hour online UX test to present the prototype and collect feedback. If you are interested in the feature, please book a meeting via this link.
    Thank you in advance!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Forwarded to devs Grafana extension database rights too broad and cannot load unsigned backend plugin

Visnet

Basic Pleskian
Username: Visnet

TITLE

Grafana extension database rights too broad and cannot load unsigned backend plugin

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Plesk Obsidian 18.0.33.0
CentOS 7.9.2009 x86_64

PROBLEM DESCRIPTION

After having updated Grafana from Plesk's Grafana repo, I'm seeing the following errors in the Grafana log:
Code:
t=2021-02-04T19:28:28+0100 lvl=warn msg="SQLite database file has broader permissions than it should" logger=sqlstore path=/var/lib/grafana/grafana.db mode=-rw-r--r-- expected=-rw-r-----
t=2021-02-04T19:28:29+0100 lvl=warn msg="Running an unsigned backend plugin" logger=plugins pluginID=grafana-simple-json-backend-datasource pluginDir=/var/lib/grafana/plugins/grafana-simple-json-backend-datasource/dist
t=2021-02-04T19:28:29+0100 lvl=eror msg="Failed to read plugin provisioning files from directory" logger=provisioning.plugins path=/etc/grafana/provisioning/plugins error="open /etc/grafana/provisioning/plugins: no such file or directory"
t=2021-02-04T19:28:29+0100 lvl=warn msg="Plugin uses a deprecated version of Grafana's backend plugin system which will be removed in a future release. Consider upgrading to a newer plugin version or reach out to the plugin repository/developer and request an upgrade." logger=plugins.backend pluginId=grafana-simple-json-backend-datasource

STEPS TO REPRODUCE

1. Update to grafana-7.4.0-1.x86_64 from the plesk-ext-grafana repo.

2. See the following error:
Code:
  Updating   : grafana-7.4.0-1.x86_64                                                                                                2/4
Job for grafana-server.service failed because the control process exited with error code. See "systemctl status grafana-server.service" and "journalctl -xe" for details.
warning: %post(grafana-7.4.0-1.x86_64) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package grafana-7.4.0-1.x86_64

3. Checks the log file in /var/log/grafana/grafana.log, and find the message quoted above.

4. Stat /var/lib/grafana/grafana.db to find that it's readable by other users.

ACTUAL RESULT

Permissions for /var/lib/grafana/grafana.db are too broad.

Backend plugin grafana-simple-json-backend-datasource is unsigned and deprecated.

EXPECTED RESULT

Permissions for /var/lib/grafana/grafana.db should be -rw-r-----
(according to the logs)

Deprecated backend plugin grafana-simple-json-backend-datasource should be removed or replaced.

ANY ADDITIONAL INFORMATION

Thanks guys (and gals)

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
From developer:

The plugin grafana-simple-json-backend-datasource is not actually deprecated. It's our own modification of the official SimpleJson plugin for Grafana datasource (currently is no longer maintained). Something like grafana/simple-json-backend-datasource. We have to use it as we need alerts to be supported, but unfortunately, the mentioned datasource doesn't support them.

So, we have to bring the datasource and add it to the list of exceptions in the configuration file.

[plugins]
allow_loading_unsigned_plugins = grafana-simple-json-backend-datasource

This is done automatically but the warning notification you wrote can't be disabled. I've created bug EXTPLESK-2432 in order to try to fix the problem.

-------------------------

As for the notification about access rights, I couldn't reproduce it on fresh installation and it seems an issue of the grafana platform itself. So, you can fix the rights manually.
 
And how about the file permissions for /var/lib/grafana/grafana.db, can these be safely changed to -rw-r----- ?
 
Yes, they can be changed. My default installation for instance:

# ll /var/lib/grafana/
total 812
drwxr-xr-x 4 grafana grafana 4096 Feb 17 12:35 ./
drwxr-xr-x 62 root root 4096 Feb 16 17:03 ../
-rw-r----- 1 grafana grafana 811008 Feb 17 12:35 grafana.db
lrwxrwxrwx 1 grafana grafana 16 Feb 16 17:03 log -> /var/log/grafana/
drwxr-x--- 3 grafana grafana 4096 Feb 16 17:05 plugins/
drwx------ 2 grafana grafana 4096 Feb 16 17:04 png/

Please, ensure in advance the database owner is the grafana user.
 
Ok, thanks IgorG, for updating the thread with an explanation from the developer.

And lastly, how about the logged error about the missing folder /etc/grafana/provisioning/plugins?
 
@IgorG - Updated Grafana today with apt and official plesk provided repos to v8.0.0 - grafana stopped working / no data shown on Ubuntu 18.04.05 LTS with Plesk 18.0.36

Grafana.log states these two different error-types that may be related to the deprecated plugin:
lvl=eror msg="Metric request error" logger=context userId=2 orgId=1 uname=admin_viewer error="plugin unavailable" remote_addr=127.0.0.1
lvl=eror msg="Alert Rule Result Error" logger=alerting.evalContext ruleId=29 name="Swap usage" error="request handler error: plugin unavailable" changing state to=keep_state

A workaround would be to disable official grafana repo in Plesk until solved or pin it to its latest 7.x. release.
 
I have the same issue as Nextgen. Plesk asked me to do an upgrade of Grafana 8, since then advanced monitoring is no longer showing any data. The log mentions several times that a plugin is not available, such as

Code:
"MySQL memory usage" error="request handler error: plugin unavailable"
 
same issue, Plesk: newest, ubuntu 18.04.5 LTS


Code:
t=2021-06-12T11:33:08+0200 lvl=info msg="Live Push Gateway initialization" logger=live.push_http
t=2021-06-12T11:33:08+0200 lvl=eror msg="Stopped HTTPServer" logger=server reason="failed to open listener on address 0.0.0.0:3000: listen tcp 0.0.0.0:3000: bind: address already in use"
t=2021-06-12T11:33:08+0200 lvl=eror msg="Server shutdown" logger=server error="HTTPServer run error: failed to open listener on address 0.0.0.0:3000: listen tcp 0.0.0.0:3000: bind: address already in use"
.....
t=2021-06-12T11:33:08+0200 lvl=warn msg="Running an unsigned plugin" logger=plugins pluginID=grafana-simple-json-backend-datasource pluginDir=/var/lib/grafana/plugins/grafana-simple-json-backend-datasource/dist
t=2021-06-12T11:33:09+0200 lvl=eror msg="Failed to start plugin" logger=plugins.backend pluginId=grafana-simple-json-backend-datasource error="Incompatible API version with plugin. Plugin version: 1, Client versions: [2]"


Hth...
 
Thanks @Nextgen-Networks
My confusion comes from the fact that the OP of this issue was citing upgrading to grafana-7.4.0-1 as the triggering event, while in the "other issue" everything is working with grafana-7.5.7-1 ...
 
Back
Top