sosreport / sos

A unified tool for collecting system logs and other debug information
http://sos.rtfd.org
GNU General Public License v2.0
497 stars 538 forks source link

[snaps] when using `--all-logs` some command outputs will not be collected #3683

Open arif-ali opened 2 weeks ago

arif-ali commented 2 weeks ago

Working with one of my engineering team members we discovered that snap command outputs will not be collected on the filesystem due to the strict confinement of snaps and hence not having permissions to the destination. A lot of snap related have been added over the past 6 months, and first time we've discovered this issue.

The output from STDOUT to files was introduced in PR #2729 to improve the memory management and speed of collection of the corresponding commands.

Some of the data around this is documented in Launchpad [1]

One possible workaround is that we could have a disable this feature with all logs if the command being run is a command from a snap, but I'll think of an idea on how we can achieve this moving forward.

[1] https://launchpad.net/bugs/2069941

TurboTurtle commented 2 weeks ago

Just to clarify, this is happening when sos is installed as a snap, yes? Not that the commands we are trying to collect are installed from snaps?

arif-ali commented 2 weeks ago

So, this is when a package is a snap, and hence the command is being run from that snap package.

i.e. the maas plugin is triggered, the maas status command will run, but will not be able to get the output directly to the file due to snap confinement restrictions