Riak Core with EUnit [error] riak_sysmon_filter:get_node_map: error badarg

I’m trying to run $ rebar3 shell with Riak Core but I keep getting this error:

[error] riak_sysmon_filter:get_node_map: error badarg @ [{ets,match_object,[sys_dist,‘_’],[{error_info,#{cause => id,module => erl_stdlib_errors}}]},{ets,tab2list,1,[{file,“ets.erl”},{line,771}]},{riak_sysmon_filter,get_node_map,0,[{file,“/home/morgan/Documents/Programming/Biggest_indexer2/_build/default/lib/riak_sysmon/src/riak_sysmon_filter.erl”},{line,474}]},{riak_sysmon_filter,init,1,[{file,“/home/morgan/Documents/Programming/Biggest_indexer2/_build/default/lib/riak_sysmon/src/riak_sysmon_filter.erl”},{line,184}]},{gen_server,init_it,2,[{file,“gen_server.erl”},{line,851}]},{gen_server,init_it,6,[{file,“gen_server.erl”},{line,814}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,240}]}]

I have already put net_kernel:start/2 when I start the apps. Any suggestions? Please ask for more details if needed. We are very confused.

1 Like

There is a similar issue here. Looks like you need to set the name for your node (via vm.args or directly with name or sname when starting shell).

Thank you for your reply, however like I said previously I have already tried net_kernel:start/2 which i found from that issue previously. Also my colleagues and I had tried using name and sname via vm.args before and it didn’t fix the issue. Any other suggestions?

hmm, can you share more details? Is riak_core app started? How do you start EUnit? Whats your build tool and it’s configuration? Which OTP you’re using?

Hey, a colleague of his here. We’re using Erlang/OTP 25 and we run Rebar with $ rebar3 shell and $ rebar3 eunit -c. Riak Core should be properly started as we’ve got application:ensure_all_started(riak_core) in quite a few places.

Don’t know why setting the --name in “vm.args” didn’t work but I think I managed to fix this specific issue by setting the node’s name when running the commands (i.e. $ rebar3 shell --name test@127.0.0.1, etc.), but now another error popped up:

08:12:41.225 [error] gen_server riak_core_capability terminated with reason: no function clause matching orddict:fetch(‘test@127.0.0.1’, ) line 80
08:12:41.225 [error] CRASH REPORT Process riak_core_capability with 0 neighbours crashed with reason: no function clause matching orddict:fetch(‘test@127.0.0.1’, ) line 80

Maybe we haven’t set the risk node up correctly?

1 Like

This box in the error message () is actually [], took me a while to figure that out :sweat_smile:

And yes, this looks like a configuration error of sorts.

The docs for orddict:fetch/2 says that it assumes that the key (test@127.0.0.1 in this case) is present in the orrdict (which is empty in this case, hence the failure). The orddict in question is taken from the supported field in the #state record of riak_core_capability, see here. I have no idea how this field gets filled, however, I never used riak_core :man_shrugging:

3 Likes

I think the flags in vm.args are prefixed with - not --.

That might bi unnecessary. Is riak_core set as dependency in .app.src file for your application? Is your application started automatically when shell boots (you can set in in rebar.config)? Answer to both of these should be “yes”.

If that doesn’t help, there is a tutorial repo that might be helpful.

1 Like

The flag in vm.args is prefixed with -, sorry for the confusion. riak_core and its necessary components are also set as dependencies.

I’ve also already made a demo using that tutorial you linked as a guide and it works fine. All the make commands and the Common Tests work as intended, it’s just that I’m trying to figure out how to get riak_core to work properly with rebar3 shell and rebar3 eunit, which I haven’t really seen any examples of.