JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.55k stars 2.47k forks source link

No able to open a file once the folder value is invalid #10548

Open Nosdok opened 11 months ago

Nosdok commented 11 months ago

JabRef version

5.11 (latest release)

Operating system

macOS

Details on version and operating system

14.0 Sonoma

Checked with the latest development build (copy version output from About dialog)

Steps to reproduce the behaviour

This problem is old and already solved (https://github.com/JabRef/jabref/issues/2522) but on a failed mounted directory (with ssh) in the lastest JabRef version the problem exists (at least in MacOs).

  1. The .bib file was in a mounted directory that failed to connect due to a timeout.
  2. The mac system let the folder 'hanging' and not accessible anymore.
  3. At this point, I started JabRef, click in "open a library"
  4. But I don't get the 'open file' window, instead I get the following exception and I'm no longer able to open any file: "Uncaught exception occured in Thread[#39,JavaFX Application Thread,5,main]"

Find attached details of the error.

The partial solution is to force the unmounting (of the directory). Only then JabRef works properly and let me open the 'open file' window.

Appendix

...

Log File ``` java.lang.IllegalArgumentException: Folder parameter must be a valid folder at org.jabref.merged.module@5.11.60000/com.sun.glass.ui.CommonDialogs.convertFolder(CommonDialogs.java:239) at org.jabref.merged.module@5.11.60000/com.sun.glass.ui.CommonDialogs.showFileChooser(CommonDialogs.java:191) at org.jabref.merged.module@5.11.60000/com.sun.javafx.tk.quantum.QuantumToolkit.showFileChooser(QuantumToolkit.java:1719) at org.jabref.merged.module@5.11.60000/javafx.stage.FileChooser.showDialog(FileChooser.java:419) at org.jabref.merged.module@5.11.60000/javafx.stage.FileChooser.showOpenMultipleDialog(FileChooser.java:376) at org.jabref@5.11.60000/org.jabref.gui.JabRefDialogService.showFileOpenDialogAndGetMultipleFiles(JabRefDialogService.java:398) at org.jabref@5.11.60000/org.jabref.gui.importer.actions.OpenDatabaseAction.execute(OpenDatabaseAction.java:109) at org.jabref@5.11.60000/org.jabref.gui.actions.JabRefAction.lambda$new$3(JabRefAction.java:40) at org.jabref.merged.module@5.11.60000/org.controlsfx.control.action.Action.handle(Action.java:423) at org.jabref.merged.module@5.11.60000/org.controlsfx.control.action.Action.handle(Action.java:64) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49) at org.jabref.merged.module@5.11.60000/javafx.event.Event.fireEvent(Event.java:198) at org.jabref.merged.module@5.11.60000/javafx.scene.control.MenuItem.fire(MenuItem.java:459) at org.jabref.merged.module@5.11.60000/com.sun.javafx.scene.control.GlobalMenuAdapter.lambda$bindMenuItemProperties$2(GlobalMenuAdapter.java:150) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at org.jabref.merged.module@5.11.60000/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at org.jabref.merged.module@5.11.60000/javafx.event.Event.fireEvent(Event.java:198) at org.jabref.merged.module@5.11.60000/javafx.scene.control.MenuItem.fire(MenuItem.java:459) at org.jabref.merged.module@5.11.60000/com.sun.javafx.tk.quantum.GlassSystemMenu$1.action(GlassSystemMenu.java:234) ```
Siedlerchr commented 11 months ago

Thanks for the report. There needs to be a check the file/folder is still existing. As a workaround you can start JabRef from command line and reset your preferences.

https://docs.jabref.org/advanced/commandline#reset-preferences-d-key

Siedlerchr commented 11 months ago

I think this methods which is called in OpenDatabaseAction must check if the directories exist and as fallback should return the user home directory

https://github.com/JabRef/jabref/blob/a0e2564806050247bce6056a6c108b87bab315b3/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java#L113-L123

devanshim2207 commented 8 months ago

Hi @Siedlerchr ..I would like to work on this issue.

github-actions[bot] commented 8 months ago

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

koppor commented 5 months ago

@devanshim2207 We did not see any activity the last 8 weeks, therefore I unassigned you.