Snap refresh with no updates should be friendly about it

Bug #1588322 reported by Mark Shuttleworth
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snap Layer
Fix Released
Critical
Stuart Bishop
Snappy
Fix Released
Medium
Unassigned

Bug Description

When I try to refresh Krita which is already up to date I see this:

  $ snap refresh krita

  error: cannot perform the following tasks:
  - Download snap "krita" from channel "stable" (revision 1 of snap "krita" already installed)

This looks scary, because it says error. Perhaps we could say this for explicitly named snaps:

  $ snap refresh krita telegram firefox
  krita already up to date
  firefox (beta) updated
  telegram updated

So, I am explicitly giving a result for each named snap, and none of those are an error.

In the case of the general "snap refresh" we should only say something about snaps which have changes to apply:

  $ snap refresh
  firefox (beta) updated

In the case of a general snap refresh with no updates:

  $ snap refresh
  Good news, we're all up to date here

Tags: canonical-is
Leo Arias (elopio)
Changed in snappy:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Yeah, IIRC the branch that landed has it as

"All snaps up-to-date."

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

Typing just snap refresh with no updates just lists the snaps installed - same as typing snap list - is this also fixed with the updated branch?

Stuart Bishop (stub)
Changed in layer-snap:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Stuart Bishop (stub)
tags: added: canonical-is
Revision history for this message
Stuart Bishop (stub) wrote :

I think this is fatal in my snap layer for Juju. I'm going to have to ignore the error code and continue on, crossing my fingers it is harmless and not something like a network error.

I can't 'snap find' and parse the human readable output to see if updated versions are available, since it doesn't understand channels.

I can't blindly call 'snap refresh', as that just updates all snaps and doesn't let me switch channels or confinement options.

Changed in layer-snap:
status: In Progress → Triaged
Revision history for this message
Stuart Bishop (stub) wrote :

(the problem for the snap layer not being the error message, but that it returns a fatal error code making it useless for scripting)

Stuart Bishop (stub)
Changed in layer-snap:
status: Triaged → In Progress
Revision history for this message
Jacek Nykis (jacekn) wrote :

Unhelpful return codes were also reported as separate bugs: LP#1622782 and LP#1595064

Revision history for this message
Stuart Bishop (stub) wrote :

Worked around in the snap layer by sniffing the error message, which hopefully will not get localized.

Changed in layer-snap:
status: In Progress → Fix Released
Revision history for this message
Michael Vogt (mvo) wrote :

This has landed in snapd 2.18

Changed in snappy:
status: Confirmed → Fix Committed
Michael Vogt (mvo)
Changed in snappy:
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