-
Notifications
You must be signed in to change notification settings - Fork 4
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
Vault sharing notification is not sent #824
Comments
@CDeltakai do |
We need a better regression testing here. |
There's no error on the remote side that shows up. |
I did a quick test on my side. and got this when trying to share the vault.
After getting @CDeltakai to trust my node I was able to share a new vault with him without error. This is designed behavior where you just outright reject notifications from vaults where you don't trust them first. However the feedback on the problem here is really bad. We need to include all the errors in the cause chain when reporting errors like this. Along with sending notifications specifically, if we reject a notification due to lack of trust, There should be a logger message for it as well. |
I'm going to address this in two parts.
|
Ok, so I've made the error logging better here and improved the related tests in the CLI. Besides the fact that why the notification failed wasn't clear. This was intended behaviour. The vaults share command itself doesn't care if the notification fails. The only reason we got any feedback that the notification failed is because background tasks, regardless if the failure is allowed or not, is logged as a warning. |
With the new changes release I'm going to consider this one done. Unless we want to consider changing the intended behaviour of vaults share and the failing notification. |
I thought it was due to no trust/permission to share. |
Example of the new log? |
I still want to make sure we're structured in that though. |
All
The stringified error part is It was due to a lack of trust to accept notifications. Sharing was unaffected. |
Hmmm, I would prefer to use json for structured messages, and a better serialisation of error messages. The |
We could use a JSON format. I structured it this way to keep it succinct and avoid bloating out the log size. Let me play around with some formats. Once we've settled on that I'll move the formatting change into js-errors. I'll create a new issue to track that. |
There are 3 things left to do for this.
|
I will be taking over this issue now. |
There could be a default |
So we want to keep that now? That's what I intended to do but after discussion we went with having whatever was serialising the error to a string would decide how to format it. |
I need solid specifications on error rendering. Brian mentioned that the error message should contain the traceback to an extent, but be understandable by the user. Q. Should the error message have only the last error, or a stack trace? To get more details in the traceback, the user might be able to optionally enable verbose mode. Otherwise the errors could be formatted in a simpler manner. $ polykey secrets ls novault
ErrorVaultsVaultUndefined: Vault 'novault' does not exist
$ polykey secrets ls novault -v
ErrorPolykeyRemote: Remote error from RPC call
localHost ::1
localPort 53346
remoteHost ::1
remotePort 43507
command vaultsSecretsList
timestamp Thu Nov 21 2024 12:50:24 GMT+1100 (Australian Eastern Daylight Time)
cause: ErrorVaultsVaultUndefined: Vault does not exist Moreover, the user does not need to see the Currently, this is how the error rendering is handled in the $ npm run polykey -- secrets mkdir vault:nodir/nested vault:nodir2/nested vault:nodir3/nested
> [email protected] polykey
> ts-node src/polykey.ts secrets mkdir vault:nodir/nested vault:nodir2/nested vault:nodir3/nested
mkdir: cannot create directory nodir/nested: No such file or directory
mkdir: cannot create directory nodir2/nested: No such file or directory
mkdir: cannot create directory nodir3/nested: No such file or directory
ErrorPolykeyCLIMakeDirectory: Failed to create one or more directories - Failed to create one or more directories One change I would suggest is to either show the error description or error message, as showing both sometimes leads to weird results like the one in Another example would be
So, either we render the description if the message doesn't exist, or render the message if it does. It would make the errors much more readable and concise.
Basically, we need to finalise the format of errors and how they should be rendered to close this issue. Currently, there seems to be a lot of confusion surrounding it, and it needs to be cleared up for progress to be made. |
I would have kept the ExceptionName: Description - Message as the default way of reporting this. To make it easier for logging systems to deal with this - this all occurs in a single line. Then for additional data that's what the data is for. And for example mkdir I would join together all directories that failed to be made into the message and add it to the data pojo too. In JSON error formatting, this data is shown as json is a single line showing all the data when serialised. This issue has nothing to do with error reporting in the original spec. So I'm not sure if this should be even addressed here. |
No we don't want that much magic in our error reporting. We want to do something where we detect if it's an interactive tty - do something, if it is a regular pipe, do a different thing. I would say default human reporting can do a smart switch between single line reporting for regular stdout/stderr pipe and more fancier reporting with indented multiline message for tty. But then provide specific formatting option overrides. Like |
Unix operates on each path, and returns the status after operating on each path. If one path fails,
Yes, this looks like a good approach. The
I still need an answer to this. Brian mentioned that previously, we decided to let each application define their own |
Describe the bug
Sharing a vault to a node ID causes this log in the agent logs:
There's no notifications sent.
To Reproduce
Expected behavior
I'm able to connect and share the vault, and the remote target can clone the vault. But notifications is not sent, so this sounds like a trivial bug. It should just sent without any other problems.
Screenshots
Platform (please complete the following information)
Notify maintainers
@tegefaulkes
The text was updated successfully, but these errors were encountered: