_refresh_store doesn't capture stderr in failure cases

Bug #2037315 reported by Adam Dyess
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Layer
In Progress
Undecided
Adam Dyess

Bug Description

The layer calls `snap refresh` but in the event of a failure doesn't log the reason for the failure.

```python
    hookenv.log("Refreshing {} from store".format(snapname))
    out = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
    print(out)
```

Doesn't catch subprocess.CalledProcessError which contains valid stderr that isn't logged

https://pastebin.ubuntu.com/p/vWKbTd824p/

It is LIKELY that retrying the snap refresh would complete successfully. We could use tenacity similar to `snap._install_store` to retry 3 times with 10s apart. Lets log each retry

Adam Dyess (addyess)
Changed in layer-snap:
assignee: nobody → Adam Dyess (addyess)
Revision history for this message
Adam Dyess (addyess) wrote :
Changed in layer-snap:
status: New → In Progress
Adam Dyess (addyess)
description: updated
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.