RFE - Implement debug hooks

Bug #1962191 reported by Nate Sias
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
snapd
Triaged
Undecided
Unassigned

Bug Description

Filed on behalf of client.

Requesting snap-native method of returning debug info akin to anonymouse64's snap-debug-info.sh (https://gist.github.com/anonymouse64/77baa3b78572c125c71f5712d1c8a1e1)

Per original ticket:
```
We need a way to collect the snap info to be triggered remotely from within a snap, this is currently not supported.
This sort of info:
https://gist.github.com/anonymouse64/77baa3b78572c125c71f5712d1c8a1e1
We currently collect the syslog so if it could be triggered to be written to syslog somehow that would work.
```

Best regards,
~ Nate

affects: snapcraft → snapd
Alberto Mardegan (mardy)
Changed in snapd:
status: New → Triaged
Revision history for this message
Alberto Mardegan (mardy) wrote :

Hi Nate, thanks for filing this!
  Can you please double-check with the client whether that "remotely" is meant to mean that the data collection must be triggered by a remote machine or if it's just a word which accidentally ended up in the sentence (because, from the rest of the message it seems that the data collection should all happen locally)?

As for a snap requesting for collection of local debug data, I think that this is a good idea. We just need to make sure that the generated data is not stored in a location where unprivileged snaps can access it, and then we could make this work without the need of any special privileges.

It could be something like

    snapctl debug-report -k -u snapd -f extra_file.log -f more_logs.txt

where -k and -u options are forwarded to journalctl, and -f means to include one log file generated by the snap itself. The path of the created report file could be printed out on stdout, so that the snap could prompt the user to upload it to wherevere it's needed.

Revision history for this message
Nate Sias (nate-sias) wrote :

Hey Alberto,

I think local generation such that they are able to then gather the outputs programmatically, alongside journal and app logs, would suit both their specific use case and others. In this particular case, it appears that *their* clients use a push-button log collector which forwards logs to the provider's team. That push button ought to have the ability to generate and bundle snap logs alongside the others.

Do you have an idea of where the -f would drop by default, to facilitate unattended collection?

Thanks for your attention on this,
~ Nate

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.