Removing when an app is running results in a half removal

Bug #1571721 reported by Sergio Schvezov on 2016-04-18
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Snappy
High
Unassigned
snapd (Ubuntu)
High
Unassigned
Xenial
High
Unassigned

Bug Description

|-- sergiusens@lindon:~/source/github.com/sergiusens/telegram-snap (master *) --|
$ sudo snap remove telegram
[sudo] password for sergiusens:
[\] Remove snap "telegram" from the system
error: cannot perform the following tasks:
- Remove snap "telegram" from the system (remove /snap/telegram/100001/bin/Telegram: read-only file system)

|-- sergiusens@lindon:~/source/github.com/sergiusens/telegram-snap (master *) --|
$ sudo snap remove telegram
[|] Remove security profile for snap "telegram"
error: cannot perform the following tasks:
- Remove snap "telegram" from the system (remove /snap/telegram/100001/bin/Telegram: read-only file system)

I had an apps/telegram/command: telegram and it was running during the removal (it was not a daemon).

Samuele Pedroni (pedronis) wrote :

so the question is why we don't fail unmounting/don't get an error at unmount time;

either way we need to reason a bit how undo/bailout should look like if we fail early enough (right now there's no undo support in remove handling)

Michael Vogt (mvo) on 2016-04-20
Changed in snapd (Ubuntu Xenial):
status: New → Triaged
importance: Undecided → High
Tim Düsterhus (timwolla) wrote :

I think I was hit by the same bug. After trying to reboot the error message changes and I am neither able to install nor to remove the package:

[timwolla@~]sudo snap remove xkcd-webserver
error: can't remove "xkcd-webserver": cannot find mounted snap "xkcd-webserver" at revision 15
[timwolla@~ [1]]sudo snap install xkcd-webserver
error: can't install "xkcd-webserver": snap "xkcd-webserver" already installed

Michael Vogt (mvo) on 2016-04-26
Changed in snappy:
status: New → Triaged
importance: Undecided → High
milestone: none → sru-1
Michael Vogt (mvo) on 2016-05-03
Changed in snappy:
status: Triaged → Fix Committed
Changed in snapd (Ubuntu):
status: Triaged → Fix Committed
Changed in snapd (Ubuntu Xenial):
status: Triaged → Fix Committed

Hello Sergio, 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.3 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!

tags: added: verification-needed
Tim Düsterhus (timwolla) wrote :

@adconrad The update does not fix the issue, at least it does not if the installation already is wrecked:

[timwolla@~ [1]]dpkg -l 'snapd'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii snapd 2.0.3 amd64 Tool to interact with Ubuntu Core
[timwolla@~]sudo snap remove xkcd-webserver
error: cannot remove "xkcd-webserver": cannot find mounted snap "xkcd-webserver" at revision 15
[timwolla@~ [1]]sudo snap install xkcd-webserver
error: cannot install "xkcd-webserver": snap "xkcd-webserver" already installed

tags: added: verification-failed
removed: verification-needed
Gustavo Niemeyer (niemeyer) wrote :

Yes, it does not fix the installation if it is wrecked. It fixes the installation from getting wrecked.

Tim Düsterhus (timwolla) wrote :

@niemeyer
Is it possible to fix the wrecked installation then? I don't care if I lose any stored data or something like that, I stopped using Snap after I ran into this bug.

Steve Langasek (vorlon) wrote :

Based on Gustavo's comment, I'm marking this verification-done instead of verification-failed; it may not be a complete fix but it's a significant bugfix and improvement.

tags: added: verification-done
removed: verification-failed
John Lenton (chipaca) wrote :

@tim yes, run zyga's reset-state script from https://github.com/zyga/devtools/blob/master/reset-state

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package snapd - 2.0.3

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

  * New upstream micro release:
    - integration-tests, debian/tests: add unity snap autopkg test
    - snappy: introduce first feature flag for assumes: common-data-dir
    - timeout,snap: add YAML unmarshal function for timeout.Timeout
    - many: go into state.Retry state when unmounting a snap fails.
      (LP: #1571721, #1575399)
    - daemon,client,cmd/snap: improve output after snap
      install/refresh/remove (LP: #1574830)
    - integration-tests, debian/tests: add test for home interface
    - interfaces,overlord: support unversioned data
    - interfaces/builtin: improve the bluez interface
    - cmd: don't include the unit tests when building with go test -c
      for integration tests
    - integration-tests: teach some new trick to the fake store,
      reenable the app refresh test
    - many: move with some simplifications test snap building to
      snap/snaptest
    - asserts: define type for revision related errors
    - snap/snaptest,daemon,overlord/ifacestate,overlord/snapstate: unify
      mocking snaps behind MockSnap
    - snappy: fix openSnapFile's handling of sideInfo
    - daemon: improve snap sideload form handling
    - snap: add short and long description to the man-page
      (LP: #1570280)
    - snappy: remove unused SetProperty
    - snappy: use more accurate test data
    - integration-tests: add a integration test about remove removing
      all revisions
    - overlord/snapstate: make "snap remove" remove all revisions of a
      snap (LP: #1571710)
    - integration-tests: re-enable a bunch of integration tests
    - snappy: remove unused dbus code
    - overlord/ifacestate: fix setup-profiles to use new snap revision
      for setup (LP: #1572463)
    - integration-tests: add regression test for auth bug LP:#1571491
    - client, snap: remove obsolete TypeCore which was used in the old
      SystemImage days
    - integration-tests: add apparmor test
    - cmd: don't perform type assertion when we know error to be nil
    - client: list correct snap types
    - intefaces/builtin: allow getsockname on connected x11 plugs
      (LP: #1574526)
    - daemon,overlord/snapstate: read name out of sideloaded snap early,
      improved change summary
    - overlord: keep tasks unlinked from a change hidden, prune them
    - integration-tests: snap list on fresh boot is good again
    - integration-tests: add partial term to the find test
    - integration-tests: changed default release to 16
    - integration-tests: add regression test for snaps not present after
      reboot
    - integration-tests: network interface
    - integration-tests: add proxy related environment variables to
      snapd env file
    - README.md: snappy => snap
    - etc: trivial typo fix (LP:#1569892)
    - debian: remove unneeded /var/lib/snapd/apparmor/additional
      directory (LP: #1569577)

 -- Michael Vogt <email address hidden> Tue, 03 May 2016 07:51:57 +0200

Changed in snapd (Ubuntu Xenial):
status: Fix Committed → Fix 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.

Hello Sergio, 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!

tags: removed: verification-done
tags: added: verification-needed
Brian Murray (brian-murray) wrote :

Setting this to v-done since the only reason it showed up here was this changelog entry.

add integration test to verify fix for LP: #1571721

tags: added: verification-done
removed: verification-needed
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: Fix Committed → Fix Released
Michael Vogt (mvo) on 2016-11-29
Changed in snappy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers