Unable to Write File error when saving

Hey there, I got this error log when I was trying to save a game the other day. Any idea what would be causing this?

I haven’t made any changes to my system, except updating Java. However this error occurred before and after that update.

java.io.FileNotFoundException: /Users/Name/Desktop/tmp3929771256020253748.zip (Permission denied) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at java.io.FileOutputStream.<init>(FileOutputStream.java:162) at VASSAL.tools.io.ZipArchive.writeToDisk(ZipArchive.java:420) at VASSAL.tools.io.ZipArchive.close(ZipArchive.java:398) at VASSAL.build.module.GameState.saveGame(GameState.java:718) at VASSAL.build.module.GameState.saveGameAs(GameState.java:505) at VASSAL.build.module.GameState$3.actionPerformed(GameState.java:137) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:125) at java.awt.MenuItem.processActionEvent(MenuItem.java:669) at java.awt.MenuItem.processEvent(MenuItem.java:628) at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:357) at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:345) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:763) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

According to the line number in ZipArchive, this looks like Vassal 3.2.17 github.com/vassalengine/vassal/ … .java#L420

And the error indicates that FileInputStream was not allowed to access the temp file that was created a couple of lines above.

Is this possibly on windows and/or using a network file system like dropbox?

No, I’m on Mac.

And I do use Dropbox but I was just saving this to my desktop.

To Desktop, interesting.

Possibly a result of Vassal not being allowed to write there? Was it the first time you tried to save anything from Vassal on the Desktop? Has it worked before?

Does it have to do with this here:
support.apple.com/guide/mac-hel … a35146/mac ?

I had an issue with this a long time ago, when some anti-virus software was interfering with Vassals write permissions for some reason. However, that was years ago and I had it resolved. I’ve been putting my vassal save files on my desktop with no problem ever since then.

I’ll check into that anti-virus again…maybe it auto-updated and reset whatever it was doing.

And I am on High Sierra so the Files and Folders permissions aren’t in the Security/Privacy, but I’m sure they are somewhere else in System Preferences. I will look into that an see if fixing permissions there has any effect. I’ll post an update either way. Thanks for looking into this.

Hello,
I got the unable to write to file error today on closing a logfile.
No antivirus, no dropbox folder, just writing in the desktop.
3.3.2 + Windows 10
Attaching error log.

You say “no dropbox folder”, but I see that it’s writing to a OneDrive folder, which is Microsoft’s equivalent…

If I had to guess, I would say OneDrive interfered with the process (locking the file in preparation to uploading, perhaps?), but that is only a guess.
It really looks to me like VASSAL needs to fail more gracefully on this error, perhaps give an option to retry (or even do a single, silent, retry before failing)?

I never realized my desktop was in a One Drive, I turned Onedrive off on that PC.
“C:\Users\claud\OneDrive\Desktop\TGD 6J 1300 50C.vlog”
But maybe windows is running some One Drive service, even if I do not see any on the process manager.

In any case, this error occurs with a test version, not even 3.3.2, but VASSAL-3.3.2-407-gc11ffef3-bug13205

That was a test version used to test file save errors. That might be the reasons

Thus spake ClaudioC:

Hello,
I got the unable to write to file error today on closing a logfile.
No antivirus, no dropbox folder, just writing in the desktop.

Isn’t OneDrive cloud storage?


J.

Joel, I disabled One Drive when I installed windows 10, but for some reason, windows decided that my users account folders should be in a path C:\Users\claud\OneDrive

I did not even know that, as windows does not show the path of the desktop. But I confirm that I am not using OneDrive.

Also, it seems to occur all the time and in any directory with the version VASSAL-3.3.2-407-gc11ffef3-bug13205 that you had asked me to test some days ago.

Claudio, what happens for you with VASSAL-3.3.3-SNAPSHOT-9a9020b4?

vassalengine.org/~uckelman/tmp/

Same error. Both with save as and close logfile.

How about with VASSAL-3.3.3-SNAPSHOT-bug13014-d468953e?

There is no windows 64 build for that snapshot
[attachment=0]Annotation 2020-07-28 221928.png[/attachment]

I gave up on the bug13014 branch as the ZipFS API I switched to in it has potential problems I’d prefer we avoid at this point.

The current build is VASSAL-3.3.3-SNAPSHOT-2d301d84. It shouldn’t show you a bug dialog. It will probably still be unable to write to the file you’re trying to write to.

Just an FYI update to this, the issue seems to be resolved after updating to Vassal 3.3.2, so that may be something to try out if you’re having the same issue.