Refined Storage

Refined Storage

77M Downloads

Crafter occasionally fails to provide materials to machines from processing pattern

RealGrep opened this issue ยท 27 comments

commented

Issue description:

I've had crafting operations hanging up on many machines while executing processing patterns. So far, it seems that it fails to provide some of the materials needed, but only occasionally.

What happens:

I run a crafting job requiring processing patterns in crafters to various machines. Sometimes, I will find only some of the needed materials in the machine, and the entire crafting operation hangs and fails to continue, though it has everything it needs.

For example, I wanted to make energized alloy from EnderIO in the alloy smelter. It worked for a bit, then stopped. Looking in the machine, there was 2 redstone. The 2 gold and 2 glowstones needed were not there. I just had an elite infusing factory from Mekanism filled with enough diamond for 8 reinforced alloy, but the enriched alloy it needed never made it to the machine, which prevented the next operation since it was missing those reinforced alloys, and had the diamond in the machine, preventing the further crafting of atomic alloy, requiring compressed obsidian (which was blocked because the machine contained diamond).

Not isolated incidents either. This has been happening very frequently, always in a similar manner. Sometimes a processing pattern works, but occasionally it does this. Some of the materials don't make it to where they need to be and the operation hangs waiting for processing that will never happen. All the required base materials are in ample supply in the storage.

What you expected to happen:

For all required processing steps to complete, and materials for each operation to make it fully to the machines through the crafter.

Steps to reproduce:

  1. May have to be repeated, and might need to set up processing of sufficient complexity. But set up a crafting chain requiring processing patterns. The steps should require multiple different materials to complete.
  2. Repeat until it hangs waiting for something that never completes. Perhaps an alloy smelter with energetic alloy and a large order may trigger it.
  3. Look in the machine that should have completed that step. It may have only partial materials in it, and not be able to complete the request.
    ...

Version (Make sure you are on the latest version before reporting):

  • Minecraft: 1.10.2
  • Forge: 2093
  • Refined Storage: refinedstorage-1.0.5.jar

Does this issue occur on a server? [yes/no]
Yes.

If a (crash)log is relevant for this issue, link it here:

No crash, and log would not be useful in this case.

commented

Same issue here, just that I'm using the solderer from refined storage and it does exactly the same thing.

commented

Does the crafting monitor say the machine is in use?

commented

Sometimes yes

commented

Just to confirm, though it's probably no surprise since I didn't see it in the patch notes, it's still happening in 1.1.1. Was crafting 8 speed upgrades, and it needs glass. I have one machine responsible for making gravel from cobble, then sand from gravel. That would then smelt in another machine to glass. Two of the speed upgrades have failed to craft. It shows the chain: Speed Upgrade->Upgrade->Glass->Sand for both. Hovering over the sand entries, I see "Items crafting Gravel" on the first one, and "Items processing Gravel" on the second. There is nothing in the crusher that should have that gravel in it. Nor do I see gravel in the storage, though I do see a single sand.

Perhaps it's still waiting on that sand, even though it has gotten it back from the machine? Anyway, tossing some gravel into storage allowed it to complete.

Hope that provides some useful information. Other than this (fairly serious, I admit) issue, this update is pretty hot. Blocks look great, and the crafting manifest is amazing (thanks way2muchnoise!).

commented

Please try out this build and let me know if it fixes your issues (rename .zip to .jar):

refinedstorage-testing.zip

commented

Will do so shortly. I'll try and trigger it with some larger crafting jobs. I'll let you know as soon as I'm fairly sure it's ok. Thanks!

commented

Sadly, no, still happening. I launched a number of tasks that it can complete. Eight speed upgrades, for example. That is blocked, and I see seven sugar, one upgrade, and an empty slot where redstone should be, in the solderer. All the speed upgrades are at 75% with "Items processing, sugar, upgrade, redstone". There are seven blocked and one completed properly.

I also asked for 2 octadic capacitors. One completed. The next is waiting for energetic alloy to complete (at 75%) in the chain Octadic Capacitor->Vibrant Alloy->Energetic Alloy. The alloy smelter is actually empty, and I see a vibrant alloy actually in the system. I might think it had actually completed the energetic alloy, and made the vibrant alloy, and yet remains stuck waiting for the energetic alloy. Which is odd, since it would have to have fed it into the machine again with an ender pearl to make that vibrant alloy. I just tossed in an energetic alloy I hand smelted and it completed.

Other jobs like glass and a quantum entangloporter, and 16 item conduits, seem to have completed. But the 16 ender energy conduits which started going after I unblocked the octadic capacitor jobs seem to think a vibrant alloy is processing, but the machine is empty.

Anyway, hope that gives some information that might help you figure out the issue. As always, I'm here if you need some more testing. :)

commented

@RealGrep Thanks for the detailed description. Can you try this build?

refinedstorage-test2.zip

commented

I just hate delivering bad news. heh

Still doing it. Not sure, but observing it at the solderer making speed upgrades, for example, it loads up several sugar, but can only put one upgrade in. So it starts feeding in upgrades and redstone one at a time, with all, or most of, the sugars already in there. The speed upgrades have gone well this test, though. One might have failed, but there were sugars in there from a previous test, so I started it over and discarded the results. However, it had nothing else to process, since it only makes speed and range upgrades, and disk drives, currently. So I think that was still a failure.

I see the exact same behaviour making octadics. It jammed up waiting for energetic alloy, and there are two redstone in the alloy smelter, but not two gold and glowstone dusts to go with it. I suspect it is putting in excess redstone or something of the sort.

I just started it over again with 4 octadic capacitors and raced down to observe the alloy smelter. It went for a bit, but eventually put 2 redstone, 2 gold ingot, and one glowstone in the alloy smelter. Now it is stuck with one redstone, and one gold ingot. It is still waiting for one energetic alloy, but the needed third ingredient, the glowstone dust, will never come, and so the machine is jammed for further crafting of anything not energetic alloy. Note that I made 100% sure the alloy smelter was empty of ingredients before starting the test.

Of note is that the same smelter handles both energetic and vibrant alloys. I think it may have failed after going energetic alloys->vibrant alloys->failed attempt at energetic alloy again. Could easily be coincidence.

It seems like some materials simply never get delivered to the destination machines.

EDIT: You're welcome to a copy of my world/pack or even to pop onto my server to poke at it, if you think that will help.

commented

Another data point. Seem to have good (or bad, depending on how you look at it) luck with octadic capacitors, so that's my main test case. Asked for 4 of them. Three have completed, but the third shows the chain Octadic Capacitor->Double-Layer Capacitor and hovering over the Double-Layer Capacitor shows: "Items Crafting, Energetic Alloy" and is at 0%. The root item, the Octadic Capacitor, shows: "Items Crafting, Double-Layer Capacitor" and is at 20%. That's all that is shown. There is nothing in the alloy smelter at all, so it'll be waiting a long time. Everything seemed to be going ok, looking at the alloy smelter do the work. Then it just sat empty while the crafting system waited in vain.

commented

Just had the second of two 64k storage disks jam up with making a printed silicon processor. "Items processing: Silicon". The first 64k drive completed perfectly. I had to toss in some silicon into the system to get the second to go again. I wonder if it has something to do with the way it claims items when multiple crafting jobs require the same item. Some lack of thread safety, if you will. I wonder what it does and if there's a race condition when that happens. Perhaps the other job claimed something that it thought it could claim, but it disappeared before it could get it, thus making it wait indefinitely?

Pure speculation, but I suspect the issue is in that area. Still running your test build, of course.

EDIT: Are things put into a "crafting storage" as soon as possible? Or could it go "oh, that item is already in the system so I don't have to craft it", but it's the result of another crafting job that will go missing shortly? Even if the item is present for a very short time in general storage, I could see this happening. Perhaps when items are imported, if they are required by a crafting job that is active, if it checked to see if it should go into a separate crafting storage before it even can go into general storage, that might solve it? If it never hits general storage, then that can't really happen.

ANOTHER EDIT: I suppose the same sort of logic applies to materials needed for the processing. Perhaps those also need to be immediately removed from storage when the crafting job starts. Hope you don't mind the brainstorming here. Just trying to logic it out in the hopes it will be useful. Probably isn't. lol

commented

From my observations, I think that is likely.
I Imagine when a processing pattern finishes, and the Item gets imported, 2 or more tasks recognize the finished product, and try to craft with it resulting in one of them getting stuck, as only 1 item was actually produced.

Would also explain why this bug happens more the bigger the crafting request is but never consistently.

commented

@RealGrep Okay, let's try this one:

refinedstorage-test4.zip

commented

Again, thank you for trying out. 3rd time's the charm:

refinedstorage-test3.zip

(The crafting monitor may go out of sync, just re-open the GUI if you suspect that happening)

commented

But bad things come in threes. lol

I did my usual thing of trying to craft 4 octadic capacitors. It actually did the exact same thing as my last test. Three completed, the fourth never did. Crafter is showing the exact same thing as that previous test. Alloy smelter is empty, etc. Sorry. :(

I feel for ya. I've been a programmer for a very long time, and these times can be frustrating.

commented

Are you 100% sure you got the right build installed? lol
I tested it myself and it worked fine

commented

Yep, from my server mods directory:
fd80f2380a10d6c49f7f6d6c75fb8a30 mods/refinedstorage-test3.jar

From the client mods directory:
fd80f2380a10d6c49f7f6d6c75fb8a30 mods/refinedstorage-test3.jar

Re-downloading it and checking the file in the Downloads directory:
fd80f2380a10d6c49f7f6d6c75fb8a30 /home/michel/Downloads/refinedstorage-test3.zip

Those were in place when I restarted both the server and client. The correct file was in the master mod pack directory and installed to both from there.

The alloy smelter was checked to make sure it was clear before the test. Of course, the previous three octadics wouldn't have crafted properly if it hadn't been. Believe me, I wish it was me. heh

EDIT: I used md5sum to check fingerprints, BTW, if you want to compare. Just to be 100%, I noted that the server was started at 10:00 and the timestamp on the .jar file shows 9:57.

commented

Alas, no. :(

Was watching the machine making 4 octadics. At some point, it got 2 redstone, 2 gold ingots, and one glowstone. It kept making energetic alloy for a while, always out of balance. But it's now expecting another energetic alloy, but there's only one redstone, and one gold ingot, in the alloy smelter. There is like 12.4k glowstone dust in the system, so not for lack of it. The failing one has "Octadic Capacitor (20%)->Double-Layer Capacitor(0%)->Energetic Alloy(75%). The alloy reads: "Items processing: Redstone, Gold Ingot, Glowstone Dust". All the other tasks want to make vibrant alloy, but are "Waiting on machine that is in use by another task".

I fed it the single missing glowstone dust, and it's off and going again. It's now managed to complete all the 4 tasks, but that glowstone went completely missing and was never fed into the machine. Somehow, it inserted only two of the three, at one point.

Definitely loaded the proper file on both client and server.
% md5sum mods/refinedstorage-test4.jar
1bee2147f0a6ac44cc461a2001499fbf mods/refinedstorage-test4.jar

EDIT: I should point out that it failed slightly differently than last time. Last time, it was an empty alloy smelter, while it was still waiting for an energetic alloy (hence my previous speculation). This time, it's back to missing an ingredient. Who knows, perhaps there are two bugs at work.

commented

Hello

Before all, i apologize for the language mistakes in the message i'm not english but i hope it will be understable

I send this message just to add some details and confirmations to the former messages.
When it comes to craft huge items with processing patterns it barrely always fails BUT it's only when it requires many times the same item on the different crafts. I explain : if i request 2 64k storage cells for example, if both need a silicon for instance, after that one silicon is crafted both crafts think they have their silicon for themselves (but no, still just one for both) and therefor, the craft which doesn't have the silicon can't continue. Most of time, because of the 64k storage cell needs more than one silicon, one which was blocked is deblocked because of a new silicon arrives (due to the craft which was not blocked). But the two cells i was waiting for barrely never arrive, just one does.
I say that because when it comes to craft a single item, even if it's hard, the craft never fails because it is done step by step, and when it comes to craft several items, if an item is requires by two crafts at the same time, one will be done and the other one will fail.
I suppose the issue comes from the management of the ressources during the crafting procedure. Maybe if the craft was done ressources by ressources (first craft all the sand, then all the silicon, ...) the issues will be fixed ?

In spite of this issue, your mod is awesome and thanks you a lot for creating and managing it.

commented

Thank you for all the help, however I'm reworking the crafting system so the internals and behavior will change anyway.

commented

If the new system works properly it's perfect :)

commented

I noticed that! You've been busy. Can't wait to try it out. And I see Direwolf20 is highlighting your mod. He hasn't hit the issue yet, so that's good. Anyway, even if he does, it's not a huge deal. It's a testing server for a reason. Congrats on the attention it's getting! You deserve it. <3

commented

Thank you @RealGrep! :-)

commented

I have done a bit of testing with this and it seems to show up for me often when dealing with items not stacking in the solderer. I can almost always cause it to happen by starting 10 speed upgrades.

The upgrade modules get made don't show up in the RS inventory also do not show up in the solderer. It will hang in that state until I put in a upgrade module. If I cancel all the processes the upgrade modules show up in the RS inventory. So it seem like item are not coming back from a completed crafting operation that is nested.

I hope this help in tracking down the problem or at how you look at to rewrite the code.

Thanks

commented

Ancient legends say feel free to hit me up for testing once you get the new crafting code working. :)

commented

It's not quite ready yet, soon (tm) :D

commented

Closing this as the new system should fix this issue