Skip to content
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

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

Open
2 tasks done
Nosdok opened this issue Oct 23, 2023 · 5 comments
Open
2 tasks done

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

Nosdok opened this issue Oct 23, 2023 · 5 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files good first issue An issue intended for project-newcomers. Varies in difficulty.
Milestone

Comments

@Nosdok
Copy link

Nosdok commented Oct 23, 2023

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)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

This problem is old and already solved (#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[Fix for bug #1269 (SF) #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
Copy link
Member

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 Siedlerchr added the bug Confirmed bugs or reports that are very likely to be bugs label Oct 23, 2023
@Siedlerchr
Copy link
Member

Siedlerchr commented Oct 23, 2023

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

/**
* @return Path of current panel database directory or the working directory
*/
private Path getInitialDirectory() {
if (frame.getLibraryTabs().isEmpty()) {
return preferencesService.getFilePreferences().getWorkingDirectory();
} else {
Optional<Path> databasePath = frame.getCurrentLibraryTab().getBibDatabaseContext().getDatabasePath();
return databasePath.map(Path::getParent).orElse(preferencesService.getFilePreferences().getWorkingDirectory());
}
}

@Siedlerchr Siedlerchr added good first issue An issue intended for project-newcomers. Varies in difficulty. external files labels Oct 23, 2023
@devanshim2207
Copy link

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

@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Jan 13, 2024
Copy link
Contributor

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 koppor removed the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Mar 25, 2024
@koppor
Copy link
Member

koppor commented Mar 25, 2024

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

@koppor koppor added this to the 6.0-beta milestone Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Status: Normal priority
Status: Free to take
Development

No branches or pull requests

5 participants