velbus / velbus-tcp-snap

Snap package for python-velbustcp
5 stars 1 forks source link

Failing to install on updated Debian system #11

Closed MDAR closed 1 year ago

MDAR commented 1 year ago

Hi

I updated a machine to the latest Debian version and Snap Velbus-TCP appeared to stop working.

Snap reported that it was running, but nothing could connect to the defined ports (as they have been for the last year)

snap get velbus-tcp -d Would return the correct configuration, but Angry IP scanner could not see the open ports.

As a "bull in a china shop" approach, I eventually removed / purged all traces of SNAPD and started again.

This revealed something more insteresting.

When I tried to install the Velbus-TCP snap package, I got this error.

snap install velbus-tcp
error: cannot perform the following tasks:
- Run install hook of "velbus-tcp" snap if present (run hook "install": cannot perform operation: mount --bind /snap/core18/current/etc/nsswitch.conf /tmp/snap.rootfs_h60Z9u/etc/nsswitch.conf: Permission denied)

Have you got any ideas what I should do to resolve this?

FYI

I am running an Odorid C4 with the latest version of DietPi

for now, I have rolled back to using Velserv.

The script I use to install SNAPD and Velbus-TCP is here

www.mdar.co.uk/dl/velbus/velbus-tcp.sh


I have tried these commands and got these errors

root@openHAB-C4:/snap/core18/current/etc# ls -l -h nsswitch.conf
-rw-r--r-- 1 root root 530 Nov  3 13:48 nsswitch.conf
root@openHAB-C4:/snap/core18/current/etc# chown 0777 nsswitch.conf
chown: changing ownership of 'nsswitch.conf': Read-only file system
cd /tmp/snap.rootfs_SyitOG/etc/
-bash: cd: /tmp/snap.rootfs_SyitOG/etc/: No such file or directory

This is what systemctl status snapd has to say for itself

Nov 28 15:29:32 openHAB-C4 snapd[28762]: services.go:1046: RemoveSnapServices - disabling snap.velbus-tcp.velbus-tcp.service
Nov 28 15:29:34 openHAB-C4 snapd[28762]: handlers.go:661: Reported install problem for "velbus-tcp" as 77375ee0-6f31-11ed-b582-fa163ef35206 OOPSID
Nov 28 15:29:45 openHAB-C4 snapd[28762]: api_snaps.go:319: Installing snap "velbus-tcp" revision unset
Nov 28 15:29:52 openHAB-C4 snapd[28762]: taskrunner.go:271: [change 10 "Run install hook of \"velbus-tcp\" snap if present" task] failed: run hook "install": cannot perform operation: mount --bind  /snap/core18/current/etc/nsswitch.conf /tmp/snap.rootfs_SyitOG/etc/nsswitch.conf: Permission denied
Nov 28 15:29:55 openHAB-C4 snapd[28762]: services.go:1046: RemoveSnapServices - disabling snap.velbus-tcp.velbus-tcp.service
Nov 28 15:29:57 openHAB-C4 snapd[28762]: handlers.go:661: Reported install problem for "velbus-tcp" as 84328d64-6f31-11ed-9b8a-fa163e993415 OOPSID
Nov 28 15:33:41 openHAB-C4 snapd[28762]: api_snaps.go:319: Installing snap "velbus-tcp" revision unset
Nov 28 15:33:50 openHAB-C4 snapd[28762]: taskrunner.go:271: [change 11 "Run install hook of \"velbus-tcp\" snap if present" task] failed: run hook "install": cannot perform operation: mount --bind /snap/core18/current/etc/nsswitch.conf /tmp/snap.rootfs_gKjmhf/etc/nsswitch.conf: Permission denied
Nov 28 15:33:53 openHAB-C4 snapd[28762]: services.go:1046: RemoveSnapServices - disabling snap.velbus-tcp.velbus-tcp.service
Nov 28 15:33:55 openHAB-C4 snapd[28762]: handlers.go:661: Reported install problem for "velbus-tcp" as 12ae50ae-6f32-11ed-b582-fa163ef35206 OOPSID

Forcing an installation of Version 1.6.0 did not get me any futher

 snap install --edge velbus-tcp
error: cannot perform the following tasks:
- Run install hook of "velbus-tcp" snap if present (run hook "install": cannot perform operation: mount --bind /snap/core18/current/etc/nsswitch.conf /tmp/snap.rootfs_1pME2B/etc/nsswitch.conf: Permission denied) -
MDAR commented 1 year ago

Trying this once more, I spotted this in the output while installing SnapD again

Setting up apparmor (2.13.2-10) ...
Created symlink /etc/systemd/system/sysinit.target.wants/apparmor.service → /lib/systemd/system/apparmor.service.
Reloading AppArmor profiles
AppArmor parser error for /etc/apparmor.d in /etc/apparmor.d/usr.bin.man at line 47: Could not open 'local/usr.bin.man'
AppArmor parser error for /etc/apparmor.d/usr.bin.man in /etc/apparmor.d/usr.bin.man at line 47: Could not open 'local/usr.bin.man'
Error: At least one profile failed to load
MDAR commented 1 year ago

I thought the same had just happened to an Odroid C2 that I had to update for a customer, but it turned out that Velbus-TCP just needed enabling again

snap enable velbus-tcp
MDAR commented 1 year ago

As referenced in the issue above, nobody else can replicate this, so it must have been an anomaly with a series of updates.

I've setup six (Odroid C4) machines from scratch today and every one was perfect.