minetest-mods / i3

:rocket: A next-generation inventory for Minetest 5.6+
Other
41 stars 26 forks source link

Runtime error from mod 'skinsdb' in callback on_joinplayer() #57

Closed mrbid closed 2 years ago

mrbid commented 2 years ago
2022-02-19 08:20:42: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'skinsdb' in callback on_joinplayer(): (load):19: core.check_player_privs expects a player or playername as argument.
2022-02-19 08:20:42: ERROR[Main]: stack traceback:
2022-02-19 08:20:42: ERROR[Main]:   [C]: in function 'error'
2022-02-19 08:20:42: ERROR[Main]:   ...home/x/mtnew/minetest/bin/../builtin/game/misc.lua:23: in function 'check_player_privs'
2022-02-19 08:20:42: ERROR[Main]:   (load):19: in function 'is_creative_enabled'
2022-02-19 08:20:42: ERROR[Main]:   (load):1258: in function 'hide_items'
2022-02-19 08:20:42: ERROR[Main]:   (load):1275: in function 'get_items_fs'
2022-02-19 08:20:42: ERROR[Main]:   (load):1496: in function 'make_fs'
2022-02-19 08:20:42: ERROR[Main]:   (load):170: in function 'func'
2022-02-19 08:20:42: ERROR[Main]:   ...ilder/worldmods/armor_mods/3d_armor/3d_armor/api.lua:183: in function 'run_callbacks'
2022-02-19 08:20:42: ERROR[Main]:   ...orlds/builder/worldmods/system_mods/skinsdb/init.lua:49: in function 'update_player_visuals'
2022-02-19 08:20:42: ERROR[Main]:   ...ilder/worldmods/armor_mods/3d_armor/3d_armor/api.lua:358: in function 'set_player_armor'
2022-02-19 08:20:42: ERROR[Main]:   ...worlds/builder/worldmods/system_mods/skinsdb/api.lua:44: in function 'update_player_skin'
2022-02-19 08:20:42: ERROR[Main]:   ...orlds/builder/worldmods/system_mods/skinsdb/init.lua:61: in function '?'
2022-02-19 08:20:42: ERROR[Main]:   .../x/mtnew/minetest/bin/../builtin/game/register.lua:425: in function <.../x/mtnew/minetest/bin/../builtin/game/register.lua:409>

Guys you can't just close this issue, we need to workout why this is happening. The skinsdb and 3d_armor mods are the latest versions. Why is this happening? Minetest server and client 5.5.0.

I will connect to a server on a fresh boot (from an account with creative), everything is fine, I will disconnect and reconnect with the same account and on the re-connect it throws me this error right as my player joins the game. Every time without fail.

Removing skinsdb solves this problem.

SmallJoker commented 2 years ago

This appears to be a "race condition" in a limited manner. Both, skinsdb and i3 use register_on_joinplayer to set up their data. However, skinsdb triggers a formspec update which requires i3 to be initialized already - which is yet not the case. This is also why optional dependencies seem to magically fix things for you.

https://github.com/minetest-mods/i3/blob/55c6d09389175fc75e547260dbe8559e5b421d18/src/callbacks.lua#L178

replaced with

table.insert(core.registered_on_joinplayers, 1, function(player)

Should fix this particular issue.

kilbith commented 2 years ago

@mrbid is the given patch makes it work for you ?

mrbid commented 2 years ago

Good news, this certainly seems to have fixed it, so far the second login has not crashed the server.

Thank you, I am very happy to have i3 working on my servers. It is a very good inventory and everyone involved in its development has done a really great job.

  1. The quick crafting is much simpler and elegant than unified_inventory_plus.
  2. The inventory sorting is great.
  3. i3 loads much faster than unified_inventory on server boots. (I have ~60k registered nodes) That's 12 minutes for unified and around a minute for i3.
  4. Having backpack inventory viewable on the same tab as the main inventory feels less encumbering.
  5. Although I was reluctant at first, once adding support for crafting type icons, it is much better, anything that reduces dependency on language specific labels and replaces them with universally understandable icons is obviously a step in the right direction. Ofc the tooltip is also still there if needed. It's good.

Any other niggles I may have can be changed in a fork, for example, no API to add auxiliary buttons to the bottom bar with home, settings, etc, and if I am a creative user there seems to be no way for me to see crafting recipes which is a bit annoying to have to keep revoking creative to see them but, it's not the end of the world. But I guess it would be nice to have a little button to toggle between recipe view and creative.

kilbith commented 2 years ago

https://github.com/minetest-mods/i3/commit/8b6f50b387e21f841e720819497934995a74731a