Jump to content




[1.4.2][SMP/FTB][CC v1.46]Turtle looses his Mining pickaxe after Server Crash


55 replies to this topic

#21 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 06 February 2013 - 02:41 PM

Then it is the modem deadlock which is fixed in the next version (prerelease coming soon)!

#22 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 07 February 2013 - 08:08 AM

I cannot reproduce this locally on vanilla Minecraft. Can someone set up a server with only ComputerCraft on it, and test? It could possibly be a bug in one of the peripheral mods.

#23 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 07 February 2013 - 12:58 PM

i will test it now
does 10 turtles moving back and fourth in a loop sound good to test it?

EDIT: defenetly happens for vanilla CC
Posted Image

#24 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 07 February 2013 - 02:20 PM

How did you reproduce it? Details please - I cannot reproduce it without them. This is really infuriating. If you quit the server/client, HOW do you quit it?

#25 stylish

  • Members
  • 7 posts

Posted 07 February 2013 - 04:35 PM

I have gotten the Turtles to freeze up. If I clicked disconnect the screen hangs at "Shutting Down Internal Server..." and I usually just close the java.exe process whether that's the right thing to-do or not. I just ran my Turtle Quarry program and after a roughly 30ish Turtles got deployed the game froze.

#26 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 07 February 2013 - 04:40 PM

how i did it is i just closed the server forcefully (the red X when using -nogui)
i want able to repoduce using the stop command, havent tried unloading the turtles

#27 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 07 February 2013 - 06:13 PM

View Poststylish, on 07 February 2013 - 04:35 PM, said:

I have gotten the Turtles to freeze up. If I clicked disconnect the screen hangs at "Shutting Down Internal Server..." and I usually just close the java.exe process whether that's the right thing to-do or not. I just ran my Turtle Quarry program and after a roughly 30ish Turtles got deployed the game froze.
That's also the rednet deadlock, to be fixed in the next version.

#28 Eyadish

  • New Members
  • 1 posts

Posted 14 February 2013 - 02:59 AM

Also wish to vertify this.

Turtles looses all settings, what equipment and ID (and therefor loosing all fuel). My crashes has come from that windows gets a bluescreen mostly, and therefor I draw the conclusion that when the server aint shutted down correctly, it can't save. Also happening while the turtle is moving ONLY

This seems to happen in my FTB server log tonight, so not sure if it was a sever crash or a bluescreen

What I can tell from my ForgeModLoader logs, this command is never happening when the problem has occured for me, but remember, my problems is often related to bluescreens. But I get this feeling that a bluescreen shouldn't stop me from saving my data in only CC.
2013-02-13 00:36:22 [FINER] [ForgeModLoader] Sending event FMLServerStoppedEvent to mod ComputerCraft

#29 timdiels

  • New Members
  • 2 posts

Posted 28 February 2013 - 01:59 AM

Is this bug supposed to be fixed in CC 1.5? (Edit: I guess not seeing that this thread has no [Fixed] in its title. Is this a hard bug to fix?)

I have a mining program for one of my turtles. After some time my turtle freezes. The CPU doesn't sky-rocket, so it's not an infinite loop. When this happens in SSP the game will hang on "Shutting down internal server". When this happens in SMP, every player loses connection as the server hangs. I then have to close the server by closing its terminal window rather than its java gui server window (which I'm guessing kills it rather than shutting it down nicely). My turtle queries its gps location a few (= 3 to 20) times after every move (i.e. rednet). Sometimes it loses its tools, fuel, label, files, inventory after restarting the server when the server hung.

The last few times I checked, the server did not log any errors.

Forge version: Forge Mod Loader version 4.7.4.520 for Minecraft 1.4.7

The mods I have:
- CC 1.5
- dimensional-anchor 52.1.9
- immibis-core 52.4.4
- RedPowerCore 2.0pr6
- RedPowerDigital 2.0pr6
- RedPowerMechanical 2.0pr6

Lengthy steps to reproduce:
1) Provide it with GPS (I placed GPS in top layer with a dimensional anchor all in the same chunk)
2) Grab a zip or clone the repo at this tag here: https://github.com/l...g_reproduction1
3) Place the files on a floppy
4) Put a wireless mining turtle next to disk drive with floppy, reboot it
5) Fuel it with a stack of coal (just so it doesn't run out of fuel)
6) Add to its startup: shell.run("mine")
7) Reboot it and wait. It probably freezes within an hour. I'll run it again later to see how long it generally takes.

