Getting '/opt/aerospike/sys/udf/lua/ldt/ldt_common.lua:554: attempt to index local \'userModuleRef\' (a boolean value)'' while using LLDT using Node client


#1

Hi,

I am getting the following error while trying to read from LLDT using Node Client.

{ code: 100,
  message: '/opt/aerospike/sys/udf/lua/ldt/ldt_common.lua:554: attempt to index local \'userModuleRef\' (a boolean value)',
  func: 'as_command_parse_udf_error',
  file: 'src/main/aerospike/as_command.c',
  line: 822 }

code:

var key = {
    ns: "test"
    set: "rate",
    key: 'client_time'
}
var llist = client.LargeList(key, 'accessTime', {timeout: 1000}, null);
var udfArgs = {module: 'udfs', funcname: 'count'};
llist.findRange(lastAccessTime, new Date().getTime(), udfArgs, function (err, res) {
    console.log(res, err);
});

I have already registered the UDF module “udfs” successfully, and was able to use it in normal client calls. Only when I use with LLDT it’s failing.

The UDF:

local function one(rec)
    return 1;
end

local function add(a, b)
    return a + b;
end

function count(stream)
    return stream:map(one):reduce(add);
end

Kindly help.