-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
REST distribution get nil pointer exception #4020
Comments
Great find @sabau! |
@sabau any chance you can share the exact sdk version and possibly a stack trace? |
It's the one deployed by @mircea-c, should be 0.33.0 right? |
It would be great to get a stracktrace from the node though. I took a look at the implementation and I don't really see where a nil pointer exception could be thrown (I may have missed it) from the client to the querier. |
This is what I could find on the node. There's one more instance of this same issue today.
|
Very helpful indeed. Ok, I see the problem -- pretty trivial fix: In https://github.com/cosmos/cosmos-sdk/blob/v0.33.2/x/distribution/keeper/querier.go#L195-L216, the validation and/or delegation may not exist. In such a case, we should simply return an error. |
Is this done? |
Yes. Not sure why it wasn't closed automatically? |
Summary of Bug
We get:
{"error":"ABCIQuery: Response error: RPC error -32603 - Internal error: runtime error: invalid memory address or nil pointer dereference"}
https://stargate.cosmos.network/distribution/delegators/cosmos167w96tdvmazakdwkw2u57227eduula2cy572lf/rewards/cosmosvaloper1qwl879nx9t6kef4supyazayf7vjhennyh568ys
https://stargate.cosmos.network/distribution/validators/cosmosvaloper1rcr8c8enfl5rdfv8jcxj8uwy64dmr7md2mnl08
I'm not sure we want to return an exception here and error code should be 404 instead of 500.
Probably the address combination does not match any reward in the first case, while in the second case that address is not a validator, seems both are not present resources
Seems related to:
#3704
#2466
on the other hand on CLI it seems to be handled:
For Admin Use
The text was updated successfully, but these errors were encountered: