Cannot update old device

I found an old NextCloud box in the loft. I plugged it in, and it worked briefly. I managed to get SSH access and have got it online, but it refuses to process any snap refreshes.

How can I get this to update?

popey@localhost:~$ snap refresh
error: cannot communicate with server: Post http://localhost/v2/snaps: EOF
popey@localhost:~$ snap version
snap    2.24
snapd   2.24
series  16
kernel  4.4.0-1030-raspi2
popey@localhost:~$ snap list
Name        Version       Rev   Developer  Notes
classic     16.04         17    canonical  devmode
core        16-2          1690  canonical  -
emoj        0.3.0         2     popey      -
nextcloud   11.0.3snap4   1542  nextcloud  -
pi2         16.04-0.17    29    canonical  -
pi2-kernel  4.4.0-1030-3  22    canonical  -

It was last refreshed in 2017 when it was previously powered on.

popey@localhost:~$ snap changes
ID   Status  Spawn                 Ready                 Summary
404  Done    2017-06-15T09:18:23Z  2017-06-15T09:18:23Z  Refresh all snaps: no updates

This is what’s in the journal for snapd when I try to snap refresh.

Oct 01 19:43:34 localhost.localdomain snapd[32536]: 2023/10/01 19:43:34 http: panic serving uid=1000;@: sync: unlock of unlocked mutex
Oct 01 19:43:34 localhost.localdomain snapd[32536]: goroutine 74 [running]:
Oct 01 19:43:34 localhost.localdomain snapd[32536]: net/http.(*conn).serve.func1(0x34fc66c0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /usr/lib/go-1.6/src/net/http/server.go:1389 +0xa0
Oct 01 19:43:34 localhost.localdomain snapd[32536]: panic(0x554673a0, 0x34f8d528)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Oct 01 19:43:34 localhost.localdomain snapd[32536]: sync.(*Mutex).Unlock(0x34cf4980)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /usr/lib/go-1.6/src/sync/mutex.go:109 +0xa0
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/overlord/state.(*State).unlock(0x34cf4980)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/state/state.go:148 +0x58
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/overlord/state.(*State).Unlock(0x34cf4980)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/state/state.go:222 +0x35c
Oct 01 19:43:34 localhost.localdomain snapd[32536]: panic(0x55501520, 0x34b9c038)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/store.requestStoreDeviceNonce(0x0, 0x0, 0x0, 0x0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/auth.go:281 +0x2bc
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/store.(*Store).refreshDeviceSession(0x34da6620, 0x34fec2a0, 0x0, 0x0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:541 +0x6c
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/store.(*Store).doRequest(0x34da6620, 0x76562000, 0x34c61ab0, 0x34fb09c0, 0x34bd1370, 0x34faec00, 0x558321a0, 0x0, 0x0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:704 +0x290
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/store.(*Store).retryRequest(0x34da6620, 0x76562000, 0x34c61ab0, 0x34fb09c0, 0x34bd1370, 0x34faec00, 0x34bd1184, 0x0, 0x0, 0x0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:630 +0x174
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/store.(*Store).retryRequestDecodeJSON(0x34da6620, 0x76562000, 0x34c61ab0, 0x34fb09c0, 0x34bd1370, 0x34faec00, 0x55451f70, 0x34d05400, 0x0, 0x0, ...)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:617 +0xa8
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/store.(*Store).ListRefresh(0x34da6620, 0x34d67fa0, 0x5, 0x6, 0x34faec00, 0x0, 0x0, 0x0, 0x0, 0x0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:1221 +0x69c
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/overlord/snapstate.refreshCandidates(0x34cf4980, 0x0, 0x0, 0x0, 0x34faec00, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/snapstate/snapstate.go:481 +0x260
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/overlord/snapstate.UpdateMany(0x34cf4980, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/snapstate/snapstate.go:502 +0xcc
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/daemon.snapUpdateMany(0x34ff7320, 0x34cf4980, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/daemon/api.go:863 +0x134
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/daemon.snapsOp(0x55817430, 0x35026690, 0x34fc6ac0, 0x0, 0x0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/daemon/api.go:1226 +0xc28
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/daemon.postSnaps(0x55817430, 0x35026690, 0x34fc6ac0, 0x0, 0x0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/daemon/api.go:1255 +0xc0
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/daemon.(*Command).ServeHTTP(0x55817430, 0x765629c8, 0x34d22f90, 0x35026690)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/daemon/daemon.go:144 +0x2cc
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0x34da4960, 0x765629c8, 0x34d22f90, 0x35026690)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/vendor/github.com/gorilla/mux/mux.go:100 +0x28c
Oct 01 19:43:34 localhost.localdomain snapd[32536]: github.com/snapcore/snapd/daemon.logit.func1(0x765629a8, 0x34c3aa00, 0x35026690)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/daemon/daemon.go:172 +0x11c
Oct 01 19:43:34 localhost.localdomain snapd[32536]: net/http.HandlerFunc.ServeHTTP(0x34de7e50, 0x765629a8, 0x34c3aa00, 0x35026690)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /usr/lib/go-1.6/src/net/http/server.go:1618 +0x34
Oct 01 19:43:34 localhost.localdomain snapd[32536]: net/http.serverHandler.ServeHTTP(0x34e26870, 0x765629a8, 0x34c3aa00, 0x35026690)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /usr/lib/go-1.6/src/net/http/server.go:2081 +0x1b8
Oct 01 19:43:34 localhost.localdomain snapd[32536]: net/http.(*conn).serve(0x34fc66c0)
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /usr/lib/go-1.6/src/net/http/server.go:1472 +0xfe0
Oct 01 19:43:34 localhost.localdomain snapd[32536]: created by net/http.(*Server).Serve
Oct 01 19:43:34 localhost.localdomain snapd[32536]:         /usr/lib/go-1.6/src/net/http/server.go:2137 +0x3d8

Seems snapd is crashing :frowning:

Any way to make it not crash?

Oct 01 21:16:35 localhost.localdomain systemd[1]: Started Snappy daemon.
Oct 01 21:16:37 localhost.localdomain /usr/lib/snapd/snapd[29302]: snapmgr.go:309: DEBUG: snapmgr refresh randomness 2h25m22.252947086s
Oct 01 21:16:37 localhost.localdomain /usr/lib/snapd/snapd[29302]: helpers.go:173: cannot connect plug "core-support" from snap "core", no such plug
Oct 01 21:16:37 localhost.localdomain /usr/lib/snapd/snapd[29302]: helpers.go:173: cannot connect plug "network-bind" from snap "core", no such plug
Oct 01 21:16:37 localhost.localdomain snapd[29302]: 2023/10/01 21:16:37.051184 helpers.go:173: cannot connect plug "core-support" from snap "core", no such plug
Oct 01 21:16:37 localhost.localdomain snapd[29302]: 2023/10/01 21:16:37.051484 helpers.go:173: cannot connect plug "network-bind" from snap "core", no such plug
Oct 01 21:16:43 localhost.localdomain /usr/lib/snapd/snapd[29302]: daemon.go:250: DEBUG: init done in 108.950025ms
Oct 01 21:16:43 localhost.localdomain /usr/lib/snapd/snapd[29302]: daemon.go:251: started snapd/2.24 (series 16) ubuntu-core/16 (armhf) linux/4.4.0-1030-raspi2.
Oct 01 21:16:43 localhost.localdomain snapd[29302]: 2023/10/01 21:16:43.370334 daemon.go:251: started snapd/2.24 (series 16) ubuntu-core/16 (armhf) linux/4.4.0-1030-raspi2.
Oct 01 21:16:45 localhost.localdomain snapd[29302]: panic: runtime error: invalid memory address or nil pointer dereference
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         panic: sync: unlock of unlocked mutex
Oct 01 21:16:45 localhost.localdomain snapd[29302]: [signal 0xb code=0x1 addr=0x8 pc=0x54f58268]
Oct 01 21:16:45 localhost.localdomain snapd[29302]: goroutine 44 [running]:
Oct 01 21:16:45 localhost.localdomain snapd[29302]: panic(0x553893a0, 0x34df81a8)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /usr/lib/go-1.6/src/runtime/panic.go:481 +0x370
Oct 01 21:16:45 localhost.localdomain snapd[29302]: sync.(*Mutex).Unlock(0x34c0a980)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /usr/lib/go-1.6/src/sync/mutex.go:109 +0xa0
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord/state.(*State).unlock(0x34c0a980)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/state/state.go:148 +0x58
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord/state.(*State).Unlock(0x34c0a980)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/state/state.go:222 +0x35c
Oct 01 21:16:45 localhost.localdomain snapd[29302]: panic(0x55423520, 0x34abe038)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/store.requestStoreDeviceNonce(0x0, 0x0, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/auth.go:281 +0x2bc
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/store.(*Store).refreshDeviceSession(0x34e0e4d0, 0x34df0120, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:541 +0x6c
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/store.(*Store).doRequest(0x34e0e4d0, 0x7659f330, 0x34b8ba60, 0x34dfbd20, 0x34af388c, 0x0, 0x557541a0, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:704 +0x290
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/store.(*Store).retryRequest(0x34e0e4d0, 0x7659f330, 0x34b8ba60, 0x34dfbd20, 0x34af388c, 0x0, 0x34af36a0, 0x0, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:630 +0x174
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/store.(*Store).retryRequestDecodeJSON(0x34e0e4d0, 0x7659f330, 0x34b8ba60, 0x34dfbd20, 0x34af388c, 0x0, 0x55373f70, 0x34ef4b00, 0x0, 0x0, ...)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:617 +0xa8
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/store.(*Store).ListRefresh(0x34e0e4d0, 0x34f276a0, 0x5, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/store/store.go:1221 +0x69c
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord/snapstate.refreshCandidates(0x34c0a980, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x34ef47c0, 0x0, ...)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/snapstate/snapstate.go:481 +0x260
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord/snapstate.UpdateMany(0x34c0a980, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/snapstate/snapstate.go:502 +0xcc
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord/snapstate.AutoRefresh(0x34c0a980, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/snapstate/snapstate.go:846 +0xe4
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord/snapstate.(*SnapManager).ensureRefreshes(0x34c0af40, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/snapstate/snapmgr.go:438 +0xabc
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord/snapstate.(*SnapManager).Ensure(0x34c0af40, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/snapstate/snapmgr.go:575 +0x60
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord.(*StateEngine).Ensure(0x34c28ea0, 0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/stateengine.go:96 +0x194
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/overlord.(*Overlord).Loop.func1(0x0, 0x0)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/overlord/overlord.go:233 +0x48
Oct 01 21:16:45 localhost.localdomain snapd[29302]: github.com/snapcore/snapd/vendor/gopkg.in/tomb%2ev2.(*Tomb).run(0x34c0cae0, 0x34e02908)
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/tomb.v2/tomb.go:163 +0x1c
Oct 01 21:16:45 localhost.localdomain snapd[29302]: created by github.com/snapcore/snapd/vendor/gopkg.in/tomb%2ev2.(*Tomb).Go
Oct 01 21:16:45 localhost.localdomain snapd[29302]:         /build/snapd-8VpV8K/snapd-2.24/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/tomb.v2/tomb.go:159 +0x134
Oct 01 21:16:45 localhost.localdomain systemd[1]: snapd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 01 21:16:45 localhost.localdomain systemd[1]: snapd.service: Unit entered failed state.
Oct 01 21:16:45 localhost.localdomain systemd[1]: snapd.service: Failed with result 'exit-code'.
Oct 01 21:16:46 localhost.localdomain systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Oct 01 21:16:46 localhost.localdomain systemd[1]: Stopped Snappy daemon.
Oct 01 21:16:46 localhost.localdomain systemd[1]: Started Snappy daemon.
^C
popey@localhost:~$ 


I ended up wiping the device.