snap run fails to run, cannot find app "me" in "me"

Bug #1618085 reported by Stuart Bishop
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Medium
Unassigned

Bug Description

snap run does not work for me:

$ snap run postgresql-9-6 --shell
error: cannot find app "postgresql-9-6" in "postgresql-9-6"

This is quite possibly driver error, but the cli help fails to correctly document the command:

$ snap run --help
Usage:
  snap [OPTIONS] run [run-OPTIONS]

Run the given snap command with the right confinement and environment

Application Options:
      --version print the version and exit

Help Options:
  -h, --help Show this help message

[run command options]
          --shell run a shell instead of the command (useful for debugging)

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Does `snap run --shell postgresql-9-6` work any differently?

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

snap run --shell postgresql-9-6.psql works. It seems I need the name of one of the snaps' apps, which makes sense as different apps can have different plugs.

So I think this bug is just cli documentation and maybe fixing the confusing error message in the edge case where there is no foo.foo app in the foo snap.

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Ah, yes indeed, it needs an app. I also believe it needs options before positionals. You mention the error message should be improved, but it seems to me that it told you just that: "cannot find app[...]". How do you suggest that be improved?

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

I think the error message will be fine if the command line help is improved:

snap [OPTIONS] run [SNAP.APP] [ARGUMENTS]

Revision history for this message
ILIV (ivan-lezhnjov-iv) wrote :

snap run --shell $APP doesn't work for me, though.

$ snap run --shell postgresql-9-6
error: cannot find app "postgresql-9-6" in "postgresql-9-6"
$ snap --version
snap 2.16ubuntu3
snapd 2.16ubuntu3
series 16
ubuntu 16.04

Leo Arias (elopio)
Changed in snappy:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
ILIV (ivan-lezhnjov-iv) wrote :

As it was pointed out in #1636229 by Michael Hall (mhall119) it should be "snap run --shell <command name>" not <snap name>.

For example:

$ snap run --shell postgresql93.psql

which works for me.

Michael Vogt (mvo)
affects: snappy → snapd
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.