-
Notifications
You must be signed in to change notification settings - Fork 37
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
Reconsider status responses #2744
Comments
Server should return as much data as it can (except when it somehow affects security), simple as that. Joining/chaining errors is fine for that and the protocol allows for it, |
@roman-khimov, so you are for the full error message? |
Absolutely. It's not that much different from neo-project/proposals#156 |
Well, I agree too, I think. I just try to understand why it was done like that. I think the idea was that "a user do not want to see |
1024 in |
big 👍 to this proposal pretty simple approach comes to my mind:
or, if status has detail:
and no other info. See next
i.e. code + all details + full text message
and with
finally, user faces no transport/proto details and strange colon-separated texts in widely-known cases like will also help with nspcc-dev/neofs-testcases#919 i faced in tests:
this is what becomes when unwrapping is dropped. Realized 2 facts:
combining proposed default simplification and |
Previously, `SearchV2` RPC server responded with the deepest Go error message in the status message. To achieve this, the server made `errors .Unwrap` to the lowest level. This approach was reused from other API calls, so it brought up the same shortcomings to new search. For example, CLI user could face following error: ``` rpc error: status: code = 1024 message = illegal base64 data at input byte 4 ``` and only imagine which part of the request processing is an invalid Base64. This cancels error unwrapping for `SearchV2`, making it to respond with: ``` rpc error: status: code = 1024 message = invalid cursor: decode cursor from Base64: illegal base64 data at input byte 0 ``` instead. Refs #2744. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, `SearchV2` RPC server responded with the deepest Go error message in the status message. To achieve this, the server made `errors .Unwrap` to the lowest level. This approach was reused from other API calls, so it brought up the same shortcomings to new search. For example, CLI user could face following error: ``` rpc error: status: code = 1024 message = illegal base64 data at input byte 4 ``` and only imagine which part of the request processing is an invalid Base64. This cancels error unwrapping for `SearchV2`, making it to respond with: ``` rpc error: status: code = 1024 message = invalid cursor: decode cursor from Base64: illegal base64 data at input byte 0 ``` instead. Note that previously existed RPCs are untouched to avoid system destabilization. They will be considered separately. Refs #2744. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, `SearchV2` RPC server responded with the deepest Go error message in the status message. To achieve this, the server made `errors .Unwrap` to the lowest level. This approach was reused from other API calls, so it brought up the same shortcomings to new search. For example, CLI user could face following error: ``` rpc error: status: code = 1024 message = illegal base64 data at input byte 4 ``` and only imagine which part of the request processing is an invalid Base64. This cancels error unwrapping for `SearchV2`, making it to respond with: ``` rpc error: status: code = 1024 message = invalid cursor: decode cursor from Base64: illegal base64 data at input byte 0 ``` instead. Note that previously existed RPCs are untouched to avoid system destabilization. They will be considered separately. Refs #2744. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, `SearchV2` RPC server responded with the deepest Go error message in the status message. To achieve this, the server made `errors .Unwrap` to the lowest level. This approach was reused from other API calls, so it brought up the same shortcomings to new search. For example, CLI user could face following error: ``` rpc error: status: code = 1024 message = illegal base64 data at input byte 4 ``` and only imagine which part of the request processing is an invalid Base64. This cancels error unwrapping for `SearchV2`, making it to respond with: ``` rpc error: status: code = 1024 message = invalid cursor: decode cursor from Base64: illegal base64 data at input byte 0 ``` instead. Note that previously existed RPCs are untouched to avoid system destabilization. They will be considered separately. Refs #2744. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, `SearchV2` RPC server responded with the deepest Go error message in the status message. To achieve this, the server made `errors .Unwrap` to the lowest level. This approach was reused from other API calls, so it brought up the same shortcomings to new search. For example, CLI user could face following error: ``` rpc error: status: code = 1024 message = illegal base64 data at input byte 4 ``` and only imagine which part of the request processing is an invalid Base64. This cancels error unwrapping for `SearchV2`, making it to respond with: ``` rpc error: status: code = 1024 message = invalid cursor: decode cursor from Base64: illegal base64 data at input byte 0 ``` instead. Note that previously existed RPCs are untouched to avoid system destabilization. They will be considered separately. Refs #2744. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, `SearchV2` RPC server responded with the deepest Go error message in the status message. To achieve this, the server made `errors .Unwrap` to the lowest level. This approach was reused from other API calls, so it brought up the same shortcomings to new search. For example, CLI user could face following error: ``` rpc error: status: code = 1024 message = illegal base64 data at input byte 4 ``` and only imagine which part of the request processing is an invalid Base64. This cancels error unwrapping for `SearchV2`, making it to respond with: ``` rpc error: status: code = 1024 message = invalid cursor: decode cursor from Base64: illegal base64 data at input byte 0 ``` instead. Note that previously existed RPCs are untouched to avoid system destabilization. They will be considered separately. Refs #2744. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, `SearchV2` RPC server responded with the deepest Go error message in the status message. To achieve this, the server made `errors .Unwrap` to the lowest level. This approach was reused from other API calls, so it brought up the same shortcomings to new search. For example, CLI user could face following error: ``` rpc error: status: code = 1024 message = illegal base64 data at input byte 4 ``` and only imagine which part of the request processing is an invalid Base64. This cancels error unwrapping for `SearchV2`, making it to respond with: ``` rpc error: status: code = 1024 message = invalid cursor: decode cursor from Base64: illegal base64 data at input byte 0 ``` instead. Note that previously existed RPCs are untouched to avoid system destabilization. They will be considered separately. Refs #2744. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Some status errors in NeoFS are known and self-describing. But there are also "general errors" with 1024 status codes and some "good" human-readable messages.
Expected Behavior
If I have a general error, I expect NOT a general message that can help me understand what is happening. E.g. session token does not relate to the container a request is trying to change:
Current Behavior
Only the last error in the errors chain is attached:
Possible Solution
Unwrap
does not unwrap more than it is needed as the package thinks)Steps to Reproduce (for bugs)
Any 1024 "general" error case (like incorrect session token; even though session token error may become another status case, there always be some "general" errors that should be described correctly).
Context
neofs-node/pkg/services/util/sign.go
Lines 225 to 229 in 996b1ea
Regression
No.
Your Environment
0.40.0
The text was updated successfully, but these errors were encountered: