Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on calling box.info function #41

Open
pparshin opened this issue Mar 30, 2020 · 1 comment
Open

Error on calling box.info function #41

pparshin opened this issue Mar 30, 2020 · 1 comment

Comments

@pparshin
Copy link

pparshin commented Mar 30, 2020

Hi,

I'm trying to get the information about an instance calling a function box.info or returning 'box.info.replication'. As a result I got the error like that: "Error decoding packet type 0: msgp: attempted to decode type "int" with method for "str""

I suppose that library unable to parse output like vclock: {1: 1203983550}, e.g.:

  replication:
    1:
      id: 1
      uuid: 294e7310-13f0-4690-b136-169599e87ba0
      lsn: 1203755966
    2:
      id: 2
      uuid: 62f23532-0291-42bf-b133-2c9db163aef6
      lsn: 0
      upstream:
        peer: user@replication:14301
        lag: 0.00088262557983398
        status: follow
        idle: 0.3704827
    downstream:
       status: follow
       idle: 0.077566780149937
       vclock: {1: 1203983550}

For anyone who are looking for a workaround to fetch the box info use eval:

local repl = {}
for i, r in pairs(box.info.replication) do
  if r.downstream ~= nil then
    r.downstream.vclock = string.format("%s", r.downstream.vclock)
  end
  repl[r.id] = r
end
return repl
@viciious
Copy link
Owner

viciious commented Mar 31, 2020

I suppose that library unable to parse output like vclock: {1: 1203983550}

This is a known limitation of tinylib/msgp: tinylib/msgp#257

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

No branches or pull requests

2 participants