Snap failures in 16.04

Bug #1659924 reported by Stuart Metcalfe
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
High
Unassigned

Bug Description

Fresh install of Ubuntu 16.04 LTS on VirtualBox 5.0.32. From first login, I do apt-get update/upgrade and then 'sudo snap install hello-world' resulting in the following error:

stuartm@snapcraftros:~$ sudo snap install hello-world
0 B / 20.00 KB [_______________________________________________________] 0.00 %

error: cannot perform the following tasks:
- Make snap "ubuntu-core" available to the system (no state entry for key)
- Mount snap "hello-world" (cannot find snap declaration for "hello-world": assertion not found)

Happens consistently in both Ubuntu Desktop 16.04 (64 bit) and Mate Desktop 16.04 (64 bit). Does not happen in Mate Desktop 16.10.

Revision history for this message
Stuart Metcalfe (stuartmetcalfe) wrote :

After that, ubuntu-core snap is installed but inoperable. Nothing else works:

stuartm@snapcraftros:~$ sudo snap install ubuntu-core
[sudo] password for stuartm:
error: snap "ubuntu-core" is already installed
stuartm@snapcraftros:~$ sudo snap install hello-world

error: cannot list snaps: cannot list local snaps! cannot find publisher details: assertion not found
stuartm@snapcraftros:~$ snap list
error: cannot list snaps: cannot list local snaps! cannot find publisher details: assertion not found

Revision history for this message
Stuart Metcalfe (stuartmetcalfe) wrote :

I am able to remove and re-install ubuntu-core which solves one problem but creates another:

stuartm@snapcraftros:~$ sudo snap remove ubuntu-core

Done
stuartm@snapcraftros:~$ sudo snap install ubuntu-core
76.13 MB / 76.13 MB [====================================>_] 100.00 % 2.39 MB/s

Name Version Rev Developer Notes
ubuntu-core 16.04.1 1411 canonical -
stuartm@snapcraftros:~$ sudo snap install hello-world
snap "hello-world" is already installed
stuartm@snapcraftros:~$ sudo snap remove hello-world
hello-world removed
stuartm@snapcraftros:~$ sudo snap install hello-world
hello-world 6.3 from 'canonical' installed
stuartm@snapcraftros:~$ hello-world
internal error, please report: running "hello-world" failed: no such file or directory
stuartm@snapcraftros:~$ /snap/hello-world/current/bin/echo
Hello World!

Revision history for this message
John Lenton (chipaca) wrote :

Hello!

Those errors are nasty, but they also don't make too much sense. Scratching our heads here a little.

Can you paste the output of "snap --version"?

The fact that installing hello-world pulls in ubuntu-core and not core means that your snapd isn't up to date; is your mirror up to date? you should have 2.21.

I just booted a 16.04 mate in KVM, ran it from the ISO (you ned 5G for the update/upgrade to finish), and it worked.

Revision history for this message
John Lenton (chipaca) wrote :

If you can reproduce this reliably, and the image with which you do it isn't too big for you to do so, could you make it available for download so we can take a look?

Revision history for this message
John Lenton (chipaca) wrote :

I've been able to reproduce your original error messages by booting a fresh 16.04 and not updating snapd.

Thank you for this!

Changed in snappy:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Stuart Metcalfe (stuartmetcalfe) wrote :

Yo! o/

stuartm@snapcraftros:~$ snap --version
snap 2.21
snapd 2.21
series 16
ubuntu 16.04

I can recreate the image and stick it up on Dropbox temporarily if it's still needed. It is quite a big file though so I'd prefer if you can do without it. Let me know.

Revision history for this message
John Lenton (chipaca) wrote :

I can do without it, thank you.

Revision history for this message
John Lenton (chipaca) wrote :

If you need to get this working, if starting from a fresh 16.04.1, first use "dpkg -l" to check your snapd version. update and upgrade and confirm it is 2.21; if it is 2.0.10 (or, really, anything less than 2.21) you need to figure out how to update it (check your mirror, etc).

Once it's on 2.21, and you're sure snapd has restarted, you should be able to install without issue.

