Problem in getting friends list

I am getting error in fetching list of friends. my code is
local nk = require(“nakama”)

local function friends_list(context, payload)
local user_id=context.user_id
local limit=100
– States are: friend(0), invite_sent(1), invite_received(2), blocked(3)
local state=0
local cursor=nil
local friends=nk.friends_list(user_id, state, limit, cursor)
–local friends=nk.account_get_id(user_id)
–for _, m in ipairs(friends)
–do
– States are: friend(0), invite_sent(1), invite_received(2), blocked(3)
– local msg = string.format(“Friend username %q has state %q”, m.user.username, m.state)
– nk.logger_info(msg)
–end
return nk.json_encode(friends)
end

nk.register_rpc(friends_list,“freindlist”)

Getting Error

{“code”:13,“error”:{“Type”:2,“Object”:"/nakama/data/modules/friends_list.lua:9: attempt to call a non-function object",“StackTrace”:“stack traceback:\n\t/nakama/data/modules/friends_list.lua:9: in main chunk\n\t[G]: ?”,“Cause”:null},“message”:"/nakama/data/modules/friends_list.lua:9: attempt to call a non-function object\nstack traceback:\n\t/nakama/data/modules/friends_list.lua:9: in main chunk\n

@kmsudhir Assuming that line 9 of your script is the nk.friends_list(...) call, the error is basically saying no such function exists.

Start by checking your server version. The friends list function was added to the runtime in 2.14.1, are you running at least that version?

actually i am running through the docker-composer. How to find the version of docker-composer.

I am using below function for running server.

sudo docker-compose -f docker-compose.yml up

Nakam version
1.4.0+93669f8

sudo docker-compose down
Removing network ubuntu_default

sudo docker pull heroiclabs/nakama

Using default tag: latest

Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:53852->[::1]:53: read: connection refused

I am getting above messave when i am updating nakama from docker.

Might just be a copy paste issue. But your register call has freindlist instead of friendlist…

And shouldn’t those arguments be reversed? String name first then the function? Or is that how it is on Lua?