minetest-mods / technic

Technic mod for Minetest
Other
145 stars 155 forks source link

Latest commit(s) causes crash at server start #544

Closed crabctrl closed 4 years ago

crabctrl commented 4 years ago

The latest commit (I think) breaks the pack. Relevant logs:

Apr 26 23:56:16 loh-toronto minetestserver[3892350]: 2020-04-26 23:56:16: ACTION[Main]: Server: Shutting down
Apr 26 23:56:16 loh-toronto minetestserver[3892350]: 2020-04-26 23:56:16: ERROR[Main]: ModError: Failed to load and run script from /var/lib/minetest/.minetest/games/comtest/mods/technic_chests/init.lua:
Apr 26 23:56:16 loh-toronto minetestserver[3892350]: 2020-04-26 23:56:16: ERROR[Main]: Invalid crafting recipe (output="technic:iron_locked_chest 1")
Apr 26 23:56:16 loh-toronto minetestserver[3892350]: 2020-04-26 23:56:16: ERROR[Main]: stack traceback:
Apr 26 23:56:16 loh-toronto minetestserver[3892350]: 2020-04-26 23:56:16: ERROR[Main]:         [C]: in function 'register_craft'
Apr 26 23:56:16 loh-toronto minetestserver[3892350]: 2020-04-26 23:56:16: ERROR[Main]:         ...inetest/games/comtest/mods/technic_chests/iron_chest.lua:26: in main chunk
Apr 26 23:56:16 loh-toronto minetestserver[3892350]: 2020-04-26 23:56:16: ERROR[Main]:         [C]: in function 'dofile'
Apr 26 23:56:16 loh-toronto minetestserver[3892350]: 2020-04-26 23:56:16: ERROR[Main]:         ...est/.minetest/games/comtest/mods/technic_chests/init.lua:12: in main chunk
Apr 26 23:56:16 loh-toronto systemd[1]: minetest@comtest.service: Main process exited, code=exited, status=1/FAILURE
Apr 26 23:56:16 loh-toronto systemd[1]: minetest@comtest.service: Failed with result 'exit-code'.
crabctrl commented 4 years ago

I have confirmed that it is only the latest commit, fb4fef7, that causes this issue, introduced by #530 ; checking out to the previous commit, everything appears to work.

auouymous commented 4 years ago

Recipe has a table of tables of strings.

type = "shapeless",
recipe = {
    {'basic_materials:padlock'},
    {'technic:gold_chest'},
}

It should only have a table of strings.

type = "shapeless",
recipe = {'basic_materials:padlock', 'technic:gold_chest'}
d-stephane commented 4 years ago

After apply this fix, server start ok but if i try to put a gold locked chest the server crash :

ServerError: AsyncErr: ServerThread::run Lua:
Runtime error from mod 'technic_chests' in callback item_OnPlace(): Runtime error from mod 'technic_chests'
in callback node_on_construct(): ...test_5.2/bin/../mods/technic/technic_chests/register.lua:89:
attempt to index upvalue 'fs_helpers' (a nil value)

stack traceback:
    ...test_5.2/bin/../mods/technic/technic_chests/register.lua:89: in function 'set_formspec'
    ...test_5.2/bin/../mods/technic/technic_chests/register.lua:293: in function <...test_5.2/bin/../mods/technic/technic_chests/register.lua:290>
    [C]: in function 'add_node'
    ...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:368: in function <...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:258>
stack traceback:
    [C]: in function 'add_node'
    ...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:368: in function <...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:258>

The problem is the same with all the technic chests

My server versin : 5.3 My system : Debian Buster

BuckarooBanzay commented 4 years ago

After apply this fix, server start ok but if i try to put a gold locked chest the server crash :

ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'technic_chests' in callback item_OnPlace(): Runtime error from mod 'technic_chests' in callback node_on_construct(): ...test_5.2/bin/../mods/technic/technic_chests/register.lua:89: attempt to index upvalue 'fs_helpers' (a nil value)

stack traceback: ...test_5.2/bin/../mods/technic/technic_chests/register.lua:89: in function 'set_formspec' ...test_5.2/bin/../mods/technic/technic_chests/register.lua:293: in function <...test_5.2/bin/../mods/technic/technic_chests/register.lua:290> [C]: in function 'add_node' ...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:368: in function <...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:258> stack traceback: [C]: in function 'add_node' ...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:368: in function <...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:258>

The problem is the same with all the technic chests

