snappy install requires root or login, but doesn't tell you so

Bug #1574829 reported by Thomi Richards
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Wishlist
Unassigned
snapd (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned

Bug Description

A new user will try and run something similar to the following:

$ snap install foo

Only to be given this error message:

"error: access denied"

This isn't particularly friendly. They might then look at the help docs for the install command:

$ snap install -h
Usage:
  snap [OPTIONS] install [install-OPTIONS] <snap>

The install command installs and activates the named snap in the system.

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

[install command options]
          --channel= Install from this channel instead of the device's default
          --devmode Install the snap with non-enforcing security

...which never mentions the fact that this command requires root. I think two things should be tweaked here:

1) The error message when root access is not available should be something much nicer, perhaps "Error: 'snap install' requires root access. Please re-run with 'sudo snap install <packagename>'."

2) The help docs for 'snap install' shold mention at the top that this command requires root.

Michael Vogt (mvo)
Changed in snappy:
status: New → Triaged
importance: Undecided → Wishlist
milestone: none → sru-1
Revision history for this message
John Lenton (chipaca) wrote :

To make things more interesting, note you do *not* need root to install. Try:

   snap login you@email
   ...
   snap install http

Michael Vogt (mvo)
summary: - snappy install requires root, but doesn't tell you so
+ snappy install requires root or login, but doesn't tell you so
Revision history for this message
Michael Vogt (mvo) wrote :
Changed in snappy:
status: Triaged → In Progress
Michael Vogt (mvo)
Changed in snappy:
milestone: sru-1 → sru-2
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Thomi, or anyone else affected,

Accepted snapd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/snapd/2.0.5 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in snapd (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Federico Gimenez (fgimenez) wrote :

With the 2.0.5 package:

$ snap install hello-world
error: access denied (snap login --help)

$ snap login --help
Usage:
  snap [OPTIONS] login email

The login command authenticates on snapd and the snap store and saves credentials
into the ~/.snap/auth.json file. Further communication with snapd will then be made
using those credentials.

Login only works for local users in the sudo or admin groups.

An account can be setup at https://login.ubuntu.com

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

[login command arguments]
  email: login.ubuntu.com email to login as

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package snapd - 2.0.5

---------------
snapd (2.0.5) xenial; urgency=medium

  * New upstream release: LP: #1583085
    - interfaces: add dbusmenu, freedesktop and kde notifications to
      unity7 (LP: #1573188)
    - daemon: make localSnapInfo return SnapState
    - cmd: make snap list with no snaps not special
    - debian: workaround for XDG_DATA_DIRS issues
    - cmd,po: fix conflicts, apply review from #1154
    - snap,store: load and store the private flag sent by the store in
      SideInfo
    - interfaces/apparmor/template.go: adjust /dev/shm to be more usable
    - store: use purchase decorator in Snap and FindSnaps
    - interfaces: first version of the networkmanager interface
    - snap, snappy: implement the new (minmimal) kernel spec
    - cmd/snap, debian: move manpage generation to depend on an environ
      key; also, fix completion

snapd (2.0.4) xenial; urgency=medium

  * New upstream release:
    - interfaces: cleanup explicit denies
    - integration-tests: remove the ancient integration daemon tests
    - integration-tests: add network-bind interface test
    - integration-tests: add actual checks for undoing install
    - integration-tests: add store login test
    - snap: add certain implicit slots only on classic
    - integration-tests: add coverage flags to snapd.service ExecStart
      setting when building from branch
    - integration-tests: remove the tests for features removed in 16.04.
    - daemon, overlord/snapstate: "(de)activate" is no longer a thing
    - docs: update meta.md and security.md for current snappy
    - debian: always start snapd
    - integration-tests: add test for undoing failed install
    - overlord: handle ensureNext being in the past
    - overlord/snapstate,overlord/snapstate/backend,snappy: start
      backend porting LinkSnap and UnlinkSnap
    - debian/tests: add reboot capability to autopkgtest and execute
      snapPersistsSuite
    - daemon,snappy,progress: drop license agreement broken logic
    - daemon,client,cmd/snap: nice access denied message
      (LP: #1574829)
    - daemon: add user parameter to all commands
    - snap, store: rework purchase methods into decorators
    - many: simplify release package and add OnClassic
    - interfaces: miscellaneous policy updates
    - snappy,wrappers: move desktop files handling to wrappers
    - snappy: remove some obviously dead code
    - interfaces/builtin: quote apparmor label
    - many: remove the gadget yaml support from snappy
    - snappy,systemd,wrappers: move service units generation to wrappers
    - store: add method to determine if a snap must be bought
    - store: add methods to read purchases from the store
    - wrappers,snappy: move binary wrapper generation to new package
      wrappers
    - snap: add `snap help` command
    - integration-tests: remove framework-test data and avoid using
      config-snap for now
    - add integration test to verify fix for LP: #1571721

 -- Michael Vogt <email address hidden> Thu, 19 May 2016 15:29:16 +0200

Changed in snapd (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for snapd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.5 KiB)

This bug was fixed in the package snapd - 2.11+16.10

---------------
snapd (2.11+16.10) yakkety; urgency=medium

  * New upstream release: LP: #1605303
    - increase version number to reflect the nature of the update
      better
    - store, daemon, client, cmd/snap, docs/rest.md: adieu search
      grammar
    - debian: move snapd.refresh.timer into timers.target
    - snapstate: add daemon-reload to fix autopkgtest on yakkety
    - Interfaces: hardware-observe
    - snap: rework the output after a snap operation
    - daemon, cmd/snap: refresh --devmode
    - store, daemon, client, cmd/snap: implement `snap find --private`
    - tests: add network-observe interface spread test
    - interfaces/builtin: allow getsockopt for connected x11 plugs
    - osutil: check for nogrup instead of adm
    - store: small cleanups (more needed)
    - snap/squashfs: fix test not to hardcode snap size
    - client,cmd/snap: cleanup cmd/snap test suite, add extra args
      testThis cleans up the cmd/snap test suite:
    - wrappers: map "never" restart condition to "no."
    - wrappers: run update-desktop-database after add/remove of desktop
      files
    - release: work around elementary mistake
    - many: remove all traces of channel from the buying codepath
    - store: kill setUbuntuStoreHeaders
    - docs: add payment methods documentation
    - many: present user with a choice of payment backends
    - asserts: add cross checks for snap asserts
    - cmd/snap,cmd/snap-exec: support running hooks via snap-exec.
    - tests: improve snap run symlink tests
    - tests: add content sharing interface spread test
    - store & many: a mechanical branch shortening store names
    - snappy: remove old snappy pkg
    - overlord/snapstate: kill flagscompat
    - overlord/snapstate, daemon, client, cmd/snap: devmode override
      (aka confined)
    - tests: extend refresh test to talk to the staging and production
      stores
    - asserts,daemon: cross checks for account and account-key
      assertions
    - client: existing JSON fixtures uses tabs for indentation
    - snap-exec: add proper integration test for snap-exec
    - spread.yaml, tests: replace hello-world with test-snapd-tools
    - tests: add locale-control interface spread test
    - tests: add mount-observe interface spread test
    - tests: add system-observe interface spread test
    - many: add AuthContext to mediate user updates to the state
    - store/auth: add helper for the macaroon refresh endpoint
    - cmd: add buy command
    - overlord: switch snapstate.Update to use ListRefresh (aka
      /snaps/metadata)
    - snap-exec: fix silly off-by-one error
    - tests: stop using hello-world.echo in the tests
    - tests: add env command to test-snapd-tools
    - classic: remove (most of) "classic" mode, this is implemented as a
      snap now
    - many: remove snapstate.Candidate and other cleanups
    - many: removed authenticator, store gets a user instead
    - asserts: fix minor doc comment typo
    - snap: ensure unknown arguments to `snap run` are ignored
    - overlord/auth: add Device/SetDevice to persist device identity in
      state
    - overlord: make SyncBoot work aga...

Read more...

Changed in snapd (Ubuntu):
status: Confirmed → Fix Released
Michael Vogt (mvo)
Changed in snappy:
status: In Progress → 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.