Opencomputers: Removing floppy disks from drive erases them

Created on 23 Jan 2019  Â·  19Comments  Â·  Source: MightyPirates/OpenComputers

When I write to a floppy disk and save the file, I can reopen them as long as i don't remove the floppy disk from the drive. So rebooting works.
But as soon as I remove the floppy disk and put it back in, the file is empty. Note: The file still exists, it is just empty (which destroys the whole purpose of a floppy disk)

Tested on:

  • Minecraft 1.12.2
  • Forge 14.23.5.2768
  • OpenComputers 1.7.3.146
  • no other mods
bug-cannot-reproduce bug-minor

All 19 comments

Same but:
Minecraft 1.7.10
Forge 10.13.4.1614
OpenComputers any version (I even tried the first available version for 1.7.10)
No other mods.

The fact that I had the problem on any version makes me think that something else is the issue. I have no idea what the problem might be. I don't see anything in the log files either.

Okay. I found something interesting. When I am running the modded game through the Technic platform, floppy disks don't work. If I install it regularly, they work fine. I have double checked all version numbers, reinstalled both configurations, and even used identical launch arguments. The same thing occurs. The only mod present in both instances was OC.

Further testing reveals floppy disks don't work on the server side at all. I tried both clients. At this point I don't know if it is Forge, OC, or Technic. They are all consistent as individual instances, but it seems strange that servers don't work at all, Technic breaks it, but default launch works fine. Do you reckon that the Forge installer has something to do with it? I'm going to check the libraries it downloads and see if any are missing from the Technic pack and server.
Nope. No library differences.
I checked the logs one last time. OC does throw an error for the server, but not the clients, that might be related:
[12:13:15] [Server thread/WARN] [OpenComputers/]: Error handling file saving: Did the server never start?

I give up. I'm at the extent of my limited knowledge. I hope the devs have a solution.

Out of curiosity, have you tried disabling file system caching in the OpenComputers settings?

I'm assuming in 1.7.10 it's "bufferChanges" on line 419 of "OpenComputers.cfg", because after changing it floppy disks worked properly for Technic and servers. It's still interesting how that option doesn't need changed for vanilla launcher launched games. Thanks a bunch.

I wonder if this is related to #3032, both seemed to be fixed when FS buffering was disabled...

I downloaded the technic launcher. I don't know how to create a modpack in technic, tried, there's no fun "make new instance" button like mmc has... Anyways,

  1. I installed one of the other packs (stylis in this case)
  2. removed all the mods (i just need forge and technic to launch it i guess?)
  3. put in oc 1.7.3 for 1.12
  4. started up a new world
  5. placed a machine
  6. put in a floppy disk
  7. wrote a file to the floppy
  8. removed the floppy
  9. inserted the floppy
  10. the file was still there .... no repro

also tested with an external disk drive, still works

Out of curiosity, what is the OS of the computer running the server? (and if it's Linux, what distro, and/or what server host?)

good question by skye. i thought i pointed that out already (but i see i didn't, perhaps it was another similar bug report) I've seen window's security settings restrict modifying files. not creating them, but modifying them, under certain directories for untrusted applications. perhaps it see the technic launcher as untrusted.
if this is the case, there is literally nothing we can do. also, if this is the case, even using "no buffering" isn't going to fix it, it'll only allow you to edit the first once.

Out of curiosity, what is the OS of the computer running the server? (and if it's Linux, what distro, and/or what server host?)

Tested on Arch Linux (fixed with bufferChanges=false) & Debian with latest OpenJDK 32Gb ram.
Tested both 1.7.10 and 1.12.2.. (we upgraded OC server on the Debian server..) both distros.
Both Windows 10 and Linux clients.. Latest MultiMC

One thing I have noticed is that the file structure remains, but all the data in the files are wiped and the files are actually empty when you open them from server-side outside of game.
All tests done using creative servers in-game within a rack.
Variety of disk drives used (rack mounted and external disk bay).
Issue non-existent when in single player mode. Again, only happens when running a server and join via separate client machine.

I have the same thing! Found the bug in my private 1.10.2 modpack but tried to repro it in FTB Beyond 1.10.2 latest version and it still happened (it happens on multiplayer AND singleplayer too on both my private and ftb beyond modpacks), also it happens in all OC versions! Im using Twitch client which is set to trusted in my AV and windows security is disabled. It happens not only on floppy disks, but hdds too! Whenever i shutdown the pc and take the hdd or floppy out and put it back in it is erased. When you turn on the pc after that it says computer halted (it corrupts the os), but sometimes the filesystem stays the same, it has the same UUID, the file is present, but the data in the file is gone! So annoying im about to give up cuz it makes the mod useless. I can help with whatever you want to repro it youself. Can send logs, the world or even send you ip to a server with any configuration of mods you say just so i can use this mod again. I can't do anything with computers because whenever you leave the game, remove a hdd, or wait till it happens on itself you have to reformat the said storage, install os again and copy over your programs again.... I am really curious of what is causing this because as i can remember it was not doing it 1-2 months ago.

Edit: Forgot to say that a massive area of chunks around our base is chunkloaded

Just tried to write to a file then check it via ftp..
✓ The file is created..
✗ Doesn't ever actually save any content to files..
✓ The save is temp 'client-side'.. This happens with both floppy storage and HDD (t3 tested)

as @exalented said can confirm no files are ever saved in the host folder of the storage (not even os ones).
Files are created but there is no data in them.

Edit: well.... bufferChanges=false in the settings solved the problem for me and i can live in peace now BUT that still doesn't explain why dafuq it would never save anything ever in my host ssd when it was set to true

@exalented ok i would like to troubleshoot this with anyone that is seeing this issue. please contact me in irc (oc on esper.net) or discord https://discord.gg/bYqKv7h

also not sure what @exalented means by "the save is client-side", no files are created file side. if you mean see the content of the file in the game, that's not the same thing.

I've been testing just now with a server and external disk drive with a floppy. buffer changes is true. file is created when i remove the floppy. definitely no repro

I'm working with @exalented on this issue. So far this is NOT reproducing for me. I'm running gentoo with icedtea, exalented is running openjdk on arch linux .... not sure if any of that is related, but i'll be testing more to figure this out.

i was able to reproduce this on arch linux and ubuntu. it is my best guess that something we were doing with FileChannel.transferFrom was not cross compatible, and some flavors of openjdk didn't care for how we were doing it.
I find that copying the buffer using ByteBuffer to be very reliable, and still quite fast. Also, it seems to work on all flavors of the jre :)

Thank you so much :)

Was this page helpful?
0 / 5 - 0 ratings