Skip to content

Error on calling box.info function #41

@pparshin

Description

@pparshin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions