Permission denied when plugin symlink

Hi team!

I’m currently working on a custom plugin development on wsl2 and facing problem on permission.
I’m building my project in ‘/home/myname/myplugin/dist’.
And I made a symlink in ‘/var/lib/grafana/plugins/’ using
ln -s /home/myname/myplugin/dist .

When I restart my grafana, it gives me error logs

logger=local.finder t=2024-03-29T11:23:49.1505488+09:00 level=warn msg=“Skipping finding plugins as an error occurred” path=/var/lib/grafana/plugins/dist error=“stat /var/lib/grafana/plugins/dist: permission denied”

After searching, I managed to set ProtectHome to false following this link(grafana-sqlite-datasource/docs/faq.md at main · fr-ser/grafana-sqlite-datasource · GitHub) and I think it is applied.

myname@DESKTOP-AG2HSO7:/lib/systemd/system$ systemctl show grafana-server.service | grep Home
ProtectHome=no

Still getting same error. I’ve tried chmod 777 to dist folder, and adding grafana to new group and set that as a owner group.

My other settings are correct, if I just copy dist folder to plugins folder then it works…

Or if there are any other bypass to continuously develop plugin and test in local(without docker) please let me know…
I’m avoiding docker because whenever I upgrade grafana version, all the settings are disappeared.

Thanks!

I am not familiar enough with WSL and how internally handles symlinks.

If you want to load a plugin from another directory you can also try to change the plugins directory location in the grafana configuration file.

By changing the plugins key under [paths] you can simply set the location to the place you want.

Another alternative, is to copy your dist files to the plugins path after the plugin finish building or develop your plugin directly in the plugins directory.

I generally recommend you to use docker to develop your plugins locally and isolate it from your very specific grafana configuration so it is reusable in other instances.