Comment 7 for bug 1824188

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

By editing /target/etc/environment and setting SNAPD_DEBUG=1 etc before rebooting into the new system, I get http://paste.ubuntu.com/p/jTQb2YHhq3/

You can see there snapd coming up and seeding the system, and you can also watch as pid 724 (snapd-seeded.service) polling, waiting for the seeding to be done. Grep for pid=724 to follow this one.

That seeding gets marked as done on the line

Apr 11 12:04:29 ubuntu snapd[2115]: daemon.go:296: DEBUG: pid=724;uid=0;socket=/run/snapd.socket; GET /v2/snaps/system/conf?keys=seed.loaded 37.034783ms 200

and then 724 stops, as it should. Right after it you start getting pid=3635 lines, which correspond to gnome-software (via a line in syslog saying «gnome-software[3635]: disabled plugins: dpkg, dummy, repos, epiphany»). gnome-software successfully queries snapd for featured and installed snaps (and if you start the gui, they're right there).

However you can _also_ see a pid=1825. That pid corresponds to gnome-initial-setup.

The single pid=1825 entry arrives _before snapd has seeded the system_, and in particular just as snapd has scheduled a restart. I can only assume that gnome-initial-setup gets back the list of snaps, then tries to do a find for featured snaps and fails (because snapd is restarting), and that is the point where it logs

Apr 11 12:03:46 ubuntu gnome-initial-s[1825]: Failed to get featured snaps: Failed to read from snapd: Error receiving data: Connection reset by peer

note that this is racy, and gnome-initial-setup could just as well have logged 'Failed to get installed snaps' when the initial query fails, but succeeded to get the featured snaps (and then would go on to break in interesting ways as it tries to look things up in a nil container).

In any case, two solutions:

1. retry queries when you get an error from querying snapd (as opposed to an error response). This is what the 'snap' client does: retries every 250ms for up to 5s.

2. wait for snapd to be loaded

even with (2), (1) should probably be done anyway (but it'll be harder to hit).