#30 Kaidenyo

  • Members
  • 11 posts

Posted 08 March 2013 - 02:08 AM

[1.4.7][SMP] Turtles lose their properties ( Pickaxe, Chunkloader Module, Scripts, Fuel ) when server restarts/crashes.


Bug:
Turtles lose all of their Properties

ComputerCraft Version Information: 1.5 Client / 1.5 Server ( Ultimate Pack, latest Version )

Description of Bug:
I was quarrying with AustinKK's ( TRtdTB19 ) quarry script. 4x Chunkloader Turtles, 64x64 area in an Mystcraft Age ( but this also happens in the Overworld! ). 3 of the Turtles ( they just stood around at the position they had, when the server went down as a normal turtle ) lost their properties as stated above, but one was still fine. That means it still had the chunkloader/pickaxe/fuel.

Steps to Reproduce Bug:

Try the script and crash/reboot/shutdown the server, in SSP try alt+f4 or reboot pc.

EDIT: Server crashed again. Turtle lost fuel, Chunkloader and pick. Definitely has something to do with the turtle being in motion when the server crashes.

#31 OniBait

  • Members
  • 8 posts

Posted 11 March 2013 - 03:01 AM

This might provide some more info on it. It is the most frustrating bug to me right now because I have turtles almost non-stop in motion harvesting trees and a server crash will lead to turtles that have lost their identity.

Bug:
Turtles lose all of their properties (lose their upgrades and their identity)

ComputerCraft Version Information: 1.5 Client/1.5 Server

Description of Bug:
Any turtles that are in motion when a server either crashes or is force killed will lose all upgrades and their identity.

Steps to Reproduce:
Run something like "excavate 64" with a turtle and kill the java process while they are moving.

Error log info: (on server restart, cause of the crash does not matter!)
(repeats for each turtle that was in motion)


2013-03-08 20:46:26 [INFO] Attempted to place a tile entity ([email protected]) at -401,74,-129 (AIR) where there was no entity tile!
2013-03-08 20:46:26 [INFO] Chunk coordinates: -416,-144
2013-03-08 20:46:26 [SEVERE] java.lang.Exception
2013-03-08 20:46:26 [SEVERE] at zz.a(Chunk.java:1086)
2013-03-08 20:46:26 [SEVERE] at zz.a(Chunk.java:1050)
2013-03-08 20:46:26 [SEVERE] at aam.loadEntities(AnvilChunkLoader.java:509)
2013-03-08 20:46:26 [SEVERE] at aam.a(AnvilChunkLoader.java:77)
2013-03-08 20:46:26 [SEVERE] at im.f(ChunkProviderServer.java:269)
2013-03-08 20:46:26 [SEVERE] at im.getChunkAt(ChunkProviderServer.java:167)
2013-03-08 20:46:26 [SEVERE] at im.c(ChunkProviderServer.java:136)
2013-03-08 20:46:26 [SEVERE] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:563)
2013-03-08 20:46:26 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:447)
2013-03-08 20:46:26 [SEVERE] at ho.c(DedicatedServer.java:203)
2013-03-08 20:46:26 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:724)
2013-03-08 20:46:26 [SEVERE] at fy.run(ThreadMinecraftServer.java:16)

#32 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 11 March 2013 - 08:23 AM

You're using MCPC+ which probably messes with things. There's alsp really little we can do if Minecraft crashes. If it crashes it doesn't save the chunk, if it doesn't save the chunk it doesn't save the turtles new information. I can't really think of a way to safeguard against it.

#33 ShaadowKnight

  • New Members
  • 1 posts

Posted 11 March 2013 - 12:18 PM

Well it seem to me if the ID was saved in a different way, then there might not be a problem. What I am finding is the information for your turtle is there, but when you log back in after a crash you basically have a new turtle, it has a new ID. Because it is considered a new turtle all the properties are lost, fuel, pickaxe, etc...

#34 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 11 March 2013 - 12:26 PM