My server versin : 5.3 My system : Debian Buster

@d-stephane Are you sure it is because of that commit, this looks unrelated: the responsible part was last touched 3 years ago: https://github.com/minetest-mods/technic/blame/fb4fef783b605dcdc73554019ef46d8354614ad4/technic_chests/register.lua#L89

d-stephane commented 4 years ago

No, I'm not 100% sure. I will test with version 5.2 of the server

d-stephane commented 4 years ago

WIth minetest 5.2 and with just the mods basic_materials - pipeworks - technic After put a gold chest the server crash :

2020-04-27 20:45:51: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'technic_chests' in callback item_OnPlace(): Runtime error from mod 'technic_chests' in callback node_on_construct(): ...test_5.2/bin/../mods/technic/technic_chests/register.lua:91: attem
2020-04-27 20:45:51: ERROR[Main]: pt to index upvalue 'fs_helpers' (a nil value)
2020-04-27 20:45:51: ERROR[Main]: stack traceback:
2020-04-27 20:45:51: ERROR[Main]:   ...test_5.2/bin/../mods/technic/technic_chests/register.lua:91: in function 'set_formspec'
2020-04-27 20:45:51: ERROR[Main]:   ...test_5.2/bin/../mods/technic/technic_chests/register.lua:316: in function <...test_5.2/bin/../mods/technic/technic_chests/register.lua:313>
2020-04-27 20:45:51: ERROR[Main]:   [C]: in function 'add_node'
2020-04-27 20:45:51: ERROR[Main]:   ...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:368: in function <...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:258>
2020-04-27 20:45:51: ERROR[Main]: stack traceback:
2020-04-27 20:45:51: ERROR[Main]:   [C]: in function 'add_node'
2020-04-27 20:45:51: ERROR[Main]:   ...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:368: in function <...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:258>

This version of technic works with which version of minetest for you?

VanessaE commented 4 years ago

@auouymous's remark about the recipe format is correct, The latest commit (as of this remark) broke it.; @d-stephane you're barking up the wrong tree.

auouymous commented 4 years ago

@d-stephane Both of your logs show 5.2 as version, and the second log has incorrect line numbers (local changes or old version). If you didn't make changes, actually have the latest version and use git to download technic, try git checkout 4a9ad94 to remove the broken commit.

d-stephane commented 4 years ago

After loading the commit 4a9ad94 :

2020-04-28 08:06:40: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'technic_chests' in callback item_OnPlace(): Runtime error from mod 'technic_chests' in callback node_on_construct(): ...test_5.2/bin/../mods/technic/technic_chests/register.lua:89: attem
2020-04-28 08:06:40: ERROR[Main]: pt to index upvalue 'fs_helpers' (a nil value)
2020-04-28 08:06:40: ERROR[Main]: stack traceback:
2020-04-28 08:06:40: ERROR[Main]:   ...test_5.2/bin/../mods/technic/technic_chests/register.lua:89: in function 'set_formspec'
2020-04-28 08:06:40: ERROR[Main]:   ...test_5.2/bin/../mods/technic/technic_chests/register.lua:293: in function <...test_5.2/bin/../mods/technic/technic_chests/register.lua:290>
2020-04-28 08:06:40: ERROR[Main]:   [C]: in function 'add_node'
2020-04-28 08:06:40: ERROR[Main]:   ...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:368: in function <...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:258>
2020-04-28 08:06:40: ERROR[Main]: stack traceback:
2020-04-28 08:06:40: ERROR[Main]:   [C]: in function 'add_node'
2020-04-28 08:06:40: ERROR[Main]:   ...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:368: in function <...games/minetest/minetest_5.2/bin/../builtin/game/item.lua:258>

which version of minetest do you use?

auouymous commented 4 years ago

Your problem has nothing to do with this issue. By changing to 4a9ad94, you removed the faulty code this issue is about and that @BuckarooBanzay's patch fixes.

You should open a new issue and post the entire log there. But read the entire log first, it might reveal a missing dependency, such as no mesecons.

d-stephane commented 4 years ago

I did not have the latest version of pipeworks. After updating there is no more problem. Without mesecon mode it's ok too

top4ek commented 4 years ago

Got exacly same trace as @katp32. Server version 5.2.0. Rolling back to 4a9ad94 "fixes" server boot.

dokutan commented 4 years ago

Since i could not find a pull request to fix this bug, i made one. I have confirmed that the fix works with 5.2.0 and 5.3.0 versions of minetest.