minetest-mods / mesecons

Mod for Minetest that adds digital circuitry [=Minecraft redstone]
https://mesecons.net
Other
211 stars 120 forks source link

Crash :-( #496

Closed VanessaE closed 4 years ago

VanessaE commented 4 years ago

This is with mesecons at commit b7873e8e02ea3098fe8b2858a67e829bc72e54b1

2019-11-02 20:19:55: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'mesecons' in callback environment_Step(): ...orld/worldmods/dreambuilder_modpack/mesecons/presets.lua:67: attempt to index local 'dir' (a nil value)
2019-11-02 20:19:55: ERROR[Main]: stack traceback:
2019-11-02 20:19:55: ERROR[Main]:       ...orld/worldmods/dreambuilder_modpack/mesecons/presets.lua:67: in function 'get_any_inputrules'
2019-11-02 20:19:55: ERROR[Main]:       ...rld/worldmods/dreambuilder_modpack/mesecons/internal.lua:95: in function 'get_any_rules'
2019-11-02 20:19:55: ERROR[Main]:       ...d/worldmods/dreambuilder_modpack/mesecons_wires/init.lua:81: in function <...d/worldmods/dreambuilder_modpack/mesecons_wires/init.lua:67>
2019-11-02 20:19:55: ERROR[Main]:       .../worldmods/dreambuilder_modpack/mesecons/actionqueue.lua:93: in function 'execute'
2019-11-02 20:19:55: ERROR[Main]:       .../worldmods/dreambuilder_modpack/mesecons/actionqueue.lua:84: in function 'func'
2019-11-02 20:19:55: ERROR[Main]:       ...ocal/share/minetest/builtin/profiler/instrumentation.lua:106: in function <...ocal/share/minetest/builtin/profiler/instrumentation.lua:100>
2019-11-02 20:19:55: ERROR[Main]:       /usr/local/share/minetest/builtin/game/register.lua:419: in function </usr/local/share/minetest/builtin/game/register.lua:399>
SmallJoker commented 4 years ago

Which mod combination causes this crash? It seems to happen on startup, likely being a problem with a registered node.

VanessaE commented 4 years ago

I'm not sure what the root cause is. It was my Creative server (the original one on port 30000), which is Dreambuilder minus most of Technic, with all available mod updates pulled-in several hours prior to the crash, (I mention this because those updates have not been pushed to my DB gitlab repo yet) plus the usual bunch of admin-related tools that all my servers use (such as xban, newplayer-rules, notice, etc.).

EDIT: my DB gitlab repo should now be what was on the server at the time of the crash, and my mod archive has everything both on and not on that server (https://minetest.daconcepts.com/my-main-mod-archive/)

SmallJoker commented 4 years ago

How often does the crash occur? Every server start, after hours/days of uptime? Thanks for the mod collection link, but that's a somewhat big amount to troubleshoot. First off, any of these that do not mention "mesecon" in one of their source files can be ignored. Afterwards there are still few left over that at least define mesecon actions in the nodedef.

Since you already got this entire collection, would it be possible for you to - say, run a copy of the map in a demo server and disable half the mods until it no longer happens? EDIT: Apparently the line numbers do not match: https://github.com/minetest/minetest/blob/master/builtin/game/register.lua . What's your server version? According to the server list it's between 5.0.0 and 5.1.0. Alternatively you could modify the affected function in register.lua to print the mod's origin each time it is executed.

VanessaE commented 4 years ago

So far, the crash has happened twice, that I've noticed anyway, and it's obviously not connected to server startup:

The first crash was after several hours of uptime, with routine player activity. The second crash happened about one minute after the (automatic, unattended) restart from that first crash.

After it restarted from the second crash, the server continued normally, with no action from me (or anyone else), with normal player activity.

The engine is at commit 95a37efc, and minetest_game is at 54bb0afe (2019-06-15 and -16, respectively). That is a bit old now, I suppose.

I am not in a position to fire up yet another server for testing, especially since this is an intermittent problem.

VanessaE commented 4 years ago

For reference, Dreambuilder on that server is just my standard distribution, minus worldedit_gui, castle_weapons, all the irritating/damaging/fighting stuff from camo, and the main technic tree (but retaining technic_chests, technic_cnc, and technic_worldgen).

Show list of Dreambuilder mods... ```bash root@daconcepts:~# ls /home/minetest/.minetest/worlds/Creative_World/worldmods/dreambuilder_modpack/ 3dmushrooms labels along_shore lavalamp anvil led_marquee areas locks areasprotector manholes arrowboards maptools asphalt memorandum asphaltstairs mesecons bakedclay mesecons_alias basic_materials mesecons_blinkyplant basic_signs mesecons_button bedrock mesecons_commandblock bees mesecons_delayer biome_lib mesecons_detector blox mesecons_doors bobblocks mesecons_extrawires building_blocks mesecons_fpga bushes mesecons_gates bushes_classic mesecons_hydroturbine campfire mesecons_insulated castle_farming mesecons_lamp castle_gates mesecons_lightstone castle_lighting mesecons_luacontroller castle_masonry mesecons_materials castle_shields mesecons_microcontroller castle_storage mesecons_movestones castle_tapestries mesecons_mvps caverealms_lite mesecons_noteblock cavestuff mesecons_pistons cblocks mesecons_powerplant coloredwood mesecons_pressureplates computer mesecons_random concrete mesecons_receiver concretestairs mesecons_solarpanel constructionarea mesecons_stickyblocks cool_trees mesecons_switch cottages mesecons_torch crafting_bench mesecons_walllever currency mesecons_wires datastorage misc_overrides delineator modpack.txt digidisplay molehills digilines moreblocks digistuff moreores display_blocks moretrees dreambuilder_hotbar mymillwork dreambuilder_mp_extras nature_classic dryplants nixie_tubes emergencyphone notice extranodes notify_hud_provider extra_stairsplus pipeworks facade plantlife_i18n fake_fire plasmascreen farming plasticbox ferns player_textures flowers_plus poisonivy framedglass prefab_redo gardening quartz gloopblocks readme.md glooptest replacer homedecor_3d_extras rgblightstone homedecor_bathroom roadsigns homedecor_bedroom ropes homedecor_books signs_lib homedecor_climate_control simple_streetlights homedecor_clocks solidcolor homedecor_cobweb stained_glass homedecor_common steel homedecor_doors_and_gates steelsupport homedecor_electrical streetlamps homedecor_electronics streetsawards homedecor_exterior streetsconcrete homedecor_fences streetshotfix homedecor_foyer street_signs homedecor_furniture streetsmod homedecor_furniture_medieval streetspoles homedecor_gastronomy technic_chests homedecor_kitchen technic_cnc homedecor_laundry technic_worldgen homedecor_lighting teleport_request homedecor_misc titanium homedecor_office trafficlight homedecor_pictures_and_paintings travelnet homedecor_roofing trunks homedecor_seating ufos homedecor_tables unifiedbricks homedecor_trash_cans unifieddyes homedecor_wardrobe unified_inventory homedecor_windows_and_treatments unifiedmesecons ilights vines inbox windmill infrastructure woodsoils inventory_sorter worldedit invsaw worldedit_commands itemframes worldedit_shortcommands item_tweaks xban2 jumping youngtrees junglegrass ```

Here's a list of the other mods on that server:

root@daconcepts:~# ls /home/minetest/.minetest/worlds/Creative_World/worldmods/
bucket_privs          hazmat_suit   lightcontroller    overrides
camo              icemachine    ltc4000e           pbj_pup
daynight          inspector     mail           player_count_tracker
dreambuilder_modpack  irc       mesecons_display   printer
dropthecaps       irc_commands  mese_restriction   vps_blocker
elevatorparts         irc_grep      minislots-modpack  wield3d
firealarm         letters       mt_morcmds
fsc           lib_mount     newplayer

(note to self: remove hazmat_suit mod, it's useless on that server)

Desour commented 4 years ago

Well, it looks like minetest.facedir_to_dir or minetest.wallmounted_to_dir returned nil for one of your nodes' param2. You could check dir for nil in your mesecon.rules.wallmounted_get and mesecon.rules.buttonlike_get and log the node name and param2 where dir is nil.

fluxionary commented 4 years ago

We started getting this on Blocky Survival today (probably earlier too). Here are my steps for reproducing it:

  1. Create a new server w/ minetest game, and the mesecons, homedecor, basic_materials, and unified_dyes mods.
  2. Create a standing lamp or table lamp and place it in the world
  3. Dye it black using the dye gun
  4. Break it

The server will die w/ an error like the following:

2020-01-28 20:38:22: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'player_api' in callback environment_Step(): .../worlds/tmp_test/worldmods/mesecons/mesecons/presets.lua:67: attempt to index local 'dir' (a nil value)
2020-01-28 20:38:22: ERROR[Main]: stack traceback:
2020-01-28 20:38:22: ERROR[Main]:       .../worlds/tmp_test/worldmods/mesecons/mesecons/presets.lua:67: in function 'get_any_inputrules'
2020-01-28 20:38:22: ERROR[Main]:       ...worlds/tmp_test/worldmods/mesecons/mesecons/internal.lua:479: in function 'rules_link_rule_all'
2020-01-28 20:38:22: ERROR[Main]:       .../../worlds/tmp_test/worldmods/mesecons/mesecons/init.lua:99: in function <.../../worlds/tmp_test/worldmods/mesecons/mesecons/init.lua:93>
2020-01-28 20:38:22: ERROR[Main]:       ...lds/tmp_test/worldmods/mesecons/mesecons/actionqueue.lua:137: in function 'execute'
2020-01-28 20:38:22: ERROR[Main]:       ...lds/tmp_test/worldmods/mesecons/mesecons/actionqueue.lua:111: in function <...lds/tmp_test/worldmods/mesecons/mesecons/actionqueue.lua:73>
2020-01-28 20:38:22: ERROR[Main]:       /opt/minetest-5.1-dev/bin/../builtin/game/register.lua:429: in function </opt/minetest-5.1-dev/bin/../builtin/game/register.lua:413>
2020-01-28 20:38:22: ERROR[Main]: stack traceback:

My guess is that the crash is because these nodes have a param2 value of "color", not facedir or wallmounted. Hopefully that's enough for someone else to take a look at this; I'm crashing out myself at the moment.

My "hot fix" is to add if not dir then return {} end to function rules_from_dir(ruleset, dir), but I don't know if that's "correct" or if it won't cause further problems in the future.

fluxionary commented 4 years ago

Well, I guess no one maintains mesecons anymore, time to fork that too.

sfan5 commented 4 years ago

This is a bug in homedecor:

colorfacedir and colorwallmounted are not an issue by the way since builtin handles that.

fluxionary commented 4 years ago

Ah, thanks for the update sfan5 :) I can lean on Vanessa now if I need to (who should be getting notices about this discussion)