Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-12641 Fix the dashboard upgrade #2926

Merged
merged 2 commits into from
Mar 26, 2024
Merged

Conversation

ademidoff
Copy link
Member

@ademidoff ademidoff commented Mar 23, 2024

This fixes a bug where, due to a wrong ansible formula, PMM would upgrade the dashboards no matter what :)

PMM-12641

Link to the Feature Build: SUBMODULES-3599

Faulty logs

[ec2-user@ip-10-178-1-214 ~]$ docker exec pmm-server cat /srv/logs/pmm-update-perform-init.log ProjectName: pmm-update Version: 3.0.0 PMMVersion: 3.0.0 Timestamp: 2024-03-21 00:22:05 (UTC) FullCommit: f9fd3a7 Starting "ansible-playbook --flush-cache /opt/ansible/pmm-docker/init.yml" ... [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [initialization : Get current version] ************************************
ok: [localhost]

TASK [initialization : Get image version] **************************************
ok: [localhost]

TASK [initialization : Set current version if VERSION doesn't exist] ***********
skipping: [localhost]

TASK [initialization : Setting current PMM version] ****************************
ok: [localhost]

TASK [initialization : Setting current PMM image version] **********************
ok: [localhost]

TASK [initialization : Set need_upgrade fact] **********************************
ok: [localhost]

TASK [initialization : Print current PMM and image versions] *******************
ok: [localhost] => {
"msg": "Current version: 3.0.0 Image Version: 3.0.0"
}

TASK [initialization : Enable maintenance mode before upgrade] *****************
ok: [localhost]

TASK [Upgrade dashboards] ******************************************************

TASK [dashboards : Get plugin list] ********************************************
ok: [localhost]

TASK [dashboards : Delete older plugins] ***************************************
changed: [localhost] => (item={'path': '/usr/share/percona-dashboards/panels/grafana-clickhouse-datasource', 'mode': '0755', 'isdir': True, 'ischr': False, 'isblk': False, 'isreg': False, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 1000, 'size': 230, 'inode': 38952651, 'dev': 39, 'nlink': 4, 'atime': 0.0, 'mtime': 1711028062.0, 'ctime': 1711222397.6157818, 'gr_name': 'pmm', 'pw_name': 'pmm', 'wusr': True, 'rusr': True, 'xusr': True, 'wgrp': False, 'rgrp': True, 'xgrp': True, 'woth': False, 'roth': True, 'xoth': True, 'isuid': False, 'isgid': False})
changed: [localhost] => (item={'path': '/usr/share/percona-dashboards/panels/grafana-piechart-panel', 'mode': '0755', 'isdir': True, 'ischr': False, 'isblk': False, 'isreg': False, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 1000, 'size': 277, 'inode': 50424402, 'dev': 39, 'nlink': 4, 'atime': 0.0, 'mtime': 1711028062.0, 'ctime': 1711222397.6157818, 'gr_name': 'pmm', 'pw_name': 'pmm', 'wusr': True, 'rusr': True, 'xusr': True, 'wgrp': False, 'rgrp': True, 'xgrp': True, 'woth': False, 'roth': True, 'xoth': True, 'isuid': False, 'isgid': False})
changed: [localhost] => (item={'path': '/usr/share/percona-dashboards/panels/grafana-polystat-panel', 'mode': '0755', 'isdir': True, 'ischr': False, 'isblk': False, 'isreg': False, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 1000, 'size': 255, 'inode': 1117878, 'dev': 39, 'nlink': 5, 'atime': 0.0, 'mtime': 1711028062.0, 'ctime': 1711222397.6157818, 'gr_name': 'pmm', 'pw_name': 'pmm', 'wusr': True, 'rusr': True, 'xusr': True, 'wgrp': False, 'rgrp': True, 'xgrp': True, 'woth': False, 'roth': True, 'xoth': True, 'isuid': False, 'isgid': False})
changed: [localhost] => (item={'path': '/usr/share/percona-dashboards/panels/grafana-worldmap-panel', 'mode': '0755', 'isdir': True, 'ischr': False, 'isblk': False, 'isreg': False, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 1000, 'size': 188, 'inode': 17361044, 'dev': 39, 'nlink': 6, 'atime': 0.0, 'mtime': 1711028062.0, 'ctime': 1711222397.6157818, 'gr_name': 'pmm', 'pw_name': 'pmm', 'wusr': True, 'rusr': True, 'xusr': True, 'wgrp': False, 'rgrp': True, 'xgrp': True, 'woth': False, 'roth': True, 'xoth': True, 'isuid': False, 'isgid': False})
changed: [localhost] => (item={'path': '/usr/share/percona-dashboards/panels/jdbranham-diagram-panel', 'mode': '0755', 'isdir': True, 'ischr': False, 'isblk': False, 'isreg': False, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 1000, 'size': 175, 'inode': 38952661, 'dev': 39, 'nlink': 3, 'atime': 0.0, 'mtime': 1711028062.0, 'ctime': 1711222397.6157818, 'gr_name': 'pmm', 'pw_name': 'pmm', 'wusr': True, 'rusr': True, 'xusr': True, 'wgrp': False, 'rgrp': True, 'xgrp': True, 'woth': False, 'roth': True, 'xoth': True, 'isuid': False, 'isgid': False})
changed: [localhost] => (item={'path': '/usr/share/percona-dashboards/panels/natel-discrete-panel', 'mode': '0755', 'isdir': True, 'ischr': False, 'isblk': False, 'isreg': False, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 1000, 'size': 191, 'inode': 46595502, 'dev': 39, 'nlink': 4, 'atime': 0.0, 'mtime': 1711028062.0, 'ctime': 1711222397.6157818, 'gr_name': 'pmm', 'pw_name': 'pmm', 'wusr': True, 'rusr': True, 'xusr': True, 'wgrp': False, 'rgrp': True, 'xgrp': True, 'woth': False, 'roth': True, 'xoth': True, 'isuid': False, 'isgid': False})
changed: [localhost] => (item={'path': '/usr/share/percona-dashboards/panels/petrslavotinek-carpetplot-panel', 'mode': '0755', 'isdir': True, 'ischr': False, 'isblk': False, 'isreg': False, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 1000, 'size': 4096, 'inode': 58998806, 'dev': 39, 'nlink': 7, 'atime': 0.0, 'mtime': 1711028062.0, 'ctime': 1711222397.6157818, 'gr_name': 'pmm', 'pw_name': 'pmm', 'wusr': True, 'rusr': True, 'xusr': True, 'wgrp': False, 'rgrp': True, 'xgrp': True, 'woth': False, 'roth': True, 'xoth': True, 'isuid': False, 'isgid': False})
changed: [localhost] => (item={'path': '/usr/share/percona-dashboards/panels/pmm-app', 'mode': '0755', 'isdir': True, 'ischr': False, 'isblk': False, 'isreg': False, 'isfifo': False, 'islnk': False, 'issock': False, 'uid': 1000, 'gid': 1000, 'size': 18, 'inode': 42566029, 'dev': 39, 'nlink': 3, 'atime': 0.0, 'mtime': 1711028062.0, 'ctime': 1711222397.6157818, 'gr_name': 'pmm', 'pw_name': 'pmm', 'wusr': True, 'rusr': True, 'xusr': True, 'wgrp': False, 'rgrp': True, 'xgrp': True, 'woth': False, 'roth': True, 'xoth': True, 'isuid': False, 'isgid': False})

TASK [dashboards : Copy plugins to the plugin directory] ***********************
changed: [localhost]

TASK [dashboards : Set permissions for the plugin directory] *******************
changed: [localhost]

TASK [dashboards : Restart grafana with new plugins] ***************************
changed: [localhost] => (item=stop)
changed: [localhost] => (item=remove)
changed: [localhost] => (item=add)

TASK [initialization : Copy file with image version] ***************************
ok: [localhost]

TASK [initialization : Create a backup directory] ******************************
ok: [localhost]

TASK [initialization : Output pmm-managed logs] ********************************
changed: [localhost]

TASK [initialization : Wait for PMM to be ready] *******************************
ok: [localhost]

TASK [initialization : Disable maintenance mode] *******************************
changed: [localhost]

PLAY RECAP *********************************************************************
localhost : ok=18 changed=6 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0

The fix has been tested on the feature build instance. ✅

Logs (cat /srv/logs/pmm-update-perform-init.log)

Starting "ansible-playbook --flush-cache /opt/ansible/pmm-docker/init.yml" ... [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [initialization : Get current version] ************************************
ok: [localhost]

TASK [initialization : Get image version] **************************************
ok: [localhost]

TASK [initialization : Set current version if VERSION doesn't exist] ***********
skipping: [localhost]

TASK [initialization : Setting current PMM version] ****************************
ok: [localhost]

TASK [initialization : Setting current PMM image version] **********************
ok: [localhost]

TASK [initialization : Set need_upgrade fact] **********************************
ok: [localhost]

TASK [initialization : Print current PMM and image versions] *******************
ok: [localhost] => {
"msg": "Current version: 3.0.0 Image Version: 3.0.0"
}

TASK [initialization : Print need_upgrade fact] ********************************
ok: [localhost] => {
"msg": "Need upgrade: False"
}

TASK [initialization : Enable maintenance mode before upgrade] *****************
skipping: [localhost]

TASK [Upgrade dashboards] ******************************************************
skipping: [localhost]

TASK [initialization : Copy file with image version] ***************************
skipping: [localhost]

TASK [initialization : Create a backup directory] ******************************
skipping: [localhost]

TASK [initialization : Wait for PMM to be ready] *******************************
skipping: [localhost]

TASK [initialization : Disable maintenance mode] *******************************
skipping: [localhost]

TASK [initialization : Output pmm-managed logs] ********************************
changed: [localhost]

PLAY RECAP *********************************************************************
localhost : ok=9 changed=1 unreachable=0 failed=0 skipped=7 rescued=0 ignored=0

NOTE: PMM v2 is not affected.

This fixes a bug where, due to a wrong ansible formula, PMM would upgrade the dashboards no matter what :)
Copy link

codecov bot commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.52%. Comparing base (f9fd3a7) to head (519525a).

Additional details and impacted files
@@           Coverage Diff           @@
##               v3    #2926   +/-   ##
=======================================
  Coverage   43.52%   43.52%           
=======================================
  Files         362      362           
  Lines       42423    42423           
=======================================
  Hits        18464    18464           
- Misses      22386    22387    +1     
+ Partials     1573     1572    -1     
Flag Coverage Δ
admin 11.56% <ø> (-0.05%) ⬇️
agent 53.33% <ø> (ø)
managed 44.89% <ø> (+<0.01%) ⬆️
vmproxy 68.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ademidoff ademidoff marked this pull request as ready for review March 23, 2024 18:06
@ademidoff ademidoff requested a review from a team as a code owner March 23, 2024 18:06
@ademidoff ademidoff requested review from idoqo, JiriCtvrtka and BupycHuk and removed request for a team March 23, 2024 18:06
@BupycHuk
Copy link
Member

Do we have any evidence that this problem existed?

@ademidoff
Copy link
Member Author

ademidoff commented Mar 23, 2024

Do we have any evidence that this problem existed?

We do. To assert that, one can spin up an instance using this pipeline and run docker exec pmm-server cat /srv/logs/pmm-update-perform-init.log.

I attached the logs to the PR description.

@ademidoff ademidoff merged commit 848155a into v3 Mar 26, 2024
30 checks passed
@ademidoff ademidoff deleted the PMM-12641-fix-dashboard-upgrade branch March 26, 2024 06:39
ademidoff added a commit that referenced this pull request Apr 1, 2024
* PMM-12641 Fix the dashboard upgrade

This fixes a bug where, due to a wrong ansible formula, PMM would upgrade the dashboards no matter what :)

* PMM-12641 follow up on review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants