boulder icon indicating copy to clipboard operation
boulder copied to clipboard

Make 'incomplete GRPC request' errors easier to trace

Open beautifulentropy opened this issue 4 years ago • 2 comments

Many of GRPC methods perform some amount of request validation and then immediately construct requests to be dispatched to other component via an inner GRPC client. When one of these requests contains a nil value the inner GRPC server being called may return a simple 'errIncompleteGRPCRequest' which is not wrapped by another error indicating the source.

For example, RA.AdministrativelyRevokeCertificate can return a simple errIncompleteGRPCRequest from three sources. The first is at the top of the method itself. The second and third are a little trickier; the call to RA.revokeCertificate on line 1886 results in two calls via inner GRPC clients that could return a simple errIncompleteGRPCRequest.

RA.AdministrativelyRevokeCertificate

https://github.com/letsencrypt/boulder/blob/7d4facc40363583c1a10a1b53813db772eb4f430/ra/ra.go#L1838-L1844

RA.AdministrativelyRevokeCertificate >> RA.revokeCertificate >> SA.RevokeCertificate

https://github.com/letsencrypt/boulder/blob/7d4facc40363583c1a10a1b53813db772eb4f430/ra/ra.go#L1886-L1890 https://github.com/letsencrypt/boulder/blob/7d4facc40363583c1a10a1b53813db772eb4f430/ra/ra.go#L1752-L1760 https://github.com/letsencrypt/boulder/blob/7d4facc40363583c1a10a1b53813db772eb4f430/sa/sa.go#L1709-L1712

RA.AdministrativelyRevokeCertificate >> RA.revokeCertificate >> SA.AddBlockedKey

https://github.com/letsencrypt/boulder/blob/7d4facc40363583c1a10a1b53813db772eb4f430/ra/ra.go#L1778-L1780 https://github.com/letsencrypt/boulder/blob/7d4facc40363583c1a10a1b53813db772eb4f430/sa/sa.go#L1951-L1954

beautifulentropy avatar Jan 13 '22 22:01 beautifulentropy

When these happen across RPC boundaries, they get wrapped in a gRPC error message (with code = , rpc = etc). So this may be mainly an issue with the inmem wrappers. We could give them their own error wrapper type?

jsha avatar Jan 18 '22 18:01 jsha

When these happen across RPC boundaries, they get wrapped in a gRPC error message (with code = , rpc = etc). So this may be mainly an issue with the inmem wrappers. We could give them their own error wrapper type?

Ah, this makes a ton of sense. Yeah, I think that could work.

beautifulentropy avatar Jan 18 '22 19:01 beautifulentropy

Closing this out. I'm pretty confident that it's not a big value add.

beautifulentropy avatar Nov 04 '22 00:11 beautifulentropy