pandorabox-io / pandorabox.io

Pandorabox infrastructure code
https://pandorabox.io
31 stars 4 forks source link

Jumpdrive/Pipeworks crash in singleplayer testing world #306

Closed OgelGames closed 5 years ago

OgelGames commented 5 years ago
2019-08-30 19:58:40: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback node_on_receive_fields(): ...ld (Pandorabox.io)\worldmods\pipeworks/teleport_tube.lua:13: attempt to index upvalue 'tp_tube_db' (a nil value)
2019-08-30 19:58:40: ERROR[Main]: stack traceback:
2019-08-30 19:58:40: ERROR[Main]:   ...ld (Pandorabox.io)\worldmods\pipeworks/teleport_tube.lua:13: in function 'save_tube_db'
2019-08-30 19:58:40: ERROR[Main]:   ...ndorabox.io)\worldmods\jumpdrive/compat/teleporttube.lua:46: in function 'teleporttube_compat_commit'
2019-08-30 19:58:40: ERROR[Main]:   ...ld (Pandorabox.io)\worldmods\jumpdrive/compat/compat.lua:41: in function 'commit_node_compat'
2019-08-30 19:58:40: ERROR[Main]:   ...ld (Pandorabox.io)\worldmods\jumpdrive/move_metadata.lua:34: in function 'move_metadata'
2019-08-30 19:58:40: ERROR[Main]:   ...sting World (Pandorabox.io)\worldmods\jumpdrive/move.lua:82: in function 'move'
2019-08-30 19:58:40: ERROR[Main]:   ...ing World (Pandorabox.io)\worldmods\jumpdrive/common.lua:184: in function 'execute_jump'
2019-08-30 19:58:40: ERROR[Main]:   ...ing World (Pandorabox.io)\worldmods\jumpdrive/engine.lua:142: in function <...ing World (Pandorabox.io)\worldmods\jumpdrive/engine.lua:88>
2019-08-30 19:58:41: ACTION[Main]: Server: Shutting down

Crash happens in my singleplayer testing world (which has a up-to-date clone of https://github.com/pandorabox-io/pandorabox-mods in its worldmods), every time I try to use a jumpdrive.

thomasrudin commented 5 years ago

I just tested that and pipeworks and the jumpdrive mod point to the right commit (the pipeworks mod still needs a patch for the tp-tube, hence the separate repo, but i'm working on removing that):

Can your run these commands in the worldmods folder:

# just in case
git pull
# syncs the repo url's
git submodule sync
# updates to the specified commits
git submodule update

Can you also check if you have this warning in the console:

[jumpdrive] pipeworks teleport patch not applied, tp-tubes don't work as expected!

(https://github.com/thomasrudin-mt/jumpdrive/blob/e74a4cdf630dc9f0aea0ec190df608820e9ab977/compat/teleporttube.lua#L4)

OgelGames commented 5 years ago

Can your run these commands in the worldmods folder:

I have, and do every day or two, that's how I know the mods are up-to-date.

Can you also check if you have this warning in the console:

No, never had that...

thomasrudin commented 5 years ago

Can you check that the contents of pipeworks/teleport_tube.lua match that in: https://github.com/pandorabox-io/pipeworks/blob/b33c1695a70c869ff8a1ccbbeb3e542282d6979a/teleport_tube.lua#L55

Alternatively: can you zip/tar it and upload it somewhere?

OgelGames commented 5 years ago

Yep, all of it matches.

thomasrudin commented 5 years ago

Can you provide how you start the server? Directories, command line, where do you place the mods?

My guess is, that an old mod-version in another directory gets loaded... :confused:

OgelGames commented 5 years ago

So I found the problem: I didn't have a tp tube in the world. (also explains why it works fine on the server)

From what I could work out, because there was no tp tube in the world, read_tube_db was never called, and thus tp_tube_db was always nil (https://github.com/pandorabox-io/pipeworks/blob/master/teleport_tube.lua#L3), so when save_tube_db was called at https://github.com/pandorabox-io/pipeworks/blob/master/teleport_tube.lua#L57, it resulted in the nil error.

The fix for it is to add a nil check, which I will do shortly 😉

thomasrudin commented 5 years ago

oh, that thing is nil on the first start... :man_facepalming: