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

[plugins/apt_all] Use of uninitialized value $ENV{"MUNIN_PLUGSTATE"} in concatenation (.) or string at /usr/share/munin/plugins/apt_all line 110. #1393

Closed
ruliane opened this issue Apr 5, 2021 · 3 comments

Comments

@ruliane
Copy link
Contributor

ruliane commented Apr 5, 2021

Describe the bug
When executing the newest version of apt_all:

Use of uninitialized value $ENV{"MUNIN_PLUGSTATE"} in concatenation (.) or string at /usr/share/munin/plugins/apt_all line 110.
pending_buster_updates.value 0
hold_buster_updates.value 0
pending_buster.value 0
hold_buster.value 0

(Note the warning is written to STDERR.)

To Reproduce
# /usr/share/munin/plugins/apt_all

Expected behavior
No error expected.

Desktop (please complete the following information):

  • Debian Buster w/ plugin apt_all from commit cd28c42
  • Munin Version 2.0.49 (except apt_all plugin)

Additional context
I replaced the original plugin after running into issue #1358.

@ruliane ruliane mentioned this issue Apr 5, 2021
@ruliane
Copy link
Contributor Author

ruliane commented Apr 5, 2021

The offending line was issued on 904a84e#diff-f38166d0e111b916a4b0263dd15076a3a05600b6a8a9407a9ad8ae2997e0e4b3R42

There may be a good reason not to reuse the previous line which was:
my $statefile = ($ENV{MUNIN_PLUGSTATE} || '/var/lib/munin-node/plugin-state/nobody/') . "/plugin-apt.state";

Should we roll back this line ?

@sumpfralle
Copy link
Collaborator

Thank you for your report!

In general munin plugins are not supposed to be executed directly.
Instead you should use munin-run - this will provide the relevant environment variables and other details.
Thus the above warning is to be expected. We could hide it, but this would just obscure the fact, that you are doing something, that you should not do :)

In this specific case you may be tempted to call the plugin directly, since it supported an update argument (for calling apt-get update). This is still possible for the plugin in the stable-2.0 branch, which you should use until munin v3 (master) is released.
I just clarified this detail in the documentation for the plugin in the master branch: #1394

If you want to update the apt_all plugin, then I would recommend to install the munin packages in the Debian backports repository for Buster. They are based on the stable-2.0 branch.

@ruliane
Copy link
Contributor Author

ruliane commented Apr 6, 2021

Thank you for your report!

In general munin plugins are not supposed to be executed directly.
Instead you should use munin-run - this will provide the relevant environment variables and other details.
Thus the above warning is to be expected. We could hide it, but this would just obscure the fact, that you are doing something, that you should not do :)

In this specific case you may be tempted to call the plugin directly, since it supported an update argument (for calling apt-get update). This is still possible for the plugin in the stable-2.0 branch, which you should use until munin v3 (master) is released.
I just clarified this detail in the documentation for the plugin in the master branch: #1394

If you want to update the apt_all plugin, then I would recommend to install the munin packages in the Debian backports repository for Buster. They are based on the stable-2.0 branch.

You're right! I was using the old "cronjob" update way with the new "cronjob-less" plugin.
Thank you for this clarification.

And I didn't even remind to use munin-run. Shame on me for that. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants