collect-logs not ignoring when logs change while compressing; failing to fetch logs and breaking QA

Bug #1623678 reported by Ursula Junque
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Charm
Ursula Junque

Bug Description

Right now collect-logs is skipping tarball creation if tar returns something other than 0, which is the case when files change during tar creation.

In the past when that happened collect-logs would flat ignore the error and return, knowing this is fine. Recently collect-logs was modified to call tar with a new option, --warning=no-files-changed, and the mechanism to return in case the error is 1 was removed, resulting in empty logs.

One would expect that that --warning option would ignore the error, making tar return success, or 0. But according to tar manual that's not the case:
"Sometimes, while performing the requested task, GNU tar notices some conditions that are not exactly errors, but which the user should be aware of. When this happens, tar issues a warning message describing the condition. ***Warning messages are output to the standard error and they do not affect the exit code of tar command.***"

Log collection is working for some cases by luck, as there are retries and logs in one of the tries might be steady for that moment. But for some units that are struggling to connect to others, or continuously retrying juju hooks this is never true, and we end up without logs.

Related branches

Ursula Junque (ursinha)
information type: Proprietary → Public
affects: landscape-system-tests → landscape-charm
Ursula Junque (ursinha)
Changed in landscape-charm:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers