How do I debug snaps?
For debugging confined snaps (ie, installed without --devmode
) there is a snap in the store called snappy-debug
that will get better over time but is already useful. To use:
sudo snap install snappy-debug --devmode # after snapd 2.0.7 lands, drop --devmode
sudo snap connect snappy-debug:log-observe ubuntu-core:log-observe
sudo /snap/bin/snappy-debug.security scanlog
This scanlog command will tail the syslog, resolving seccomp syscall numbers and make suggestions on what interfaces to use, changes to make to your snap to work within the sandbox, etc. You can filter by snap with:
sudo /snap/bin/snappy-debug.security scanlog <snapname>
Some more tips are covered here:
Using snap try
can be helpful too.
Related videos on Youtube
David Planella
I work at GitLab as Director of Community Relations. Before, I worked for Canonical as the former Ubuntu Community Team Manager. As an Open Source contributor, I am mostly involved in app development and localization: I'm the developer of Qreator, former lead the Ubuntu Catalan Translators team and also a GNOME translator. In the past I've contributed to other projects, such as Debian or Mozilla. Blog Google+ Twitter
Updated on September 18, 2022Comments
-
David Planella over 1 year
I've successfully built a snap that I can install on my system.
However, it crashes upon start, and I'm not quite sure where to start debugging that crash.
What are the different approaches to debugging an installed app failing to start?