Open sed-i opened 3 days ago
Note: the rapid restart is due to an error I discovered with snap logs
, due to a build error: https://github.com/canonical/grafana-agent-snap/pull/80.
So there is no problem with snap.set
, the only problem is that the reason for restart failure is buried.
Problem 1:
set
fails because charm is restarted to quicklyI need to call
snap.set
immediately afterstart
/ensure
, like so:At this point the call to
snap.set
fails with:Problem 2a: the log message doesn't show stderr
In the traceback I see messages such as
because SnapError doesn't print
e.stderr
. Perhaps it would be handy to also includee.stderr
here:https://github.com/canonical/operator-libs-linux/blob/a1aaa35135220d564f7a63854388b38752de09c4/lib/charms/operator_libs_linux/v2/snap.py#L280-L283
Problem 2b: this error doesn't go to stderr anyway, so pull from journalctl or systemctl?
I manually added stderr to the log but discovered there's nothing there, all the errors are logged to journal. Should the lib pull from the journal when raising SnapError?