the-draupnir-project / Draupnir

A Matrix moderation bot
https://the-draupnir-project.github.io/draupnir-documentation/
91 stars 14 forks source link

It should be easier for system admins to debug startup failures as a result of a misplaced config file or incorrect config values. #217

Closed Gnuxie closed 1 month ago

Gnuxie commented 9 months ago

https://matrix.to/#/!IaWNErZAgQUhGqJXjX:matrix.org/$yQISu-7x69vp8tq2mn5cRRNL6JVO_WdLNXUE4WCg5YM?via=matrix.org&via=envs.net&via=conduit.rory.gay

They should be able to get feedback on what config file is actually being seen and loaded by Draupnir

It should go without saying that documentation for figuring out how to do this should be included and visible directly from the setup instructions.

The config shown in output should have the password/access token and other sensitive fields redacted so that it can be pasted directly into our support room when we ask for logs.

Related: https://github.com/the-draupnir-project/Draupnir/issues/218

Gnuxie commented 7 months ago

it's also going to be essential to be able to read out the appdata https://github.com/the-draupnir-project/Draupnir/issues/333. Though note, this is before Draupnir is created, so I'm not sure how we'd go about that.

Gnuxie commented 7 months ago

Maybe we could have something that uses https://nodejs.org/api/process.html#event-beforeexit to try and dump account data, but we'd need another hook for appservice bots.

You also have to remember that there can be startup issues that happen before Draupnir or the MatrixClient are constructed.

Gnuxie commented 7 months ago

Maybe the better way to do it would be to add a dependency to the MatrixAccountData utility per Draupnir that interns them and reads them all out at the "stopping due to fatal error" hook, whatever that might be.

Gnuxie commented 1 month ago

Account data concerns have been covered by https://github.com/the-draupnir-project/planning/issues/29