Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crash when player joins #55

Closed
ChaosWormz opened this issue Jun 26, 2021 · 7 comments
Closed

Server crash when player joins #55

ChaosWormz opened this issue Jun 26, 2021 · 7 comments

Comments

@ChaosWormz
Copy link

2021-06-26 07:17:44: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'wieldview' in callback environment_Step(): ...netest/worlds/Bananaland_World/worldmods/skinsdb/api.lua:8: attempt to call method 'get_string' (a nil value)
2021-06-26 07:17:44: ERROR[Main]: stack traceback:
2021-06-26 07:17:44: ERROR[Main]: ...netest/worlds/Bananaland_World/worldmods/skinsdb/api.lua:8: in function 'get_player_skin'
2021-06-26 07:17:44: ERROR[Main]: ...etest/worlds/Bananaland_World/worldmods/skinsdb/init.lua:47: in function 'update_player_visuals'
2021-06-26 07:17:44: ERROR[Main]: ...and_World/worldmods/minetest-3d_armor/wieldview/init.lua:64: in function 'update_wielded_item'
2021-06-26 07:17:44: ERROR[Main]: ...and_World/worldmods/minetest-3d_armor/wieldview/init.lua:75: in function 'func'
2021-06-26 07:17:44: ERROR[Main]: /usr/share/minetest/builtin/common/after.lua:20: in function </usr/share/minetest/builtin/common/after.lua:5>
2021-06-26 07:17:44: ERROR[Main]: /usr/share/minetest/builtin/game/register.lua:425: in function </usr/share/minetest/builtin/game/register.lua:409>

@VanessaE
Copy link

VanessaE commented Jun 26, 2021

At the time of the crash, armor was on commit 1dec1f2, skinsdb was on commit c53158d1. Both on their master branches.

Deleting the skin for the affected user does not help.

Deleting the player entirely with /remove_player DOES get around the crash (i.e. he can then sign on normally), but that's kinda drastic...

My best guess is that armor is somehow getting an invalid or corrupt player object, and passing it as nil to skinsdb on-join, but it seems to only affect the one user.

@bell07
Copy link

bell07 commented Jun 26, 2021

Got it. It's a typo in 3d_armor/wieldview/init.lua
See #56

@VanessaE
Copy link

VanessaE commented Jul 1, 2021

Looks like this is not yet fixed. Armor is at commit 38fc2cf and still seeing crashes, with identical error text (and line numbers).

@bell07
Copy link

bell07 commented Jul 2, 2021

Hm
storage:set_string(player:get_player_name(), player:get_string("skinsdb:skin_key"))

player:get_player_name() does exists but player:get_string() does not? Is the method removed from minetest in the meantime?

In skinsdb

	local meta = player:get_meta()
	if meta:get("skinsdb:skin_key") then
		-- Move player data prior July 2018 to mod storage
		storage:set_string(player:get_player_name(), player:get_string("skinsdb:skin_key"))
		meta:set_string("skinsdb:skin_key", "")
	end

is compatibility code for migration away from player inventory storage. The lines seems to be not compatible anymore to current minetest version and can be removed. Please test the change and setup an PR to skinsdb.

@BuckarooBanzay
Copy link
Member

I think the variable-name was just wrong, it should read from meta, not player 🤦

See: minetest-mods/skinsdb#61

@bell07
Copy link

bell07 commented Jul 2, 2021

Is the bug really so old? The code is from 2018, for compatibility of previously skinsdb versions with player meta usage. Seem the compatibility newer worked?
My proposal is to remove the lines, but if your change helps, we can keep the compatibility code

@bell07
Copy link

bell07 commented Jul 2, 2021

Since the issue is in skinsdb, I reopened minetest-mods/skinsdb#60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants