[SRU] virtlogd not rotating logs properly

Bug #2072647 reported by David Negreira
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Status tracked in Oracular
Noble
In Progress
Undecided
David Negreira
Oracular
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 When one enables max_age_days on /etc/libvirt/virtlogd.conf, for example by setting it to max_age_days = 1, the log files are not rotated correctly and we see this error on virtlogd:

[Test Case]

1) Launch a couple of dummy VMs to ensure that there are some logs in /var/log/libvirt
2) Edit /etc/libvirt/virtlogd.conf and ensure that the max_age_days setting is uncommented as per the following:
   max_age_days = 1
3) sudo systemctl restart virtlogd
4) Wait 24 hours. (There is no way to accelerate the timer unless one edits the source code)
5) Verify that logs are cleaned up and there are no errors in syslog or virtlogd journal like the following:
   Feb 28 08:58:57 dixie virtlogd[7205]: internal error: Failed to parse rotated index from ''

[Where problems could occur]

There could be some issues with virtlogd, but the code path only executes when max_age_days is different than 0.
 In the event of a regression, one could disable the setting by commenting max_age_days.

Tags: patch
Changed in libvirt (Ubuntu Noble):
assignee: nobody → David Negreira (dnegreira)
Changed in libvirt (Ubuntu):
assignee: nobody → David Negreira (dnegreira)
description: updated
summary: - virtlogd not rotating logs properly
+ [SRU] virtlogd not rotating logs properly
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lp2072647-libvirt.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Heitor Alves de Siqueira (halves) wrote :

Thanks for the patch, David!

I think this needs to target Oracular as well, right? I'm adding that to the bug, and will unsubscribe ~ubuntu-sponsors as devel needs to be fixed first.

Once you have uploaded a debdiff or MR for Oracular, feel free to re-subscribe the ~ubuntu-sponsors team.

Changed in libvirt (Ubuntu Noble):
status: New → In Progress
Changed in libvirt (Ubuntu Oracular):
status: New → In Progress
Revision history for this message
David Negreira (dnegreira) wrote :

debdiff for noble

Revision history for this message
David Negreira (dnegreira) wrote :

debdiff for oracular

Revision history for this message
David Negreira (dnegreira) wrote :

Hi Heitor
Thanks for your comment/review, I have now added a debdiff for oracular as well as modified the the origin to point to the commit where the fix is done upstream, so this is now ready to be reviewed again, hence I re-subscribed ubuntu-sponsors.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Hi, the libvirt merge for Oracular is under way and should come out soon. I say let's just wait for the merge, and then we can process the noble SRU.

Revision history for this message
Dan Bungert (dbungert) wrote :

Marking fix released for Oracular, as this is present in upstream and released for Oracular in the version 10.5.0-1ubuntu1 upload.

Changed in libvirt (Ubuntu Oracular):
status: In Progress → Fix Released
assignee: David Negreira (dnegreira) → nobody
Revision history for this message
Dan Bungert (dbungert) wrote :

Looking at this bug, it's almost ready for upload, but I'd suggest a changelog tweak. I like to focus on the symptom of the issue to make it easier for users who want to understand the changelog - something about "internal error: Failed to parse rotated index" maybe, as the relationship to max_age_days may not be immediately obvious. What do you think?

Revision history for this message
David Negreira (dnegreira) wrote :
Revision history for this message
David Negreira (dnegreira) wrote :

Hi Mitchel,

Thanks for the update. I'm happy to hear the fix is now in Oracular.

Dan, I have now uploaded a debdiff with a different changelog. Let me know if the format is okay.

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.