If you "snap install" before the update has fully completed you'll hit this bug; the install updates core and restarts into the new one, and there's a bug in the migration of the install tasks.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

> If you "snap install" before the update has fully completed

John, this has me worried that our users may have the workflow:

- install from xenial-release.iso
- sudo apt-get update && sudo apt-get -u dist-upgrade # snapd updates here
- sudo snap login whatever
- sudo snap install pacakge

If the apt-get dist-upgrade can finish while the snapd upgrade happens asynchronously in the background this sounds like a race condition that we could very easily lose.

Thanks

Revision history for this message
John Lenton (chipaca) wrote :

I'm not saying this isn't a serious bug: we'll be fixing it for 2.23 (it's *just* too late for 2.22); what I described was a workaround to unblock you if needed.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1659924] Re: Snap failures in 16.04

On 28/01/17 00:57, Seth Arnold wrote:
> John, this has me worried that our users may have the workflow:

It's not just that; looking at the dashboard of versions, I think the
non-updated snapd is very widely in use. I wonder what the difference in
traction between security updates and non-security updates is? Perhaps
snapd 2.23 should go to -security after making it to -updates? There are
a lot of security improvements since 2.0.10.

Mark

Revision history for this message
Stuart Metcalfe (stuartmetcalfe) wrote :

After a fresh Ubuntu Desktop 16.04 install, followed by apt-get update/upgrade, the snapd version was still at 2.0.10. However, after manual removal and reinstallation of snapd, the version was updated to 2.21 and (following a reboot just to be absolutely sure) snapd indeed works as expected.

Thanks for the workaround!

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

On 28/01/17 13:53, Stuart
 wrote:
> After a fresh Ubuntu Desktop 16.04 install, followed by apt-get
> update/upgrade, the snapd version was still at 2.0.10. However, after
> manual removal and reinstallation of snapd, the version was updated to
> 2.21 and (following a reboot just to be absolutely sure) snapd indeed
> works as expected.

OK, there is something odd going on here that we need to get to the
bottom of. You should not have to remove and re-add. Could it be related
to various changes in dependencies (snap-confine, ubuntu-core-launcher etc)?

Mark

Revision history for this message
Stuart Metcalfe (stuartmetcalfe) wrote :

Not sure if this info is useful to you:

stuartm@test:~$ dpkg -l snapd snap-confine ubuntu-core-launcher
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.10 amd64 Tool to interact with Ubuntu Core
ii ubuntu-core-la 1.0.27.1 amd64 Launcher for ubuntu-core (snappy)
dpkg-query: no packages found matching snap-confine

stuartm@test:~$ sudo apt-get update && sudo apt-get upgrade
[sudo] password for stuartm:
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:2 http://gb.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://gb.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:4 http://gb.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 0s (496 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  gnome-software gnome-software-common liboxideqt-qmlplugin liboxideqtcore0
  liboxideqtquick0 linux-generic linux-headers-generic linux-image-generic
  oxideqt-codecs snapd ubuntu-core-launcher ubuntu-software

There's probably a better way to force-update a held-back package but I'm not familiar it so I went with the heavy handed approach of remove/install.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

I think the point though is that we have wedged most of our users and
need to get them unwedged.

Mark

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

Perhaps changing dependencies from ubuntu-core-launcher to snap-confine put snapd into the "requires dist-upgrade" bucket?

Revision history for this message
Adam Conrad (adconrad) wrote :

Yeah, "apt-get upgrade" will never pull in new dependencies. This is a long-standing apt feature, working as intended, and I'm not sure when people became socialized to either only use "upgrade" or to ignore the held packages and not try "dist-upgrade", but here we are (I'm not going to argue that apt couldn't perhaps print a helpful "maybe you want to try dist-upgrage, and carefully check the suggested changes before accepting them" message, but adding output like that to stdout that people sometimes think they can reliably parse is an extra bucket of unfun).

At the command-line, there's no way out of this except to rename the packages back from snap-confine to ubuntu-core-launcher again (which, hilariously, would make the people who HAVE upgraded be in this "need dist-upgrade" situation, but odds are if they upgraded successfully, it's because they already use dist-upgrade, or use a frontend that allows new package additions by default, like update-manager or unattended-upgrades).

