It looks like Snap keepalived is failing to load shared libraries
(libipset.so.13 and libnetsnmpmibs.so.40), even though they are included
in stage-packages and present inside the Snap package. The fact that
installing the system versions (libsnmp40 and libipset13) solved the
issue suggests that Snap confinement or library path resolution may be
the root cause.

Possible Causes & Solutions:
1. Library Path Not Being Recognized
Snap packages run in a confined environment and do not use the system’s 
/usr/lib by default. The libraries inside the Snap package should be linked 
properly at runtime.

Solution:
Try running ldd to check where keepalived is trying to load the libraries from:

sh
Copy
Edit
ldd /snap/keepalived/current/usr/sbin/keepalived
If the output shows missing libraries or points to system paths instead of Snap 
paths, the issue is likely related to library path resolution.

You can try manually setting LD_LIBRARY_PATH when running the service:

sh
Copy
Edit
LD_LIBRARY_PATH=/snap/keepalived/current/usr/lib/riscv64-linux-gnu 
/snap/keepalived/current/usr/sbin/keepalived
If this fixes the issue, you may need to adjust the Snap package to set the 
correct environment variables.

2. Snap Confinement Issues
If the Snap is running in strict confinement, it may not be able to access its 
own libraries due to missing interfaces.

Solution:
Try running:

sh
Copy
Edit
snap connections keepalived
If there are missing interfaces that could provide access to system libraries, 
connect them manually:

sh
Copy
Edit
sudo snap connect keepalived:network-control
sudo snap connect keepalived:firewall-control
You could also try running the Snap in classic mode (if supported) to bypass 
strict confinement:

sh
Copy
Edit
snap install keepalived --classic
3. Snapcraft Build Issue
If stage-packages included libsnmp40 and libipset13, but the Snap still fails, 
the issue might be with snapcraft.yaml. Ensure that:

The LD_LIBRARY_PATH is correctly set in the Snap environment.
prime is correctly bundling dependencies.
Solution:
Modify the Snapcraft YAML to explicitly set the runtime library path:

yaml
Copy
Edit
apps:
  keepalived:
    command: usr/sbin/keepalived
    environment:
      LD_LIBRARY_PATH: $SNAP/usr/lib/riscv64-linux-gnu:$LD_LIBRARY_PATH
Then rebuild the Snap and reinstall it.

Next Steps
Check ldd output to confirm missing libraries.
Manually set LD_LIBRARY_PATH and test.
Check Snap connections and try using --classic.
Verify Snapcraft YAML and rebuild if needed.
Would you like help debugging your Snapcraft YAML file? 🚀

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2103599

Title:
  Snap installation fails though library dependencies are in snap

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/2103599/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to