Please tell me how you can save information about a tile entity without it being stored in the tile entity (hint - you can't). Even if you could if it crashes then it won't save anyway.

I will look into trying to get it to force it to save somehow but don't hold your breath.

#35 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 11 March 2013 - 12:58 PM

If it's saving the block ID but not the TE, then something's weird.

#36 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 11 March 2013 - 01:02 PM

View Postimmibis, on 11 March 2013 - 12:58 PM, said:

If it's saving the block ID but not the TE, then something's weird.

Agreed. Need to see how to fix it.

#37 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 12 March 2013 - 03:31 AM

I'm no java programmer, but is it possible to have it look in a 1 block radius fron the turtle, and try to match the objects together? From there, could you just merge the data?
Just a thought that might help.


EDIT: I'm a derp. I just reread what you guys were saying, meaning that the Tile Entity was gone completely. Ignore me.

#38 OniBait

  • Members
  • 8 posts

Posted 12 March 2013 - 12:52 PM

View PostCloudy, on 11 March 2013 - 08:23 AM, said:

You're using MCPC+ which probably messes with things. There's alsp really little we can do if Minecraft crashes. If it crashes it doesn't save the chunk, if it doesn't save the chunk it doesn't save the turtles new information. I can't really think of a way to safeguard against it.

Yep and I'm totally aware that it messes with things. However, looking at the code in CraftBukkit where this was modified, the only change for this particular section is to actually report that an error occurred rather than just silently swallowing it like a Vanilla server would. The point of posting that was to try and help give more info on a bug that is happening on vanilla servers as well.

View PostCloudy, on 11 March 2013 - 01:02 PM, said:

View Postimmibis, on 11 March 2013 - 12:58 PM, said:

If it's saving the block ID but not the TE, then something's weird.

Agreed. Need to see how to fix it.

I can try and reproduce it and take a look at the NBTs and see. I suspect that what I'll see is that the TileEntity position doesn't match up with the Block's position.

I see other mods have a similar issue (portal mod does for example) but either recover from it gracefully or else I don't notice it. I'd have to look at the code a bit closer, but wouldn't the block and TE position updates be done at the same time? In which case it is even more confusing as to how it could happen. Both would be in the same region file and all...

Even weirder is that MCPC+ (and spigot) turn chunk saving off and leave it to plugins to save chunks -- in which case I'd have expected on a crash for the chunk to be "outdated" (whenever the last save was) but not for it to have TileEntities that don't line up with their Blocks.

View PostCranium, on 12 March 2013 - 03:31 AM, said:

EDIT: I'm a derp. I just reread what you guys were saying, meaning that the Tile Entity was gone completely. Ignore me.

No Cranium, the TileEntity isn't gone completely, it is just in the wrong place. When the server tries to place it, it sees that an invalid block is there and ends up just tossing the TE away at that point.

#39 OniBait

  • Members
  • 8 posts

Posted 13 March 2013 - 06:28 AM

Okay -- yeah. Looking at the NBT what I see is the TileEntity's position is there, but the block isn't.

For example: I have a turtle at rest, the TE will be at something like: -385, 64, -143 and looking for that block in the section data, I see the 04CC block at the same spot (ex: here would be Region -1,-1 -- Section 4 Add has a 04 (or 40) and Data has a CC.

But, if I look at a turtle that is currently in motion, I see a TE with a position of: -386, 107, -128 and looking for the block data there I don't see any turtle blocks at all (I actually looked for it in the entire chunk just to make sure it wasn't misplaced ;))

So the question is... why isn't the block being updated with the tile?

#40 Abdiel

  • Members
  • 16 posts

Posted 13 March 2013 - 06:29 AM

Alright, I'm not a modder, I don't know how Forge internals work, so I might be miles off. Ignore this post if it is so. But I am a programmer and I think I understand the bug.

Right now, moving turtles do something like this:

TileEntity temp = tile entity of the old position of the turtle
remove the turtle block at the old position
create a MovingTurtle entity at the old position
animate moving this entity into the new position
destroy MovingTurtle
create a new turtle block at the new position
assign the temp tile entity to this block

If the server crashes somewhere between the first and the last line, the tile entity data is lost. I propose the following:

create a FakeTurtle block at the new position (block is completely transparent)
copy the tile entity data from the turtle to the FakeTurtle
destroy the turtle block
create, animate, and destroy a MovingTurtle entity
replace the FakeTurtle block with an actual turtle block, preserving tile entity data

This way, tile entity data is never lost. At worst a FakeTurtle will be created, but never turned real, if the server crashes before that happens. You could periodically check a list of all FakeTurtles, or just schedule its deletion if Forge allows that (I seem to recall Minecraft code having this functionality).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users