grafana / piechart-panel

Pie Chart Panel Plugin
MIT License
151 stars 101 forks source link

Problems to upgrade panel to version 1.6.1 from earlier versions #264

Open percygrunwald opened 3 years ago

percygrunwald commented 3 years ago

What happened: Currently installed plugins:

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

I attempted to update grafana-piechart-panel to version 1.6.1:

$ sudo grafana-cli plugins install grafana-piechart-panel 1.6.1
installing grafana-piechart-panel @ 1.6.1
from: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.6.1/download
into: /var/lib/grafana/plugins

✔ Installed grafana-piechart-panel successfully

However, the version of the plugin remains unchanged grafana-piechart-panel:

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

What you expected to happen: grafana-cli plugins install grafana-piechart-panel 1.6.1 should install grafana-piechart-panel with version 1.6.1. Nothing in the help content for this command gives any indication that a previously installed version of the plugin will affect its behavior. grafana-cli plugins update does not give you the ability to specify a version to update to, so the only option is latest. Given this, there is currently no way to update a specific plugin to a specific version without first uninstalling the plugin, which seems unnecessarily cumbersome.

Our use case is automating management of our HA Grafana installation using Ansible's grafana_plugin module (which uses grafana-cli plugins install under the hood:

cmd = '{0} install {1} {2}'.format(grafana_cli, params['name'], params['version'])

Changing grafana-cli to be able to support this use case would also fix the Ansible grafana_plugin module's behavior.

The current workaround would be that we need to do the following steps in our Ansible code:

With the expected behavior, the logic simply becomes:

How to reproduce it (as minimally and precisely as possible):

grafana-cli plugins remove grafana-piechart-panel
grafana-cli plugins install grafana-piechart-panel 1.4.0
grafana-cli plugins install grafana-piechart-panel 1.6.1

Anything else we need to know?: N/A

Environment:

percygrunwald commented 3 years ago

Looks as though this might be a bug specifically with the grafana-piechart-panel plugin, as other plugins work as expected:

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

$ sudo grafana-cli plugins install grafana-clock-panel 1.0.3
installing grafana-clock-panel @ 1.0.3
from: https://grafana.com/api/plugins/grafana-clock-panel/versions/1.0.3/download
into: /var/lib/grafana/plugins

✔ Installed grafana-clock-panel successfully

Restart grafana after installing plugins . <service grafana-server restart>

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.0.3
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

$ sudo grafana-cli plugins install grafana-clock-panel 1.1.1
installing grafana-clock-panel @ 1.1.1
from: https://grafana.com/api/plugins/grafana-clock-panel/versions/1.1.1/download
into: /var/lib/grafana/plugins

✔ Installed grafana-clock-panel successfully

Restart grafana after installing plugins . <service grafana-server restart>

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

However, the grafana-piechart-panel plugin behaves differently:

percy@usw401:~$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

percy@usw401:~$ sudo grafana-cli plugins install grafana-piechart-panel 1.6.1
installing grafana-piechart-panel @ 1.6.1
from: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.6.1/download
into: /var/lib/grafana/plugins

✔ Installed grafana-piechart-panel successfully

Restart grafana after installing plugins . <service grafana-server restart>

percy@usw401:~$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

If I uninstall grafana-piechart-panel then install version 1.6.1 I am able to downgrade to 1.4.0, but not the reverse:

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

$ sudo grafana-cli plugins uninstall grafana-piechart-panel
Removing plugin: grafana-piechart-panel

Restart grafana after installing plugins . <service grafana-server restart>

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

$ sudo grafana-cli plugins install grafana-piechart-panel 1.6.1
installing grafana-piechart-panel @ 1.6.1
from: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.6.1/download
into: /var/lib/grafana/plugins

✔ Installed grafana-piechart-panel successfully

Restart grafana after installing plugins . <service grafana-server restart>

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.6.1
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

$ sudo grafana-cli plugins install grafana-piechart-panel 1.4.0
installing grafana-piechart-panel @ 1.4.0
from: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.4.0/download
into: /var/lib/grafana/plugins

✔ Installed grafana-piechart-panel successfully

Restart grafana after installing plugins . <service grafana-server restart>

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

Very strange indeed

percygrunwald commented 3 years ago

Seems as though grafana-piechart-panel 1.6.1 is the source of the bug. I'm able to upgrade to 1.6.0 from 1.4.0, but not to 1.6.1 from any version.

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.4.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

$ sudo grafana-cli plugins install grafana-piechart-panel 1.6.0
installing grafana-piechart-panel @ 1.6.0
from: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.6.0/download
into: /var/lib/grafana/plugins

✔ Installed grafana-piechart-panel successfully

Restart grafana after installing plugins . <service grafana-server restart>

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.6.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>

$ sudo grafana-cli plugins install grafana-piechart-panel 1.6.1
installing grafana-piechart-panel @ 1.6.1
from: https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.6.1/download
into: /var/lib/grafana/plugins

✔ Installed grafana-piechart-panel successfully

Restart grafana after installing plugins . <service grafana-server restart>

$ grafana-cli plugins ls
installed plugins:
goshposh-metaqueries-datasource @ 0.0.3
grafana-clock-panel @ 1.1.1
grafana-piechart-panel @ 1.6.0
natel-discrete-panel @ 0.1.0

Restart grafana after installing plugins . <service grafana-server restart>
ivanahuckova commented 3 years ago

Hello @percygrunwald! Thank you so much for doing the investigation. 🙏 I have transferred this issue directly to the Pie chart panel repo.