EOF from api.snapcraft.io

Hi,
I have quite the same error but while dealing with snapcraft. I got an error for “snap find” or “snap install”. I am able to ping google. snapd (2.37.4) is running.
I’m running Ubuntu Core on Raspberry.

Here is what I get:

$ snap find edgexfoundry
error: Get
       https://api.snapcraft.io/api/v1/snaps/search?confinement=strict&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=edgexfoundry&scope=wide:
       EOF

And for an snap install:

$ snap install edgexfoundry
error: cannot install "edgexfoundry": Post https://api.snapcraft.io/v2/snaps/refresh: EOF

Any idea?

It looks like your network might be having trouble. Can you see anything interesting in journalctl -u snapd?

Nothing interesting:

$ sudo journalctl -u snapd
-- Logs begin at Fri 2019-03-15 14:18:00 UTC, end at Fri 2019-03-15 16:50:54 UTC. --
Mar 15 14:33:54 localhost systemd[1]: Starting Snappy daemon...
Mar 15 14:33:56 localhost snapd[700]: AppArmor status: apparmor is enabled and all features are available
Mar 15 14:33:57 localhost snapd[700]: daemon.go:379: started snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2.
Mar 15 14:33:57 localhost systemd[1]: Started Snappy daemon.
Mar 15 14:49:15 localhost systemd[1]: Stopping Snappy daemon...
Mar 15 14:49:15 localhost snapd[700]: main.go:147: Exiting on terminated signal.
Mar 15 14:49:15 localhost systemd[1]: Stopped Snappy daemon.
Mar 15 14:49:15 localhost systemd[1]: Starting Snappy daemon...
Mar 15 14:49:15 localhost snapd[1585]: AppArmor status: apparmor is enabled and all features are available
Mar 15 14:49:15 localhost snapd[1585]: daemon.go:379: started snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2.
Mar 15 14:49:16 localhost systemd[1]: Started Snappy daemon.
Mar 15 15:03:57 localhost snapd[1585]: api.go:1077: Installing snap "edgexfoundry" revision unset
Mar 15 15:06:12 localhost systemd[1]: Stopping Snappy daemon...
Mar 15 15:06:12 localhost snapd[1585]: main.go:147: Exiting on terminated signal.
Mar 15 15:06:12 localhost systemd[1]: Stopped Snappy daemon.
Mar 15 15:06:12 localhost systemd[1]: Starting Snappy daemon...
Mar 15 15:06:12 localhost snapd[1994]: AppArmor status: apparmor is enabled and all features are available
Mar 15 15:06:12 localhost snapd[1994]: daemon.go:379: started snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2.
Mar 15 15:06:12 localhost systemd[1]: Started Snappy daemon.
Mar 15 15:06:15 localhost snapd[1994]: api.go:1077: Installing snap "edgexfoundry" revision unset
Mar 15 15:12:26 localhost snapd[1994]: api.go:1077: Installing snap "edgexfoundry" revision unset

try enabling debug in snapd:
drop the following in /etc/systemd/system/snapd.service.d/debug.conf (you might need to create the directory first):

[Service]
Environment=SNAPD_DEBUG=1 SNAPD_DEBUG_HTTP=7

followed by systemctl daemon-reload && systemctl restart snapd.service

Here is the result of sudo journalctl -u snapd with debug option:

Mar 15 17:08:33 localhost snapd[4330]: AppArmor status: apparmor is enabled and all features are available
Mar 15 17:08:33 localhost snapd[4330]: daemon.go:379: started snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2.
Mar 15 17:08:33 localhost snapd[4330]: main.go:82: DEBUG: Setting up sd_notify() watchdog timer every 2m30s
Mar 15 17:08:33 localhost snapd[4330]: main.go:141: DEBUG: activation done in 233ms
Mar 15 17:08:33 localhost snapd[4330]: autorefresh.go:255: DEBUG: Next refresh scheduled for 2019-03-15 18:46:37.981450305 +0000 UTC.
Mar 15 17:08:33 localhost systemd[1]: Started Snappy daemon.
Mar 15 17:09:18 localhost snapd[4330]: api.go:1077: Installing snap "edgexfoundry" revision unset
Mar 15 17:09:18 localhost snapd[4330]: store.go:2235: DEBUG: Deltas enabled. Adding header Snap-Accept-Delta-Format: xdelta3
Mar 15 17:09:18 localhost snapd[4330]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 1, elapsed time=39.584µs
Mar 15 17:09:18 localhost snapd[4330]: logger.go:67: DEBUG: > "POST /v2/snaps/refresh HTTP/1.1\r\nHost: api.snapcraft.io\r\nUser-Agent: snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2\r\
Mar 15 17:09:18 localhost snapd[4330]: retry.go:119: DEBUG: Retrying because of: EOF
Mar 15 17:09:18 localhost snapd[4330]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 2, elapsed time=350.300417ms
Mar 15 17:09:18 localhost snapd[4330]: logger.go:67: DEBUG: > "POST /v2/snaps/refresh HTTP/1.1\r\nHost: api.snapcraft.io\r\nUser-Agent: snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2\r\
Mar 15 17:09:18 localhost snapd[4330]: retry.go:119: DEBUG: Retrying because of: EOF
Mar 15 17:09:19 localhost snapd[4330]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 3, elapsed time=1.225297396s
Mar 15 17:09:19 localhost snapd[4330]: logger.go:67: DEBUG: > "POST /v2/snaps/refresh HTTP/1.1\r\nHost: api.snapcraft.io\r\nUser-Agent: snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2\r\
Mar 15 17:09:19 localhost snapd[4330]: retry.go:119: DEBUG: Retrying because of: EOF
Mar 15 17:09:21 localhost snapd[4330]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 4, elapsed time=3.412774114s
Mar 15 17:09:21 localhost snapd[4330]: logger.go:67: DEBUG: > "POST /v2/snaps/refresh HTTP/1.1\r\nHost: api.snapcraft.io\r\nUser-Agent: snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2\r\
Mar 15 17:09:21 localhost snapd[4330]: retry.go:119: DEBUG: Retrying because of: EOF
Mar 15 17:09:27 localhost snapd[4330]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 5, elapsed time=8.881599216s
Mar 15 17:09:27 localhost snapd[4330]: logger.go:67: DEBUG: > "POST /v2/snaps/refresh HTTP/1.1\r\nHost: api.snapcraft.io\r\nUser-Agent: snapd/2.37.4 (series 16) ubuntu-core/18 (armhf) linux/4.15.0-1032-raspi2\r\
Mar 15 17:09:27 localhost snapd[4330]: retry.go:119: DEBUG: Retrying because of: EOF

Ok, it’s probably a DNS problem:

$ ping https://snapcraft.io/
ping: https://snapcraft.io/: Name or service not known

So it seems only google can be resolved

Yet I already set my DNS manually. I think the problem might come from Kura already running and messing with the network config.

[EDIT] I can actually ping api.snapcraft.io