'snap run --shell snap.hello-world.env' tries to read /snap/snap/current

Bug #1648478 reported by Jamie Strandboge
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Low
Unassigned

Bug Description

If I invoke snap run --shell accidentally with 'snap.' I get a confusing error message:

$ snap run --shell snap.hello-world.env
error: cannot find current revision for snap snap: readlink /snap/snap/current: no such file or directory

snappy correctly bailed but I think the message could be improved with a little input validation. Perhaps check if the specified command meets the regex for $SNAP_NAME.$COMMAND and then if it doesn't, output:

$ snap run --shell snap.hello-world.env
error: could not find 'snap.hello-world.env'. Please specify 'snap run --shell <snap name>.<command>'

or something similar.

Tags: papercut
description: updated
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is still happening as Jamie described. I think it is a papercut, marking the bug as such.

affects: snappy → snapd
Changed in snapd:
status: New → Confirmed
importance: Undecided → Low
tags: added: papercut
Revision history for this message
Ian Johnson (anonymouse67) wrote :

I think the priority of this should be raised somewhat, because this also happens when a snap is disabled and you try to run it:

```
$ snap disable mari0
mari0 disabled
$ snap run mari0
error: cannot find current revision for snap mari0: readlink /snap/mari0/current: no such file or directory
```

Revision history for this message
Michael Vogt (mvo) wrote :

I think there are two parts to this:

1. better error if the command does not look like a valid snap app
2. better error if the snap is disabled or not installed

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.