Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

indecipherable thrift error #69

Open
blampe opened this issue Oct 9, 2015 · 9 comments
Open

indecipherable thrift error #69

blampe opened this issue Oct 9, 2015 · 9 comments

Comments

@blampe
Copy link
Contributor

blampe commented Oct 9, 2015

Reported by @Torwegia:

(env)uber@tor:~$ tcurl --timeout 10000 -p 127.0.0.1:21300 -t thrift/service.thrift  foo FOO::auth -3 '{"paymentProfileId": "a", "jobId": "b", "amount": 3}'
TCURL ERROR: Got unexpected unserializable thrift for arg3 ~ { endpoint: 'BANKEMOJI::auth',
  direction: 'out.request',
  ok: undefined,
  bodyErr:
   { [TchannelThriftHandlerStringifyErrorBodyFailedError: Could not stringify body (res2) argument.
   Expected Thrift serializable res2 for endpoint FOO::auth.]
     type: 'tchannel-thrift-handler.stringify-error.body-failed',
     message: 'Could not stringify body (res2) argument.\nExpected Thrift serializable res2 for endpoint BANKEMOJI::auth.',
     isSerializationError: true,
     endpoint: 'BANKEMOJI::auth',
     ok: undefined,
     body: { paymentProfileId: 'a', jobId: 'b', amount: 3 },
     direction: 'out.request',
     name: 'TchannelThriftHandlerStringifyErrorBodyFailedError',
     causeMessage: 'invalid argument, expected a buffer',
     origMessage: 'invalid argument, expected a buffer',
     fullType: 'tchannel-thrift-handler.stringify-error.body-failed~!~bufrw.invalid-argument' } }
Error response received for the as-thrift request.
[Error: Got unexpected unserializable thrift for arg3]

Thrift file looks like this:

string auth(
    1: required UUID paymentProfileId,
    2: required UUID jobId,
    3: required i64 amount,
@kriskowal
Copy link
Contributor

kriskowal commented Oct 9, 2015

  • First step is to unravel transitive error.cause and log the entire chain. The wrapped error from TChannel is not at its face useful to the end user. The next in the chain "invalid argument, expected buffer" is more useful and I believe has properties that show exactly where the error occurred.
  • Secondly, we need to upgrade TChannel in TCurl for the new ThriftRW which can coerce numbers to buffers.
  • Thirdly, we need to make a special case for this class of error and display what the user needs.

@ShanniLi ShanniLi self-assigned this Oct 9, 2015
@ShanniLi
Copy link
Contributor

ShanniLi commented Oct 9, 2015

This commit should fix the error:
3cd2575

I have assign the issue to myself as a task to improve the tcurl error messages.

@111eric
Copy link

111eric commented Oct 12, 2015

We actually just ran into the same issue, and after some digging we think the issue is with i64 type. If we change it to i32 it works fine, but otherwise we get the stringify issue above.

Any insights as of why this happens? Thanks!

@kriskowal
Copy link
Contributor

Rolling a fix up now. We will deploy a new TCurl tomorrow or wednesday.

@danqing
Copy link

danqing commented Oct 12, 2015

Awesome thanks @kriskowal !

Can we somehow patch the updated version before it's deployed?

@danqing
Copy link

danqing commented Oct 12, 2015

And just realized that it's the same as #54.

@kriskowal
Copy link
Contributor

Fixed on master and npm i [email protected]

@111eric
Copy link

111eric commented Oct 12, 2015

@kriskowal
Thanks for the quick turn on this.

When will 4.16.0 be available?

@kriskowal
Copy link
Contributor

@111eric it is available to install from npm now. We will roll it into production this week. This version also has a man page by @ShanniLi

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants