jabref
jabref copied to clipboard
Main file directory is used if not empty, even if deactivated
JabRef version
5.9 (latest release)
Operating system
Windows
Details on version and operating system
Windows 10 Pro 21H2
Checked with the latest development build
- [X] I made a backup of my libraries before testing the latest development version.
- [X] I have tested the latest development version and the problem persists
Steps to reproduce the behaviour
Since stable version 5.8 (and also with the new 5.10 build from 2023-01-11) I get the following error message displayed when using the function "Automatically set file links":
With stable version 5.7 this function works properly.
Appendix
Detail information:
Problem finding files
java.io.IOException: Problem in finding files
at [email protected]/org.jabref.logic.util.io.CitationKeyBasedFileFinder.findFilesByExtension(Unknown Source)
at [email protected]/org.jabref.logic.util.io.CitationKeyBasedFileFinder.findAssociatedFiles(Unknown Source)
at [email protected]/org.jabref.gui.externalfiles.AutoSetFileLinksUtil.findAssociatedNotLinkedFiles(Unknown Source)
at [email protected]/org.jabref.gui.externalfiles.AutoSetFileLinksUtil.linkAssociatedFiles(Unknown Source)
at [email protected]/org.jabref.gui.externalfiles.AutoLinkFilesAction$1.call(Unknown Source)
at [email protected]/org.jabref.gui.externalfiles.AutoLinkFilesAction$1.call(Unknown Source)
at [email protected]/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.UncheckedIOException: java.nio.file.AccessDeniedException: C:\Users\Michael\Documents\Eigene Bilder
at java.base/java.nio.file.FileTreeIterator.fetchNextIfNeeded(Unknown Source)
at java.base/java.nio.file.FileTreeIterator.hasNext(Unknown Source)
at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
... 13 more
Caused by: java.nio.file.AccessDeniedException: C:\Users\Michael\Documents\Eigene Bilder
at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsDirectoryStream.<init>(Unknown Source)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(Unknown Source)
at java.base/java.nio.file.Files.newDirectoryStream(Unknown Source)
at java.base/java.nio.file.FileTreeWalker.visit(Unknown Source)
at java.base/java.nio.file.FileTreeWalker.next(Unknown Source)
... 22 more
Hi, the error message says it searches for files in your documents folder. C:\Users\Michael\Documents and cannot access the pictures folder. You should check and adjust the settings for the main file directory in the Preferences -> Linked Files to point to the location of where your pdfs are stored
In the library settings the directories are correctly set to my library folder of the project and my LaTeX project folder. Also in the Preferences -> Linked files the "File directory" was set to "Search and store files relative to library file location". But in the text field next to the option "Main file directory" the path C:\Users\Michael\Documents was printed but grayed out as the option was unchecked.
So it seems like JabRef is searching the main file directory although the option is not activated, which seems to be an unexpected behavior.
PS: When I check the "Main file directory", delete the path and check back the "Search and store files relative to library file location" option the "Automatically set file links" function works again with v. 5.9.
Yes, this seems odd. Can you try to set the main file directory to empty? Does it work then?
Yes, that's what I've meant in my previous post. When I empty the main file directory (although option is not activated) it is working.
Okay, thanks for the clarification. Tagged this as bug.
Recent commits, of which one of them could be the likely cause for this regression:
- https://github.com/JabRef/jabref/pull/9433
- https://github.com/JabRef/jabref/pull/9316
- https://github.com/JabRef/jabref/pull/9290
- https://github.com/JabRef/jabref/pull/9222
- https://github.com/JabRef/jabref/pull/9129
- https://github.com/JabRef/jabref/pull/9113
Hi I would like to contribute to this issue can you let me know how I can go about this issue?
Hello sreenath-tm, welcome back :-)
One approach would be to find the regression window by finding the commit that broke it. By finding that exact commit, you will find the part of the code, which is of most relevance here.
To open an older commit, you can use following command:
./gradlew clean
git checkout <commithash>
Sure @ThiloteE will take a look into these commits.
@Siedlerchr @h4ppyM I am unable to reproduce this error can you just let me know that before clicking the "Automatically set file links" is there any thing specific entry that I should make. I have ensured that options in the preference is as specified by @h4ppyM .
In my case, the path was set to my PC's picture folder (C:\Users\Michael\Documents\Eigene Bilder), but greyed out as the option was not selected.
I am actually getting this screenshot while trying to automatically set the link. Is there any particular link or entry that I can try out to mimic the issue.

@h4ppyM extremely sorry for disturbing but I am unable to mimic the exact behaviour ,so can you let me know how you are importing the file into jabref. @Siedlerchr are you able to reproduce the issue?
Hello sir , I am new to open source contribution. I already know java , my tech stacks & tools includes C, C++ , Python , Java, JavaScript , HTML , CSS , SQL , Bootstrap, ReactJS, ExpressJS, NodeJS & Git . I need a little help from your side to contribute to these amazing projects.
Please feel free to take up this issue @itsarraj .You can go through the documentation https://devdocs.jabref.org/contributing and do the setup for jabref and then try reproducing the issue.
Might be related: https://github.com/JabRef/jabref/issues/8010 Maybe fixed by https://github.com/JabRef/jabref/pull/9837
The main challenge of this is issue to create JUnit tests to express the desired behavior.
Didn't we just fix this?
@h4ppyM can you please test the latest development version? As far as I know we fixed some issues related to that https://builds.jabref.org/main/