Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle plugin explosions #167

Closed
str4d opened this issue Dec 31, 2020 · 5 comments · Fixed by #446
Closed

Gracefully handle plugin explosions #167

str4d opened this issue Dec 31, 2020 · 5 comments · Fixed by #446
Milestone

Comments

@str4d
Copy link
Owner

str4d commented Dec 31, 2020

If an age plugin meets an exothermic demise, rage should print a prefix message and then the output of the plugin's stderr.

@tv42
Copy link

tv42 commented Feb 1, 2021

I'm writing a plugin, and wish rage would just let plugin stderr flow through (potentially pipe read + prefix + output). I ended up having to make my plugin use syslog just to develop it effectively.

@str4d
Copy link
Owner Author

str4d commented Feb 1, 2021

Given that rage uses stderr to communicate with users, I'm reluctant to overload that for developer communication as well. But I definitely want to make it easier for plugin developers to build plugins.

Something that @FiloSottile suggested on his stream yesterday is a plugin test harness: something that is a thin shim over the client-side protocol that exercises all the weird edge cases. As this would be targeted at developers, it would definitely make sense to pipe everything back through and make it accessible.

@tv42
Copy link

tv42 commented Feb 1, 2021

For the record, I don't intend to leave the verbose stderr on in actual runnable code. I think this is one of those things that would be self-regulating; if a plugin spams your terminal, you develop a dislike for the plugin and look for a friendlier one.

@str4d
Copy link
Owner Author

str4d commented Mar 20, 2022

FYI the next version of rage will output all plugin communications, as well as plugin stderr, to rage's stderr if the AGEDEBUG env variable is set to plugin.

This issue (handling plugin panics gracefully) still needs to be addressed.

@str4d str4d added this to the rage 0.9.0 milestone May 1, 2022
@str4d str4d modified the milestones: rage 0.9.0, rage 0.10.0 Oct 26, 2022
str4d added a commit that referenced this issue Jan 16, 2024
This enables us to provide a more useful error message when a plugin
unexpectedly dies.

Closes #167.
@str4d
Copy link
Owner Author

str4d commented Jan 16, 2024

#446 adds nicer error handling. Instead of outputting stderr directly, it points plugin developers to AGEDEBUG=plugin for debugging, with a warning that this prints private encryption key material to standard error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants