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

Main file directory is used if not empty, even if deactivated #9556

Open
2 tasks done
h4ppyM opened this issue Jan 12, 2023 · 19 comments
Open
2 tasks done

Main file directory is used if not empty, even if deactivated #9556

h4ppyM opened this issue Jan 12, 2023 · 19 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs status: waiting-for-feedback The submitter or other users need to provide more information about the issue

Comments

@h4ppyM
Copy link

h4ppyM commented Jan 12, 2023

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

  • 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

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":
error

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

@Siedlerchr
Copy link
Member

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

@Siedlerchr Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Jan 12, 2023
@h4ppyM
Copy link
Author

h4ppyM commented Jan 12, 2023

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.

@Siedlerchr
Copy link
Member

Yes, this seems odd. Can you try to set the main file directory to empty? Does it work then?

@h4ppyM
Copy link
Author

h4ppyM commented Jan 12, 2023

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.

@Siedlerchr Siedlerchr added bug Confirmed bugs or reports that are very likely to be bugs and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Jan 12, 2023
@Siedlerchr Siedlerchr changed the title "Automatically set file links" (F7) not working Main file directory is used if not empty, even if deactivated Jan 12, 2023
@Siedlerchr
Copy link
Member

Okay, thanks for the clarification. Tagged this as bug.

@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Jan 12, 2023
@sreenath-tm
Copy link
Contributor

Hi I would like to contribute to this issue can you let me know how I can go about this issue?

@ThiloteE
Copy link
Member

ThiloteE commented Jan 20, 2023

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>

@sreenath-tm
Copy link
Contributor

sreenath-tm commented Jan 21, 2023

Sure @ThiloteE will take a look into these commits.

@sreenath-tm
Copy link
Contributor

@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 .

@h4ppyM
Copy link
Author

h4ppyM commented Jan 27, 2023

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.

@sreenath-tm
Copy link
Contributor

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.
image

@sreenath-tm
Copy link
Contributor

@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?

@ghost
Copy link

ghost commented Feb 1, 2023

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.

@sreenath-tm
Copy link
Contributor

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.

@ThiloteE ThiloteE assigned ghost and unassigned sreenath-tm Feb 1, 2023
@ThiloteE
Copy link
Member

ThiloteE commented May 11, 2023

Might be related: #8010
Maybe fixed by #9837

@koppor
Copy link
Member

koppor commented May 21, 2023

The main challenge of this is issue to create JUnit tests to express the desired behavior.

@Siedlerchr
Copy link
Member

Didn't we just fix this?

@Siedlerchr
Copy link
Member

@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/

@HoussemNasri HoussemNasri added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label May 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 status: waiting-for-feedback The submitter or other users need to provide more information about the issue
Projects
Status: Normal priority
Development

No branches or pull requests

6 participants