munin-node: apt_all does not Grok Ubuntu (possible regression)

Bug #1038044 reported by Martin Jackson
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
munin (Debian)
Fix Released
Unknown
munin (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

/usr/share/munin/plugins/apt_all is hard-coded to look for releases "stable", "testing", "unstable" which Ubuntu doesn't use. A very similar problem was reported before in bug 245031; is it possible that the patch that fixed that bug was dropped somehow?

Tags: patch
Revision history for this message
Martin Jackson (mhjacks) wrote :

I have checked the source for the versions in both 12.04 and Quantal and I see the same behavior. I'm decent at Perl; I hope to be able to submit a patch tonight.

Daniel Hahler (blueyed)
description: updated
Revision history for this message
Daniel Hahler (blueyed) wrote :

The relevant patch appears to be: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/karmic/munin/karmic/revision/15/debian/patches/221-apt-ubuntu-changes.patch

I think that this should be generalized to work also with Debian by default (and then incorporated there) or it needs to get added to the merge of 2.0.5 for munin (which has to be done still AFAICS).

Changed in munin (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Martin Jackson (mhjacks) wrote :

Here is a patch to discover the distributor and codename. It will work for Debian and Ubuntu; it is my hope that this would be accepted upstream.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to discover distributor and determine releases for apt_all munin plugin" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Daniel Hahler (blueyed) wrote :

Thanks for your patch!

You might want to handle the case where lsb_release is not installed/executable and then fallback to the Debian default instead of exiting.
(I do not know if the dependency of lsb_release is fulfilled when installing munin-node)

Apart from that the patch looks decent and you might want to submit it upstream (to Debian) directly: http://bugs.debian.org/munin-node - it would be fine to get it committed to Ubuntu first and then forward it to Debian though (e.g. via submittodebian).

Revision history for this message
Martin Jackson (mhjacks) wrote : Re: [Bug 1038044] Re: munin-node: apt_all does not Grok Ubuntu (possible regression)

On 08/18/2012 04:34 PM, Daniel Hahler wrote:
> Thanks for your patch!
>
> You might want to handle the case where lsb_release is not installed/executable and then fallback to the Debian default instead of exiting.
> (I do not know if the dependency of lsb_release is fulfilled when installing munin-node)
>
> Apart from that the patch looks decent and you might want to submit it
> upstream (to Debian) directly: http://bugs.debian.org/munin-node - it
> would be fine to get it committed to Ubuntu first and then forward it to
> Debian though (e.g. via submittodebian).
>
Thanks, Daniel.

I'm reworking the patch a bit as with further testing, there are places
where update_state is called without having run the new
determine_releases sub. I will also include your suggestion. I will
submit a new version this weekend.

Thanks,

Marty

Revision history for this message
Martin Jackson (mhjacks) wrote :

Updated patch:

1) Include call to determine_releases() inside update_state() sub, as several code paths need it
2) Default to Debian-specific behaviors if lsb_release is not Ubuntu (at Daniel's suggestion)

Revision history for this message
Martin Jackson (mhjacks) wrote :

Standby. In leaving this running overnight, it throws errors (or at least warnings) if all categories are not actually enabled - as it turns out, I haven't enabled "-proposed" on my firewalls. I need to rethink the release determination mechanism slightly to account for this. One more iteration of the patch, I think, will be needed - I should get the fix in today, and I will let it run overnight to make sure there are no unpleasant surprises.

Revision history for this message
Martin Jackson (mhjacks) wrote :

Update patch:

1) Query potential releases with -t $release prior to updating status

Revision history for this message
Martin Jackson (mhjacks) wrote :

I have installed this on my test systems (mixture of Debian and Ubuntu), and will post after this has run a few hours. There should be no unexpected cron spam. If there isn't, I would request that the patch be reviewed again and considered for inclusion in Ubuntu.

Clearly the fix part of this needs to get into Ubuntu; I would kind of like for this to go upstream as well, definitely to Debian and if possible to the main munin project. When (if?) the patch is adopted in Ubuntu I will submit it to munin. I know there are other apt-based distributions; what upstream wants may be different.

Revision history for this message
Martin Jackson (mhjacks) wrote :

OK, it has run overnight, and the update behavior is precisely what I would expect (no cron spam). However, it is not drawing the graphs for the number of pending packages (claiming it is missing a label). I need to investigate this behavior a bit further.

Revision history for this message
Martin Jackson (mhjacks) wrote :

OK, I have modified all the places that use the release name, and the graph is being drawn, but the graphs look...strange. Not all of the categories show up and those that do all report zero packages pending. When telnet'ing to 4949 fetch apt_all reports the right info, so someone with more munin-fu than I have should probably look at this.

I should mention that on my Debian system the graphing works as expected.

Revision history for this message
Thomas A. F. Thorne (tafthorne) wrote :

I had a look in the Debian bug system for a matching bug but could not find one.
The closest thing I could find was Bug#314610: munin-node: wrong regexp in apt_all
https://groups.google.com/forum/#!search/group$3Alinux.debian.bugs.dist$20munin$20apt_all/linux.debian.bugs.dist/Ik8xTKQnOAw/h2EUbNEh0I0J
However that addresses a different issue in a similar area of code. Not the same bug.

In the Munin project the closest thing I can identify is #927 Ability to use custom APT releases in apt_all.in plugin
http://munin-monitoring.org/ticket/927
If that ticket was completed then a `custom_releases` environment variable would exist that could be used to set the relevant names.

I note that this has sat for 3 years without any further activity. Is there something I could do to help move it along? My Perl is not fantastic but it might be good enough to help out in some way.

Revision history for this message
Lars Kruse (devel-sumpfralle) wrote :

Just for your information:
* There is a merge request for solving this issue (i.e. determining the set of suitable release names) without `lsb_release`: https://github.com/munin-monitoring/munin/pull/1128.
* The related Debian issue is d#715141 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715141).

Changed in munin (Debian):
importance: Undecided → Unknown
status: New → Unknown
Changed in munin (Debian):
status: Unknown → Confirmed
Changed in munin (Debian):
status: Confirmed → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Ubuntu 19.04 has entered Feature Freeze already.
Given the (embarrassing) age of the bug and it's rather low priority I think it will not drive a Feature Freeze exception. But we can easily fix this in early 19.10 by syncing the most recent package as the only Ubuntu Delta we have for bug 1770569 is also in Debian in the meantime.
Therefore making this a sync will resolve the issue.

I've taken a note to do so once 19.10 opens up - and since it seems so close at least discuss with others if this shouldn't be synced now even for 19.04 (FF being the only blocker as mentioned).

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI: I filed bug 1818208 to check if we would be allowed to still sync it now or if we have to wait for 19.10

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The latest version got merged in Disco - this is fixed in https://launchpad.net/ubuntu/+source/munin/2.0.47-1ubuntu3

Changed in munin (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Thomas A. F. Thorne (tafthorne) wrote :

Thank you for taking the time to get this through Christian.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.