ZenonSeth / logistica

A Minetest item transport and storage mod
Other
1 stars 4 forks source link

issue with the mass storage blocks #12

Closed wf13MT closed 4 months ago

wf13MT commented 5 months ago

Crashes the game when random ones are broken.

AsyncErr: Lua: Runtime error from mod 'logistica' in callback node_on_timer(): /home//.minetest/mods/logistica/logic/mass_storage.lua:62: attempt to get length of a nil value stack traceback: /home//.minetest/mods/logistica/logic/mass_storage.lua:62: in function 'addFunc' ...//.minetest/mods/logistica/logic/network_storage.lua:305: in function 'insert_item_in_network' /home//.minetest/mods/logistica/logic/injector.lua:88: in function </home/****/.minetest/mods/logistica/logic/injector.lua:57>

ZenonSeth commented 5 months ago

Hmm, that's weird. According to those logs a mass storage node is failing to find one of its main inventories (specifically the 'filter' one, where you specify what type of item goes into each slot). Seems to be happening when you're importing an item with an injector. I tested this scenario, and even over long distances, I didn't see this crash on latest main branch.

I'm curious what you mean when you say "when random ones are broken." - broken how? How did they get to this state?

I can add some specific checks to prevent this specific crash from happening - but I don't know whatever the root cause is that's causing a mass storage node to not have one of its main inventories. What did you do to end up with a mass storage node like this? I think that's important to figure out before I push out any fixes.

wf13MT commented 5 months ago

ok I was "digging" the storage blocks so I could move to another place and when I was "digging" them the game just crashed when digging random ones, Not punching but fully digging them and that is it. I have never experienced it again.

On Mon, Apr 8, 2024 at 3:14 AM ZenonSeth @.***> wrote:

Hmm, that's weird. According to those logs a mass storage node is failing to find one of its main inventories (specifically the 'filter' one, where you specify what type of item goes into each slot). Seems to be happening when you're importing an item with an injector. I tested this scenario, and even over long distances, I didn't see this crash on latest main branch.

I'm curious what you mean when you say "when random ones are broken." - how did they get to this state?

I add some specific checks to prevent this specific crash from happening - but I don't know whatever the root cause is that's causing a mass storage node to not have one of its main inventories. What did you do to end up with a mass storage node like this? I think that's important to figure out before I push out any fixes.

— Reply to this email directly, view it on GitHub https://github.com/ZenonSeth/logistica/issues/12#issuecomment-2042254490, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHVCV2RAADCOPGC2KZT32CLY4JNWFAVCNFSM6AAAAABF3VWZO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSGI2TINBZGA . You are receiving this because you authored the thread.Message ID: @.***>

wf13MT commented 5 months ago

Oh BTW I also had some machines taking blocks in and out as I was digging the storage blocks, but I don't think that would have affected anything.

On Mon, Apr 8, 2024 at 10:08 AM wf13MT @.***> wrote:

ok I was "digging" the storage blocks so I could move to another place and when I was "digging" them the game just crashed when digging random ones, Not punching but fully digging them and that is it. I have never experienced it again.

On Mon, Apr 8, 2024 at 3:14 AM ZenonSeth @.***> wrote:

Hmm, that's weird. According to those logs a mass storage node is failing to find one of its main inventories (specifically the 'filter' one, where you specify what type of item goes into each slot). Seems to be happening when you're importing an item with an injector. I tested this scenario, and even over long distances, I didn't see this crash on latest main branch.

I'm curious what you mean when you say "when random ones are broken." - how did they get to this state?

I add some specific checks to prevent this specific crash from happening

  • but I don't know whatever the root cause is that's causing a mass storage node to not have one of its main inventories. What did you do to end up with a mass storage node like this? I think that's important to figure out before I push out any fixes.

— Reply to this email directly, view it on GitHub https://github.com/ZenonSeth/logistica/issues/12#issuecomment-2042254490, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHVCV2RAADCOPGC2KZT32CLY4JNWFAVCNFSM6AAAAABF3VWZO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSGI2TINBZGA . You are receiving this because you authored the thread.Message ID: @.***>

