hilburn / StevesAddons

Additional functionality for SFM
Other
17 stars 10 forks source link

TileEntityRFManager has thrown an exception trying to write state #10

Closed fogger closed 9 years ago

fogger commented 9 years ago

SFM A93 + SA 0.7.3

Console is being spammed with this error: http://hastebin.com/luxuxugebu.avrasm

hilburn commented 9 years ago

Could you supply some more details regarding the setup, specifically screenshots/details about item filters in any input/output/conditions - this seems to be an issue with a base SFM class but if I can chase down the input that has caused the error I can get a better idea of what's going on

fogger commented 9 years ago

I would love to, but this is on an MP server where multiple player's are using SFM, I can't easily tell who is using SFM or which machine is causing it.

I'll see if I can chop up a copy of the world to pinpoint the problematic machine.

hilburn commented 9 years ago

Hmmm - well if you restarted the server it would be the one that lost it's info.. While I'm kinda joking, this might actually be the best fix for now as one of your players has somehow forced a manager into an invalid state - restarting the server should force it to load from it's last successfully saved state and it shouldn't (though I cannot guarantee as I'm not too hot on server maintenance) affect any other blocks in the world.

However, if you use Opis you should be able to find managers pretty easily as they are one of the higher-load TEs around, alternatively if you can ask your players who was messing with their manager around the time the console spam started you might be able to narrow it down that way.

As I said, I don't think this is my fault as I don't interact with that code at all but if you can find out what that dodgy setting is I might be able to track down and patch some edge cases

fogger commented 9 years ago

I should mention that I'm working with a copy of the live server that has 0.7.0.

There are no errors there, but when updating the local test server with 0.7.3, then the spam starts.

and as I am working with a test copy, I don't mind blowing stuff up to find the problem :)

hilburn commented 9 years ago

Ah ok - I will look for any changes between those builds that might possibly cause that then

fogger commented 9 years ago

After restarting the test server, there is no more spam, but I am expecting to find a blank machine somewhere right? I've checked every machine I can find and they all have groups & stuff in them.

I'll go back to the original world copy and dichotomously search for the effected chunk.

hilburn commented 9 years ago

It shouldn't have cleared it completely, merely reset it to it's last valid saved state - I am really at a loss as to why it has occurred though - did you perhaps modify/remove another mod at the same time? if an item that has been saved into a filter in SFM has been removed from the game, that could conceivably cause the NPE causing the issue

fogger commented 9 years ago

There are over 70 mods in the new update I'm testing, so that is very possible.

Also, I'm not sure what you mean by the "last valid saved state". does that mean the state it is on the live server right now and is saved into the world copy? which would then become invalid in the test update. or some previous state before the missing filter item was added? is history kept?

Or does that mean the state can never be changed until the missing item is removed from the filter?

I'm confused.

hilburn commented 9 years ago

Well in the event that something (or indeed 70 somethings) changed such that the item filter would no longer be valid it would just be the manager without that filter in place (you might wanna tell everyone to check all their filters as something probably isn't working right any more) - if instead it was a corruption while the tile entity was active (eg. something got improperly removed) it would be a case of at some point, the manager would go from saving successfully to failing to save, in which case after a reload it would just jump back to it's layout the last time it saved successfully

fogger commented 9 years ago

I reverted back to 0.7.0 and it still throws the NPE's, so it must be the other changed mods.

hilburn commented 9 years ago

ah ok, super

notmyfault

fogger commented 9 years ago

Hang on. Mod's will update, item's will change, surely there's a more graceful way to handle this?

it is after all your function that can't handle it right? TileEntityRFManager has thrown an exception

PS. Appologies if I don't know what the hell I am talking about. that may very well be the case. :D

hilburn commented 9 years ago

It is mine in a sense, but all I do with the RFManager is change the command executor it runs to my one with RF functionality (and the GUI). All of the item/fluid etc handling is "Vanilla" SFM's and that is where the error is coming in as the filter has saved it's filtered item to disk, the item has been removed from the pack, and then the filter doesn't have any null handling for when it loads back up and there is no item corresponding to it's saved value.

hilburn commented 9 years ago

I added in some ASM hackery to v0.8.1 which should prevent the NPEs in future