tarantool / crud

Easy assess to data stored in vshard cluster
BSD 2-Clause "Simplified" License
40 stars 15 forks source link

Serialized errors from vshard #186

Open ArtDu opened 3 years ago

ArtDu commented 3 years ago

It's hard to parse vshard's internal errors.

0.0.0.0:3301> crud.get("vets", 11111111-1111-1111-1111-111111111111)
---
- null
- line: 75
  class_name: Get
  err: "Failed to call get on storage-side: Call: Failed for 6558ab95-7c60-48fe-8d46-75d428033d54:
    Function returned an error: {\"code\":77,\"base_type\":\"ClientError\",\"type\":\"ClientError\",\"message\":\"Connection
    refused\",\"trace\":[{\"file\":\"builtin\\/box\\/net_box.lua\",\"line\":541}]}\nstack
    traceback:\n\t...inic/cluster/.rocks/share/tarantool/crud/common/call.lua:138:
    in function 'single'\n\t...ng-petclinic/cluster/.rocks/share/tarantool/crud/get.lua:68:
    in function 'func'\n\t...ic/cluster/.rocks/share/tarantool/crud/common/schema.lua:89:
    in function <...ic/cluster/.rocks/share/tarantool/crud/common/schema.lua:84>\n\t[C]:
    in function 'pcall'\n\tbuiltin/box/console.lua:402: in function <builtin/box/console.lua:378>\n\t[C]:
    at 0x0104178834"
  file: '...ng-petclinic/cluster/.rocks/share/tarantool/crud/get.lua'
  str: "Get: Failed to call get on storage-side: Call: Failed for 6558ab95-7c60-48fe-8d46-75d428033d54:
    Function returned an error: {\"code\":77,\"base_type\":\"ClientError\",\"type\":\"ClientError\",\"message\":\"Connection
    refused\",\"trace\":[{\"file\":\"builtin\\/box\\/net_box.lua\",\"line\":541}]}\nstack
    traceback:\n\t...inic/cluster/.rocks/share/tarantool/crud/common/call.lua:138:
    in function 'single'\n\t...ng-petclinic/cluster/.rocks/share/tarantool/crud/get.lua:68:
    in function 'func'\n\t...ic/cluster/.rocks/share/tarantool/crud/common/schema.lua:89:
    in function <...ic/cluster/.rocks/share/tarantool/crud/common/schema.lua:84>\n\t[C]:
    in function 'pcall'\n\tbuiltin/box/console.lua:402: in function <builtin/box/console.lua:378>\n\t[C]:
    at 0x0104178834"
...

It would be possible to add some cause field, where the internal error would lie like a table, but no string Something like that:

0.0.0.0:3301> crud.get("vets", 11111111-1111-1111-1111-111111111111)
---
- null
- line: 75
  class_name: Get
  err: "Failed to call get on storage-side: Call: Failed for 6558ab95-7c60-48fe-8d46-75d428033d54"
  cause: - code: 78
           base_type: ClientError
           type: ClientError
           message: Connection refused
           trace:
            ....
  file: '...ng-petclinic/cluster/.rocks/share/tarantool/crud/get.lua'
...
akudiyar commented 3 years ago

Affects https://github.com/tarantool/cartridge-java/issues/89

olegrok commented 3 years ago

Could we transfer this issue to "tarantool/errors"?

I like more "general" solutions. So it could be useful not only for crud.

ArtDu commented 3 years ago

Yeah, you are right, it is better to implement this in "tarantool/errors", after that in crud to fix the passing error through the new functionality. I will create a ticket in "tarantool/errors".

DifferentialOrange commented 1 year ago

So it seems that migrating to box.error should solve the issue, if it will work fine with vshard, I think it's better to wait until 1.10.x end of support then.