Bug 1445048

Summary: Munin plugin 'mysql_' fails with "Use of uninitialized value in subroutine entry at ... line 1105."
Product: [Fedora] Fedora EPEL Reporter: sumatej
Component: muninAssignee: Kim B. Heino <b>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: epel7CC: b, drjohnson1, ingvar, mail-redhat
Target Milestone: ---   
Target Release: ---   
Hardware: noarch   
OS: Linux   
Whiteboard:
Fixed In Version: munin-2.0.40-2.fc28 munin-2.0.40-2.el6 munin-2.0.40-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-06 03:08:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1445034    

Description sumatej 2017-04-24 19:39:43 UTC
Description of problem:
When $section_map{$sec}->() does not exists, munin mysql_ plugin fails with errors:
Use of uninitialized value in subroutine entry at /etc/munin/plugins/mysql_qcache_mem line 1105.
Can't use string ("") as a subroutine ref while "strict refs" in use at /etc/munin/plugins/mysql_qcache_mem line 1105.

Fix is to remove line 1105 with:
$section_map{$sec}->();

As the case before that line does what's expected - use the value only if it exists.

Version-Release number of selected component (if applicable):
munin-node-2.0.30-5.el7.noarch.rpm

How reproducible:
always

Steps to Reproduce:
1. Install munin-node and mysql
2. Configure some mysql_ plugin e.g.
ln -sf /usr/share/munin/plugins/mysql_ /etc/munin/plugins/mysql_qcache_mem
3. munin-run mysql_qcache_mem

Actual results:
# munin-run mysql_qcache_mem
Use of uninitialized value in subroutine entry at /etc/munin/plugins/mysql_qcache_mem line 1105.
Use of uninitialized value in subroutine entry at /etc/munin/plugins/mysql_qcache_mem line 1105.
Can't use string ("") as a subroutine ref while "strict refs" in use at /etc/munin/plugins/mysql_qcache_mem line 1105.

Expected results:
# munin-run mysql_qcache_mem
query_cache_size.value 4194304
Qcache_free_memory.value 941184

Comment 1 Florian Knonbauer 2017-09-14 15:26:28 UTC
I also have this problem and i backtracked it to the patch file

   mariadb-show-status.patch

which backports the munin github commit: e5f12ef57c75d37aa2e3444cc448598f3c32b0ea


but what seems missing the follow-up commit:
--------------------------------------------------------------------------------
commit 4b9d5ff71f9d13b498b7930a7a364c4e42287f46
Author: Daniel Black <daniel.black>
Date:   Wed Jun 25 13:10:47 2014 +1000

    remove calling $section_map{$sec}->(); twice

diff --git a/plugins/node.d/mysql_.in b/plugins/node.d/mysql_.in
index 1d83115f..bf573705 100644
--- a/plugins/node.d/mysql_.in
+++ b/plugins/node.d/mysql_.in
@@ -1108,8 +1108,6 @@ sub parse_innodb_status {
       #warn "Unknown section: $1";
       skip();
        }
-
-       $section_map{$sec}->();
     }
 }
 
--------------------------------------------------------------------------------

Comment 2 Fedora Update System 2018-08-25 08:35:56 UTC
munin-2.0.40-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-60e7ab00eb

Comment 3 Fedora Update System 2018-08-25 08:36:52 UTC
munin-2.0.40-2.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-e42294dd9f

Comment 4 Fedora Update System 2018-08-25 08:37:26 UTC
munin-2.0.40-2.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-d7fccd52d3

Comment 5 Fedora Update System 2018-08-25 22:37:08 UTC
munin-2.0.40-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-60e7ab00eb

Comment 6 Fedora Update System 2018-08-25 23:05:00 UTC
munin-2.0.40-2.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-d7fccd52d3

Comment 7 Fedora Update System 2018-08-25 23:05:59 UTC
munin-2.0.40-2.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-e42294dd9f

Comment 8 Fedora Update System 2018-09-06 03:08:53 UTC
munin-2.0.40-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2018-09-11 13:47:35 UTC
munin-2.0.40-2.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2018-09-11 14:44:25 UTC
munin-2.0.40-2.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.