-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving file throws exception #6102
Comments
Could the file be saved at the end or is it corrupted? |
It was saved.
…On 12 March 2020 07:54:18 CET, Oliver Kopp ***@***.***> wrote:
Could the file be saved at the end or is it corrupted?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#6102 (comment)
--
Sent from my LineageOS device with K-9 Mail. Please excuse my brevity.
|
I have not experienced the issue for a long time anymore JabRef 5.1--2020-04-14--e86d415 |
these days I have been seeing the phenomenon again - the same as in #4877 (comment) I guess? |
The problem lies here:
And I finally found the root cause. It's a threading problem when you have austosave enabled and at the same time manually hit save.
We somehow need a way to lock that or cancel the save operation when already one is active. The other problem is that always a new object instance of the Writer or Save Action is created. I tried some locking in the cleanup |
What about writing to a unique temporary file (in the users temporary file folder, with some random name)? Then you don't need to worry about locking etc (since the Moreover, I think, it's time to finally remove the BackupManager stuff...simply make a copy of the bib file upon loading a library (and say keep the last 10 versions). We run into so many problems with the backup stuff and it's a pretty old concept anyway. |
I see mozilla and others simply writing to in case the BackupManager is to keep x versions, I would say: let the user define x. I suggest so because many users will have already other backup/versioning software and might constrain x to 1; and other might like a higher number of backup versions. |
@tobiasdiez The backup manager is not that problem it's the autosave manager. I also discovered an issue with the FileOutputStream locking. Trying to check that |
Yeah I understand, that's why I suggested that every write process should have their own temporary file. |
JabRef 5.3--2021-07-16--c99d61c Let me add this exception I got a moment ago - might be related Log Fileorg.jabref.logic.exporter.SaveException: Problems saving: java.nio.file.NoSuchFileException: /home/il/Documents/Studies/Publications&Products/Resources/Literature-bibtex.bib.tmp -> /home/il/Documents/Studies/Publications&Products/Resources/Literature-bibtex.bib at org.jabref@5.3.21/org.jabref.gui.exporter.SaveDatabaseAction.saveDatabase(Unknown Source) at org.jabref@5.3.21/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source) at org.jabref@5.3.21/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source) at org.jabref@5.3.21/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source) at org.jabref@5.3.21/org.jabref.gui.exporter.SaveAction.execute(Unknown Source) at org.jabref@5.3.21/org.jabref.gui.actions.JabRefAction.lambda$new$3(Unknown Source) at org.jabref.merged.module@5.3.21/org.controlsfx.control.action.Action.handle(Unknown Source) at org.jabref.merged.module@5.3.21/org.controlsfx.control.action.Action.handle(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module@5.3.21/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module@5.3.21/javafx.scene.control.MenuItem.fire(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.scene.control.ControlAcceleratorSupport.lambda$doAcceleratorInstall$1(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.scene.KeyboardShortcutsHandler.processAccelerators(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.scene.KeyboardShortcutsHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module@5.3.21/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module@5.3.21/javafx.scene.Scene$KeyHandler.process(Unknown Source) at org.jabref.merged.module@5.3.21/javafx.scene.Scene.processKeyEvent(Unknown Source) at org.jabref.merged.module@5.3.21/javafx.scene.Scene$ScenePeerListener.keyEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.glass.ui.View.handleKeyEvent(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.glass.ui.View.notifyKey(Unknown Source) at org.jabref.merged.module@5.3.21/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at org.jabref.merged.module@5.3.21/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.nio.file.NoSuchFileException: /home/il/Documents/Studies/Publications&Products/Resources/Literature-bibtex.bib.tmp -> /home/il/Documents/Studies/Publications&Products/Resources/Literature-bibtex.bib at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) at java.base/sun.nio.fs.UnixCopyFile.move(Unknown Source) at java.base/sun.nio.fs.UnixFileSystemProvider.move(Unknown Source) at java.base/java.nio.file.Files.move(Unknown Source) at org.jabref@5.3.21/org.jabref.logic.exporter.AtomicFileOutputStream.close(Unknown Source) at java.base/sun.nio.cs.StreamEncoder.implClose(Unknown Source) at java.base/sun.nio.cs.StreamEncoder.close(Unknown Source) at java.base/java.io.OutputStreamWriter.close(Unknown Source) at org.jabref@5.3.21/org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase(Unknown Source) at org.jabref@5.3.21/org.jabref.logic.exporter.BibDatabaseWriter.saveDatabase(Unknown Source) ... 42 more |
Hi, I thought I would let you know that I was having a similar error but I managed to fix it. I was creating a new library. The problem in my case was that I had an emoji (🌱) in path of "main file directory". There is an (You will think that using emojis in file names is a stupid thing to do but I am a very visual person and having cues makes using the computer much, much easier especially when in the command line. It causes surprisingly few problems but occasionally there is something. Especially with non-native applications.) Although it doesn't look like the others above do such ridiculous things as I do, maybe it'll be some kind of useful hint. Thanks for the software. :)
JabRef 5.3--2021-07-05--50c96a2 Edit: I was closing the tabs from solving this problem and noticed noticed one I had opened from a search but didn't get to reading: Problem Saving Library - Help - Forum - JabRef
which sounds similar. |
I saved my file, and got this exception. I cannot repeat this.
JabRef 5.0--2020-03-09--6bff936
Linux 5.5.8-200.fc31.x86_64 amd64
Java 13.0.2
Inspired by the discussion at #4877 I like to contribute the fact that my file system is a LVM partition with a cache.
Log File
org.jabref.logic.exporter.SaveException: Problems saving: at org.jabref/org.jabref.gui.exporter.SaveDatabaseAction.saveDatabase(Unknown Source) at org.jabref/org.jabref.gui.exporter.SaveDatabaseAction.doSave(Unknown Source) at org.jabref/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source) at org.jabref/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source) at org.jabref/org.jabref.gui.exporter.SaveAction.execute(Unknown Source) at org.jabref/org.jabref.gui.actions.JabRefAction.lambda$new$2(Unknown Source) at org.jabref.merged.module/org.controlsfx.control.action.Action.handle(Unknown Source) at org.jabref.merged.module/org.controlsfx.control.action.Action.handle(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.control.MenuItem.fire(Unknown Source) at org.jabref.merged.module/com.sun.javafx.scene.control.ControlAcceleratorSupport.lambda$doAcceleratorInstall$1(Unknown Source) at org.jabref.merged.module/com.sun.javafx.scene.KeyboardShortcutsHandler.processAccelerators(Unknown Source) at org.jabref.merged.module/com.sun.javafx.scene.KeyboardShortcutsHandler.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene$KeyHandler.process(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene.processKeyEvent(Unknown Source) at org.jabref.merged.module/javafx.scene.Scene$ScenePeerListener.keyEvent(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.View.handleKeyEvent(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.View.notifyKey(Unknown Source) at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at org.jabref.merged.module/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.nio.file.NoSuchFileException: /home/ilippert/Documents/Studies/Publications&Products/Resources/Literature-bibtex.bib.tmp -> /home/ilippert/Documents/Studies/Publications&Products/Resources/Literature-bibtex.bib at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) at java.base/sun.nio.fs.UnixCopyFile.move(Unknown Source) at java.base/sun.nio.fs.UnixFileSystemProvider.move(Unknown Source) at java.base/java.nio.file.Files.move(Unknown Source) at org.jabref/org.jabref.logic.exporter.AtomicFileOutputStream.close(Unknown Source) at java.base/sun.nio.cs.StreamEncoder.implClose(Unknown Source) at java.base/sun.nio.cs.StreamEncoder.close(Unknown Source) at java.base/java.io.OutputStreamWriter.close(Unknown Source) at org.jabref/org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase(Unknown Source) at org.jabref/org.jabref.logic.exporter.BibDatabaseWriter.saveDatabase(Unknown Source) ... 42 moreThe text was updated successfully, but these errors were encountered: