uber-node / tcurl

A command line utility to talk to tchannel servers
MIT License
36 stars 7 forks source link

Cryptic thrift error message when using unknown endpoint name. #15

Closed Raynos closed 9 years ago

Raynos commented 9 years ago
tcurl -p localhost:51015 populous health -t ~/Uber/populous/thrift/

/Users/jho/.nvm/v0.10.26/lib/node_modules/tcurl/node_modules/tchannel/node_modules/bufrw/result.js:32
        throw self.err;
                  ^
Error: type health_args not found

We should warn users that health is an invalid endpoint because it doesnt have a service. Try MyService::health

cc @kriskowal @ShanniLi

uber-liang commented 9 years ago

+1 on fixing this issue. I'm a beginner of tchannel and I wasted 1+ hour on this error today.

ShanniLi commented 9 years ago

cc @leizha, that is not really a tcurl issue. thriftify should provide better error messages.

Raynos commented 9 years ago

@malandrew will look into fixing this;

This is a tcurl issue not a thriftify issue. It's all about tcurl user experience.

andrewdeandrade commented 9 years ago

Starting on this now.

andrewdeandrade commented 9 years ago

This issue appears to be resolved. Here's what I get when I try to reproduce it.

known good service and endpoint:

~/dsg/tchannel/node$ tcurl -p 127.0.0.1:21300 autobahn health_v1
'Got call response ok'
'hello from autobahn\n'

endpoint that doesn't exist, but service does:

~/dsg/tchannel/node$ tcurl -p 127.0.0.1:21300 autobahn health_v2
{ [TchannelBadRequestError: no such endpoint service="autobahn" endpoint="health_v2"]
  type: 'tchannel.bad-request',
  message: 'no such endpoint service="autobahn" endpoint="health_v2"',
  isErrorFrame: true,
  codeName: 'BadRequest',
  errorCode: 6,
  originalId: 2,
  name: 'TchannelBadRequestError',
  fullType: 'tchannel.bad-request' }
no such endpoint service="autobahn" endpoint="health_v2"

service doesn't exist:

~/dsg/tchannel/node$ tcurl -p 127.0.0.1:21300 autobahns health_v1
{ [TchannelDeclinedError: no peer available for request]
  type: 'tchannel.declined',
  message: 'no peer available for request',
  isErrorFrame: true,
  codeName: 'Declined',
  errorCode: 4,
  originalId: 2,
  name: 'TchannelDeclinedError',
  fullType: 'tchannel.declined' }
no peer available for request

Going to see if maybe this error only manifests itself when you specify a thrift file.

Raynos commented 9 years ago

@malandrew this is a thrift only thing.

You need to go into thrift mode with -t thriftFile

The JSON code has sensible error messages; this is only a problem for thrift endpoints.

andrewdeandrade commented 9 years ago

Closed by #33