Couldn't save module {0} - Bug:1860932

Guys I’m seeing this bug quite often when trying to save an edited module. In fact I’ve lost a ton of work because of this. I’m using 3.0.12:

-- OS Windows Vista -- Java version 1.6.0_03 -- VASSAL version 3.0.12 -- Talavera & Vimeiro version 0.1 java.io.IOException: Unable to write to C:\Users\Public\Gaming Stuff\Talavera\Talavera v0.2.mod\Talavera v0.3.mod.zip Data stored in C:\Users\Public\Gaming Stuff\Talavera\Talavera v0.2.mod\temp1.zip at VASSAL.tools.ArchiveWriter.write(ArchiveWriter.java:277) at VASSAL.build.GameModule.save(GameModule.java:753) at VASSAL.build.GameModule.save(GameModule.java:739) at VASSAL.configure.ModuleEditWindow.save(ModuleEditWindow.java:189) at VASSAL.configure.ModuleEditWindow$2.actionPerformed(ModuleEditWindow.java:83) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) java.io.FileNotFoundException: C:\Users\Public\Gaming Stuff\Talavera\Talavera v0.2.mod\Talavera v0.3.mod.zip (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileInputStream.<init>(Unknown Source) at VASSAL.tools.ArchiveWriter.write(ArchiveWriter.java:234) at VASSAL.build.GameModule.save(GameModule.java:753) at VASSAL.build.GameModule.save(GameModule.java:739) at VASSAL.configure.ModuleEditWindow.save(ModuleEditWindow.java:189) at VASSAL.configure.ModuleEditWindow$2.actionPerformed(ModuleEditWindow.java:83) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

Are you sure your work is lost? The stack trace seems to be saying that your module was saved in C:\Users\Public\Gaming Stuff\Talavera\Talavera v0.2.mod\temp1.zip because the file you were trying to write to couldn’t be written.

Did you have the module open in another instance of VASSAL? Or with an archive program like WinZip at the time? My guess is that Vista was locking the file, and that’s why you couldn’t write to it.

In this particular instance I was able to close Vassal and recover the module from temp1.zip. But in the past I’ve not been so lucky.

When I get the error, even choosing “Save As” fails, there is no way to save the file other than hoping a temp file is still there. Sometimes there is, other times there is not.

I had actually used Winrar to compress the module before opening it for editing in Vassal; So I’m wondering if Winrar was still keeping it locked as you say. I’ve tried killing off a ton of processes in the hope of unlocking the file, but in the end just could not get it to save.

Thus spake “bsmith”:

That’s surprising. I don’t see why that would happen. I’ll look into this.

What else happens when you get this exception? Does VASSAL crash? Do
you get a dialog telling you what happened?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

I only get a Message Box with the text “Couldn’t save module {0}”. The first time as a result of selecting “Save” then continually from then on. This all probably happens only once every 4 or 5 times I edit a module.

Thus spake “bsmith”:

Has this ever happend when you know you haven’t had the module open in
some other program first?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

There is a distinct possibility that the only time it happens is when I’ve had the module open with another program. A read or write lock on the file certainly sounds the most likely cause, but I’m not sure why that lock would be still be around after killing off processes. Unless it’s a Vista specific problem?

Thus spake “bsmith”:

Could be Windows- or Vista-specific. I’ve never had it happen to me on
Linux, but it’s also the case that I know I’ve never had a module I
was trying to save open in another program while VASSAL was running, so
that’s not really a proper test. I have had problems with deleting files
on Windows before, where I couldn’t delete a file because some other
program had a lock on it but it wasn’t obvious what program that was.

Anyway, we should handle the error condition better, because we have
no control over whether some other program has write-locked files we
want to write.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Sorry, I only just now finished the other coding I was doing, so I haven’t had
a chance to look at this yet. Maybe this week.

I have had the same problem and i wrote here how to resolve it :

This problem occurs for me when :

I work on a V2.9.9 module with the last 3.0.13 version. After editing the original v2.9.9 module and when i do “Save”.

How to resolve it:

Ok, it’s empiric, but it works : just do “Save as” with an other name for your module …

This demarch still fail ?

For me it was only because iwas working on an USB key, which is not ready when i “Save as” … or my harddisk was busy in the same time.

I hope it will help you …

I just had this same exact problem with 3.0.15. I’m on Win 2000 and the file most definitely had not been opened in anything else.

There was a zip file to recover from, but this error message does not say that anything has been saved off. In fact, it’s possible it was saved off when I exited Vassal right afterwards.

The “Save as” option has always worked for me whenever I’ve gotten this error.

I think it has to do with the way Windows handles compression as the mod file is really just a Zip file in disguise. I tend to get this error a lot whenever I replace a whole bunch of graphics files with updated ones. When I do, I just click “Save as” and create a new file. It saves just fine that way.

I’ve had this error happen to me ever since I’ve used Vassal, btw. …and I still do. Started with 3.0.1. Now using 3.0.13. Windows XP.

I agree that it is recoverable maybe at least 70% of the time. I did have a single occassion when I could not save my module though, not even using Save As under a different file in a different folder. Then when I exited Vassal there were no zip files to recover nor did the original module exist… I had nothing! :open_mouth:

Every time I’ve encountered that error I’ve found another java process
that had the file opened in some way. Like a previous edit that didn’t
exit completly. I just forcefully close the other process and I’m able
to save no problem.

On Dec 21, 2007, at 8:07 PM, “bsmith”
messages@forums.vassalengine.org wrote:


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Yeah I did try that Tim; I knew I had spent over 60 minutes doing edits to the module, I really didn’t want to lose it! In fact I ended up killing every process that would let me kill it. In the end though, still the same error continued to pop up.

It was strange that when all of this was happening, the original module file and temp zip files were not there. I was hoping it was still held in memory or something.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Is this an issue with any other versions of Vassal? Does anyone know if this is getting looked at to be fixed?

I had same problem several times but I don’t know what is a reason. Only way to help that I know is to save after every modification and to keep several versions of modules.

It just seems that the bigger my mod gets the more it happens. It gets frustrating when I have to save every 5 seconds and I have like 15 saves of the same thing.

I understand Joel is looking into the problem.

Out of curiosity, what operating system is everyone using? I’m on Windows Vista myself.

Confirmed again yesterday that sometimes not even “Save As” works to fix this error; In these cases the only resolution is to hope and pray that a temp.zip file still exists!

Thus spake “bsmith”:

This is a difficult bug for me to troubleshoot, because it doesn’t occur
on my development box (Linux).

The first IOException in your errorLog probably happened because there
was an open file handle on the module file already. I’ve found many
places where we neglect to close streams, so this could be the result of
an unreferenced stream which was open on the module but not yet garbage
collected.

The second one could only happen if the module file no longer exists,
and I’m guessing that’s a consequence of the first exception.

In order for me to investigate this problem, I need more errorLogs
from people who have experienced this bug, and if possible, a reliable
way to trigger it.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)