Revision history for this message
Adam Conrad (adconrad) wrote :

(Out of scope for this bug, but a note here to have a wider discussion/brainstorm about it, I'm mildly terrified that if "apt-get upgrade" is a common thing, people aren't getting kernel updates either, as they depend on pulling in new packages... It would be a huge departure in behaviour, but maaaaybe apt-get upgrade should be changed to use update-manager's "new packages are okay, removing packages isn't" policy)

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

@adconrad - fwiw, if only people would use "apt upgrade" - this sets Binary::apt::APT::Get::Upgrade-Allow-New=true which is the behaviour we want (new-package-are-ok-but-removals-are-not).

Revision history for this message
Oliver Grawert (ogra) wrote :

cant we just merge snap-confine into snapd ? (i think that was planned anyway for the future)

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

Yes, the snap-confine merger is important so we don't get version skew.
That should address the ubuntu-core-launcher issue. But we'll have a
similar issue with xdelta3, soon, w.r.t. new dependencies of snapd.

However, Adam has a point about kernel upgrades.

I think we should figure out how to converge policy between 'apt-get
upgrade' and 'apt upgrade' (which I had always assumed to be
synonymous). It's awkward that simply "doing updates" the obvious way
with the different tools (update-manager, apt, apt-get) results in quite
different outcomes. Cleaning up that awkwardness is worthwhile. We know
the updates *work* (because lots of people are getting them from using
some of those update approaches) and the divergence is surprising - most
people won't know the detail that Adam knows.

Mark

Revision history for this message
Adam Conrad (adconrad) wrote :

@ogra, that is indeed the plan, and mvo has branches in flight to do so.

Revision history for this message
benlebowski (daemqn) wrote :

same pb here :

fresh ubuntu 16.04 LTS x64 installed and up to date

lebowski@EliteBook-2570p:~$ dpkg -l | grep snapd

ii snapd 2.0.10 amd64 Tool to interact with Ubuntu Core Snappy.
If you need more logs, test, ping me ;)

Revision history for this message
Adam Conrad (adconrad) wrote :

@benlebowski, you're by definition not up to date. As discussed previously in this thread, try "apt-get dist-upgrade" (I suspect you're updating with "apt-get upgrade"?)

Revision history for this message
benlebowski (daemqn) wrote :

@adconrad
thanks Adam, indeed, yes.
"I should read the thread entirely before posting crap" ;)

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

This is scheduled to be fixed in 2.23, we already merged snap-confine into snapd itself, so "apt-get upgrade" is happy because it does not need to add/remove any packages.

The (current) xdelta3 dependency in master will get removed and we will use xdelta3 from the core snap for the delta downloads (this is done in https://github.com/snapcore/snapd/pull/2791). Once this lands the apt-get upgrade will work correctly.

Changed in snappy:
status: Confirmed → In Progress
Revision history for this message
Michael Vogt (mvo) wrote :

There is a second part to this bug, we need to check that re-exec of 2.0.10 to 2.23 works correctly (i.e. the case when the user does not do any apt-get upgrade). This is not done yet.

Revision history for this message
Fixitman Arizona (fixitmanarizona) wrote :

apt get upgrade to a new kernal is not an option. Nor backports. Many people only install stable software that has been around at least a year or two, for example, Xubuntu 16.04 instead of the "latest" such as 16.10 or the upcoming 17.04, which are both basically test editions for the next release. Why? because it has support for 3 years, instead of 9 months. Yes, it's based on Debian Unstable, already, but is at least tested & released for long-term use! I tried Debian Stable and basically found, it wasn't! (yes there's some error in terms there and sarcasm)
This said, this whole snap thing is not ready for prime-time. until there is a GUI that controls downloading snaps and installing and running them automatically, this technology is in its infancy, except, apparently on mobile phones. Not ready for desktops, unless, I suppose you are running a phone in a virtual box?
Very few users are going to bother doing this.. mainly developers. (And no, I'm not one.)

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This has been fixed long ago so I'm marking it as fix released.

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.