Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Plugin fails to load if not logged in #21

Closed
quaintdev opened this issue Feb 10, 2021 · 6 comments
Closed

Plugin fails to load if not logged in #21

quaintdev opened this issue Feb 10, 2021 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Useful but not being worked on

Comments

@quaintdev
Copy link

First of all nice work on this plugin. It's exactly what I was looking for.

Coming to issue, I am trying to share my dashboard with others but this plugin keeps giving Error loading: marcusolsson-hourly-heatmap-panel. Rest of the visualizations load without any issue. Moreover if I login the plugin does not show any issue.

Note that the issue occurs only with anonymous users.

Any suggestions regarding this? Thanks in advance.

@marcusolsson
Copy link
Owner

Interesting. Never heard about this before. I'll try to look into this this week. Thanks for letting me know!

@marcusolsson marcusolsson added this to To do in Grafana Plugins via automation Feb 15, 2021
@marcusolsson marcusolsson added kind/bug Categorizes issue or PR as related to a bug. priority/backlog Useful but not being worked on labels Feb 28, 2021
@marcusolsson marcusolsson moved this from To do to In progress in Grafana Plugins Mar 5, 2021
@marcusolsson
Copy link
Owner

I got around to investigate this. Unfortunately, I'm not able to reproduce this. Could you share some details on what version of the plugin and Grafana you're currently running?

Also what permissions do anonymous users have?

@quaintdev
Copy link
Author

Grafana: 7.4.0
Plugin: 0.9.1

I just noticed that both have updates. I will update and report back. Regarding anonymous user, I have below config in grafana.ini

[auth.anonymous]
enabled = true
org_name = Main Org.
org_role = Viewer
hide_version = true

@quaintdev
Copy link
Author

The issue still exists. If I open my dashboard in incognito it looks like below

image

If I am logged in then it works as expected.

@marcusolsson
Copy link
Owner

So the problem is apparently with hide_version. The plugin tries to access the Grafana version to determine what features are available. If hide_version is set to true, not even the plugin can access the version.

I'm not actually sure about how we should go about fixing this. If the plugin don't know what features it can safely use, it needs to guess. Either we return true for all capabilities, or false for all capabilities. Either way, the plugin may crash if a capability is missing or is required.

@quaintdev
Copy link
Author

quaintdev commented Mar 9, 2021

I thought it would be better security-wise and set it to true. I'll just set it to false.

Thanks for resolution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Useful but not being worked on
Projects
No open projects
Development

No branches or pull requests

2 participants