Unable to install any application from Snap Store

m fairly new to linux Ubuntu and i was trying to install a few apps from the snap store. Im using Ubuntu since a month and have played around a bit and reinstalled Ubuntu again. On my new installation the ubuntu store is not working at all with my broadband connection through a wifi adapter. However if i use my Phone’s Sim Card data then the store works fine and im even able to do snap refresh without errors. I understand that there is some problem with the network itself but i did not face any issue with the same network on the same adapter on the previous installation of Ubuntu.

Currently if i do snap refresh this is what i get: error: cannot refresh: cannot query the store for updates: got unexpected HTTP status code 408 via POST to “https://api.snapcraft.io/v2/snaps/refresh

Getting same error in the store as well. Although i was able to install a few apps initially right after the installation. My network speed on 5G: 131.9 Megabits per second

Im clueless! Thanks in advance.

1 Like

Exactly the same here.

I need a solution. I’m only use Snaps because I have to.

Watching Wireshark it’s pretty clear that the servers are being contacted periodically, but nothing is ever achieved (and nothing in the syslog).

What is the process of this “Device initialisation”? Does it need the server to do something?

7    Doing   yesterday at 22:28 BST  -                       Initialise device

As the request is sent over HTTPS I can’t see what data is actually being sent/received.

error: cannot install "vlc": cannot query the store for updates: got unexpected HTTP status code
       408 via POST to "https://api.snapcraft.io/v2/snaps/refresh"

Is it trying to authenticate? Should it be trying? Is my machine given a GUID and it authenticates with that? What is it doing?

$ sudo snap debug state /var/lib/snapd/state.json
ID   Status  Spawn                   Ready                   Label               Summary
1    Done    yesterday at 21:37 BST  yesterday at 21:38 BST  seed                Initialize system state
2    Done    yesterday at 21:38 BST  yesterday at 21:40 BST  install-snap        Install "openra" snap
3    Done    yesterday at 21:38 BST  yesterday at 22:28 BST  become-operational  Initialise device
4    Done    yesterday at 21:41 BST  yesterday at 21:42 BST  install-snap        Install "anbox" snap from "edge" channel
5    Done    yesterday at 21:44 BST  yesterday at 21:44 BST  install-snap        Install "node" snap from "18/stable" channel
6    Done    yesterday at 21:45 BST  yesterday at 21:46 BST  install-snap        Install "code" snap
7    Doing   yesterday at 22:28 BST  0000-12-31              become-operational  Initialise device
$ snap debug timings 7
ID   Status        Doing      Undoing  Summary
133  Doing     4732059ms            -  Request device serial
 ^                6153ms            -    get device serial
  ^                705ms            -      prepare device serial request
  ^               5447ms            -      submit device serial request
132  Done          550ms            -  Generate device key
$ snap tasks 7
Status  Spawn                   Ready                   Summary
Done    yesterday at 22:28 BST  yesterday at 22:28 BST  Generate device key
Doing   yesterday at 22:28 BST  -                       Request device serial

......................................................................
Request device serial

2022-05-23T20:41:03+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:42:10+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:43:18+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:44:26+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:45:33+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:46:42+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:47:49+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:48:58+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:50:05+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF
2022-05-23T20:51:12+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF

I also have this exact error, and effectively can’t refresh snaps at all, it is 100% repeatable and it depends on what snaps are installed.

It refreshes without a problem if I have only one small snap installed, but immediately stops working for example if I install firefox.

I’m on Kubuntu 22.04.

Here is a relevant log fragment of snapd, with DEBUG turned on:

Feb 19 01:39:49 nyks snapd[4148]: store_action.go:541: DEBUG: Deltas enabled. Adding header Snap-Accept-Delta-Format: xdelta3
Feb 19 01:39:49 nyks snapd[4148]: retry.go:50: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 1, elapsed time=4.112µs
Feb 19 01:39:49 nyks snapd[4148]: store.go:785: DEBUG: cannot set device session: no device serial yet
Feb 19 01:39:49 nyks snapd[4148]: retry.go:62: DEBUG: The retry loop for https://api.snapcraft.io/v2/snaps/refresh finished after 1 retries, elapsed time=287.533185ms, status: 200
Feb 19 01:39:49 nyks snapd[4148]: store_action.go:541: DEBUG: Deltas enabled. Adding header Snap-Accept-Delta-Format: xdelta3
Feb 19 01:39:49 nyks snapd[4148]: retry.go:50: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 1, elapsed time=3.006µs
Feb 19 01:39:49 nyks snapd[4148]: store.go:785: DEBUG: cannot set device session: no device serial yet
Feb 19 01:39:54 nyks snapd[4148]: retry.go:180: DEBUG: Retrying because of: EOF (EOF)
Feb 19 01:39:54 nyks snapd[4148]: retry.go:113: DEBUG: ShouldRetryError: EOF *errors.errorString -> true
Feb 19 01:39:54 nyks snapd[4148]: retry.go:50: DEBUG: Retrying https://api.snapcraft.io/v2/snaps/refresh, attempt 2, elapsed time=5.001999817s
Feb 19 01:39:54 nyks snapd[4148]: store.go:785: DEBUG: cannot set device session: no device serial yet
Feb 19 01:39:59 nyks snapd[4148]: retry.go:62: DEBUG: The retry loop for https://api.snapcraft.io/v2/snaps/refresh finished after 2 retries, elapsed time=10.265259231s, status: 408
Feb 19 01:39:59 nyks snapd[4148]: daemon.go:217: DEBUG: pid=109370;uid=0;socket=/run/snapd.socket; POST /v2/snaps 10.558063781s 400

Also - errors such as these repeat periodically in snapd's log:

Feb 19 01:39:15 nyks snapd[4148]: taskrunner.go:461: DEBUG: Running task 18 on Doing: Request device serial
Feb 19 01:39:20 nyks snapd[4148]: task.go:345: DEBUG: 2023-02-19T01:39:20+01:00 ERROR cannot deliver device serial request: Post https://api.snapcraft.io/api/v1/snaps/auth/devices: EOF

Hi Kenway/RefreshingSnapper/tiangou,

Are you still experiencing the reported issue?

Variably, but a lot less often.

(apart from kenway’s setup) Are there any obvious complexities with your network setup (firewalls, proxies, enterprise setup etc)?

Nothing unusual.

Ethernet connection to the router which started as a DSL connection, and then I moved to a cable modem. Inbound firewall enabled on the router(s), no firewall on the machine. No outbound blocks of any kind.

It wouldn’t work for months on end. Then one day it did. The server always responds to ping.

Sorry for the bump but heres the solution i posted