0

I created a snap, installed locally by running

$ snap install <filename> --dangerous   

and that worked until I started adding plugs.
Now running "snap list" results in this error:

error: cannot list snaps: cannot communicate with server: Get http://localhost/v2/snaps: dial unix /run/snapd.socket: connect: connection refused    

Because snapd isn't running I can't remove the problem snap or do anything. This is on 16.04 Ubuntu and I have the build tools installed, etc.

Running the command "journalctl -u snapd.service" gives this output:

Apr 10 23:28:19 ubuntu16 snapd[1024]: 2017/04/10 23:28:19.055104 helpers.go:173: cannot connect plug "home" from snap "rev2agent", no such plug
Apr 10 23:28:19 ubuntu16 /usr/lib/snapd/snapd[1024]: helpers.go:173: cannot connect plug "network-bind" from snap "rev2agent", no such plug
Apr 10 23:28:19 ubuntu16 snapd[1024]: 2017/04/10 23:28:19.055437 helpers.go:173: cannot connect plug "network-bind" from snap "rev2agent", no such plug
Apr 10 23:28:19 ubuntu16 /usr/lib/snapd/snapd[1024]: daemon.go:250: DEBUG: init done in 7.822584ms
Apr 10 23:28:19 ubuntu16 /usr/lib/snapd/snapd[1024]: daemon.go:251: started snapd/2.23.6 (series 16; classic) ubuntu/16.04 (amd64) linux/4.8.0-46-generic.
Apr 10 23:28:19 ubuntu16 snapd[1024]: 2017/04/10 23:28:19.108729 daemon.go:251: started snapd/2.23.6 (series 16; classic) ubuntu/16.04 (amd64) linux/4.8.0-
Apr 10 23:28:19 ubuntu16 /usr/lib/snapd/snapd[1024]: taskrunner.go:353: DEBUG: Running task 76 on Doing: Setup snap "rev2agent" (unset) security profiles
Apr 10 23:28:19 ubuntu16 snapd[1024]: panic: assignment to entry in nil map
Apr 10 23:28:19 ubuntu16 snapd[1024]: goroutine 7 [running]:
Apr 10 23:28:19 ubuntu16 snapd[1024]: panic(0x556dd7d9c320, 0xc8202aba20)
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3ea
Apr 10 23:28:19 ubuntu16 snapd[1024]: github.com/snapcore/snapd/interfaces/builtin.(*ContentInterface).SanitizePlug(0x556dd8364380, 0xc820316c60, 0x0, 0x0)
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /build/snapd-ds9lFD/snapd-2.23.6/_build/src/github.com/snapcore/snapd/interfaces/builtin/content.go:80 +0x4cb
Apr 10 23:28:19 ubuntu16 snapd[1024]: github.com/snapcore/snapd/interfaces.(*Repository).AddSnap(0xc8201ff8c0, 0xc820296900, 0x0, 0x0)
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /build/snapd-ds9lFD/snapd-2.23.6/_build/src/github.com/snapcore/snapd/interfaces/repo.go:837 +0x960
Apr 10 23:28:19 ubuntu16 snapd[1024]: github.com/snapcore/snapd/overlord/ifacestate.(*InterfaceManager).setupProfilesForSnap(0xc820208a60, 0xc820202120, 0x
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /build/snapd-ds9lFD/snapd-2.23.6/_build/src/github.com/snapcore/snapd/overlord/ifacestate/handlers.go:150 +0x
Apr 10 23:28:19 ubuntu16 snapd[1024]: github.com/snapcore/snapd/overlord/ifacestate.(*InterfaceManager).doSetupProfiles(0xc820208a60, 0xc820202120, 0xc8202
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /build/snapd-ds9lFD/snapd-2.23.6/_build/src/github.com/snapcore/snapd/overlord/ifacestate/handlers.go:124 +0x
Apr 10 23:28:19 ubuntu16 snapd[1024]: github.com/snapcore/snapd/overlord/ifacestate.(*InterfaceManager).(github.com/snapcore/snapd/overlord/ifacestate.doSe
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /build/snapd-ds9lFD/snapd-2.23.6/_build/src/github.com/snapcore/snapd/overlord/ifacestate/ifacemgr.go:70 +0x4
Apr 10 23:28:19 ubuntu16 snapd[1024]: github.com/snapcore/snapd/overlord/state.(*TaskRunner).run.func1(0x0, 0x0)
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /build/snapd-ds9lFD/snapd-2.23.6/_build/src/github.com/snapcore/snapd/overlord/state/taskrunner.go:146 +0x71
Apr 10 23:28:19 ubuntu16 snapd[1024]: github.com/snapcore/snapd/vendor/gopkg.in/tomb%2ev2.(*Tomb).run(0xc820221950, 0xc820215770)
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /build/snapd-ds9lFD/snapd-2.23.6/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/tomb.v2/tomb.go:163 +0x
Apr 10 23:28:19 ubuntu16 snapd[1024]: created by github.com/snapcore/snapd/vendor/gopkg.in/tomb%2ev2.(*Tomb).Go
Apr 10 23:28:19 ubuntu16 snapd[1024]:         /build/snapd-ds9lFD/snapd-2.23.6/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/tomb.v2/tomb.go:159 +0x
Apr 10 23:28:19 ubuntu16 systemd[1]: snapd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 10 23:28:19 ubuntu16 systemd[1]: snapd.service: Unit entered failed state.
Apr 10 23:28:19 ubuntu16 systemd[1]: snapd.service: Failed with result 'exit-code'.
Apr 10 23:28:19 ubuntu16 systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Apr 10 23:28:19 ubuntu16 systemd[1]: Stopped Snappy daemon.

I want to get back to working snap/snapd system. It seems to crash snapd because of a plug 'home' or 'network-bind' in my snap. Rebooting just does this again. How can I remove this installed snap? Or start fresh?

JimHansen
  • 54
  • 4

4 Answers4

0

Hmm that looks like a bad snapd bug; would you mind filing a bug with details to repro against snapd (https://bugs.launchpad.net/snapd)?

As a workaround, try moving the snap out of the way in /var/lib/snapd/snaps, perhaps that's sufficient to avoid triggering this crash.

0

Open ubuntu recovery mode and select boot options on the box then just type on the terminal this line

 sudo dpkg --configure -a
Shabeer K
  • 1,489
  • 16
  • 23
0

Try

sudo apt autoremove --purge snapd 

and then

sudo apt-get install snapd

Note: It will remove previously installed apps using snap. You will need to reinstall them.

0

try sudo systemctl restart snapd.service

you should be fine

ZacNt
  • 49
  • 2