prime cleanup needs to be robust and warn about inconsistencies

Bug #1813033 reported by Sergio Schvezov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Claudio Matsuoka

Bug Description

Fix SNAPCRAFT-C4 (https://sentry.io/share/issue/df89a85391f346b6b1cc6fd3a1c69b81/) by catching the exception with a logger.warning about inconsistencies in the `directory` (when it is stage or prime).

Revision history for this message
Claudio Matsuoka (cmatsuoka) wrote :

A simple way to handle this issue would be to warn the user about inconsistencies (e.g. primed or staged files manually deleted from another part) and ignore the missing file instead of halting and catching fire. Handling of inconsistent directories need a bit of attention however since it might be simply missing, or incorrectly populated -- so catch appropriate exceptions to issue warnings accordingly.

Changed in snapcraft:
assignee: nobody → Claudio Matsuoka (cmatsuoka)
status: New → In Progress
Revision history for this message
Claudio Matsuoka (cmatsuoka) wrote :

I ran a few tests simulating a number of inconsistent scenarios (file missing, directory missing, and file manually added to existing directory in override-prime). File and directory missing are now handled with a warning message, and no special handling is necessary for manually added files (clean part already handles it correctly and doesn't raise an exception on os.rmdir(), as I originally thought). Will add the regression tests and issue a PR.

Changed in snapcraft:
importance: Undecided → High
milestone: none → 3.1.1
Revision history for this message
Kyle Fazzari (kyrofa) wrote :
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
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.