ZenonSeth commented 5 months ago

Hm, ok, that sounds like an issue with the block metadata (aka its inventory and other things) being removed, but the block still remaining in the world. I will see about trying to handle some of these potential issues without crashing, but ultimately, it's hard to predict what will go wrong when a random crash occurs.

Are you still having an issue with that world crashing whenever you enter the area? I may add a settings flag to give ability to disable network scanning, as a precaution to such scenarios, but until then:

If your world is still crashing before you can remove the broken nodes, you can disable network creation (and thus pretty much everything Logistica does) like this:

  1. Go to the file logistica/logic/network_logic.lua and line 312 as seen here: https://github.com/ZenonSeth/logistica/blob/main/logic/network_logic.lua#L312
  2. The function there reads:
    local function try_to_add_network(pos)
    create_network(pos)
    end
  3. Change the line create_network(pos) to -- create_network(pos) (aka simply add two regular dashes in front of the line)
  4. That should disable pretty much every automated behavior in Logistica and stop any crashes caused by the automation. After you remove the broken nodes, just undo your changes by removing the two dashes to go back to normal.
ZenonSeth commented 5 months ago

I will publish a release with some fixes, including hopefully improving that behavior, soon, probably this week.

On another topic, since you requested the equivalent of "teleporter tubes" on contentDB, I also worked on that this weekend - in the form of wireless transmitters/receivers that allow you to extend a network wirelessly over any distance - and should publish that update probably within a week or so.

ZenonSeth commented 5 months ago

I've published Release 1.0.2 https://github.com/ZenonSeth/logistica/releases/tag/1.0.2 that should address at least the symptom causing this crash - that is, when a getting a list returns nil. I don't know if there's much I can do about the root cause that would be causing an inventory to not exist.

wf13MT commented 5 months ago

Thanks this has been very helpful and I have not experienced a crash since and have tried to replicate the issue without success which from what I understand is probably a good thing. Once again thanks for your time and effort in addressing this issue and being so patient with me.

On Tue, Apr 9, 2024 at 10:27 AM ZenonSeth @.***> wrote:

I've published Release 1.0.2 https://github.com/ZenonSeth/logistica/releases/tag/1.0.2 that should address at least the symptom causing this crash - that is, when a getting a list returns nil. I don't know if there's much I can do about the root cause that would be causing an inventory to not exist.

— Reply to this email directly, view it on GitHub https://github.com/ZenonSeth/logistica/issues/12#issuecomment-2045608305, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHVCV2TM4LV352QC326MQY3Y4QJHNAVCNFSM6AAAAABF3VWZO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBVGYYDQMZQGU . You are receiving this because you authored the thread.Message ID: @.***>

wf13MT commented 4 months ago

Also one thing I would like with the teleport block is that it will work with the jumpdrive mod.

wf13MT commented 4 months ago

Correction I would like all the blocks to be able to work with the jumpdrive mod.

ZenonSeth commented 4 months ago

That is a separate issue, unrelated to this - please raise another Github issue, put something like "Feature request: .." in the title, and describe a little better what compatibility you want.

I'm going to close this issue for now as I've made a release that should address the crash, if you encounter this specific crash again, feel free to reply to it again to reopen.

wf13MT commented 4 months ago

Ok, thank you.

On Wed, Apr 10, 2024 at 3:48 AM ZenonSeth @.***> wrote:

That is a separate issue, unrelated to this - please raise another Github issue, put something like "Feature request: .." in the title, and describe a little better what compatibility you want.

I'm going to close this issue for now as I've made a release that should address the crash, if you encounter this specific crash again, feel free to reply to it again to reopen.

— Reply to this email directly, view it on GitHub https://github.com/ZenonSeth/logistica/issues/12#issuecomment-2047055365, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHVCV2SWUO7APD6H3JRVG5TY4UDF7AVCNFSM6AAAAABF3VWZO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXGA2TKMZWGU . You are receiving this because you authored the thread.Message ID: @.***>