postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.85k stars 839 forks source link

unable to use grpc reflection when health checks configured #10844

Open cgeers opened 2 years ago

cgeers commented 2 years ago

Is there an existing issue for this?

Describe the Issue

When using postman to interrogate a grpc server's exposed services via reflection, an "unkown error" is reported if the default health check service is enabled. Digging around in the logs, from logs/renderer-requester.log I see:

[1424][1649863276559][requester][error][{"name":"Error","message":"unknown error","stack":"Error
    at ClientDuplexStreamImpl.dataCallback (/Applications/Postman.app/Contents/Resources/app.asar/node_modules/grpc-reflection-js/build/src/client.js:111:28)
    at ClientDuplexStreamImpl.emit (events.js:315:20)
    at ClientDuplexStreamImpl.EventEmitter.emit (domain.js:467:12)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at ClientDuplexStreamImpl.Readable.push (internal/streams/readable.js:223:10)
    at Object.onReceiveMessage (/Applications/Postman.app/Contents/Resources/app.asar/node_modules/@grpc/grpc-js/build/src/client.js:382:24)
    at Object.onReceiveMessage (/Applications/Postman.app/Contents/Resources/app.asar/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:291:178)
    at /Applications/Postman.app/Contents/Resources/app.asar/node_modules/@grpc/grpc-js/build/src/call-stream.js:217:74
    at processTicksAndRejections (internal/process/task_queues.js:75:11)"}]

The default and service specific health checks appear to be working properly when using other client utilities (grpcurl, grpc_cli, etc.) but postman seems to have trouble with it.

Steps To Reproduce

Screenshots or Videos

Screen Shot 2022-04-13 at 12 10 40 PM

Operating System

macOS

Postman Version

9.15.13

Postman Platform

Postman App

Additional Context?

when disabling health checks, using postman grpc server reflection appears to work well.

vitaliyantonov22 commented 2 years ago

The same one

codenirvana commented 1 year ago

@cgeers @vitaliyantonov22 can you share a demo repository to reproduce this behavior locally to fast-track the fix?

pnquest commented 1 year ago

I have just run into this, it doesn't specifically have to be the health check that is configured. Any service that hosts more than a single GRPC service on the same endpoint will cause this behavior. In asp.net core that would look like this in the startup code:

app.UseEndpoints(e => 
{
  e.MapGrpcService<Service1>();
  e.MapGrpcService<Service2>();
});

If either map service call is commented out, postman will work fine, but when both are active, it fails.

chadxzs commented 1 year ago

I ran into this today as well. @pnquest description is reproducible for me, namely, having multiple services on the same port. I commented out my health check service and Postman reflection worked.