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

Automatically set file links throws java error that is not shown to the user in the GUI #5890

Closed
joelostblom opened this issue Jan 29, 2020 · 4 comments
Labels
component: ui good first issue An issue intended for project-newcomers. Varies in difficulty. [outdated] type: enhancement status: stale Issues marked by a bot as "stale". All issues need to be investigated manually.

Comments

@joelostblom
Copy link

When I click Automatically set file links, JabRef shows the progress bar for a long time (close to a minute) and then a small toast message says that it is done, but no links are found. The event log inside JabRef does not show anything, but when I check the terminal from which I launch JabRef, I see the java error ERROR AutoSetFileLinksUtil Problem finding files.

I figured this is because I don't have permission to access a folder on my system, but it took me a while to figure this out because I was launching jabref via my systems menu and neither the toast message or the event log showed that anything was awry. It was only when I launched from the terminal that I could figure out what was going on. It would be nice to somehow inform the user in the GUI that there has been an error.

Full error:

$ jabref
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

(JabRef:70588): Gdk-WARNING **: 11:51:12.817: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.
ERROR AutoSetFileLinksUtil Problem finding files
 java.io.IOException: Problem in finding files
        at org.jabref/org.jabref.logic.util.io.CiteKeyBasedFileFinder.findFilesByExtension(Unknown Source)
        at org.jabref/org.jabref.logic.util.io.CiteKeyBasedFileFinder.findAssociatedFiles(Unknown Source)
        at org.jabref/org.jabref.gui.externalfiles.AutoSetFileLinksUtil.findAssociatedNotLinkedFiles(Unknown Source)
        at org.jabref/org.jabref.gui.externalfiles.AutoSetFileLinksUtil.linkAssociatedFiles(Unknown Source)
        at org.jabref/org.jabref.gui.externalfiles.AutoLinkFilesAction$1.call(Unknown Source)
        at org.jabref/org.jabref.gui.externalfiles.AutoLinkFilesAction$1.call(Unknown Source)
        at org.jabref.merged.module/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: /home/joel/gnupg2/crls.d
        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: /home/joel/gnupg2/crls.d
        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.UnixException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.UnixFileSystemProvider.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

I installed jabref via the AUR package jabref-latest:

JabRef 5.0-beta.382--2020-01-28--0b53d4b
Linux 5.4.14-arch1-1 amd64 
Java 13.0.2
@tobiasdiez tobiasdiez added [outdated] type: enhancement good first issue An issue intended for project-newcomers. Varies in difficulty. component: ui labels Feb 1, 2020
@tobiasdiez
Copy link
Member

The problem that errors are not shown in the error console but only in the terminal is a consequence of #5437
Nonetheless, in this particular case, I agree that the user should be properly informed about the error using an error dialog.

@rubenLindstrom
Copy link

rubenLindstrom commented Feb 24, 2020

Hi! @tobiasdiez
We're a team of 5 students currently attempting to make our first open source contribution, and chose this issue!

We're unfamiliar with JabRef, and are currently unable to recreate this issue. Could you please provide us a step by step for how to recreate it, so we can attempt to solve it?

All recommendations and tips are of course welcome!

Thanks!

IfIWantedTo added a commit to IfIWantedTo/jabref that referenced this issue Sep 2, 2020
AutoSetFileLinksUtil:
-> imported JabRefDialogService and Localization
->showErrorDialogAndWait(...)

I am currently having trouble writing a test
@IfIWantedTo
Copy link
Contributor

Hi @joelostblom, I am currently working on this as my first issue. Since I am very new to JabRef I don't quite know my way around yet. It would help me alot if you could give me directions on how to recreate the error. Only if you have the time and energy to do so of course.

Siedlerchr pushed a commit that referenced this issue Dec 24, 2020
* #5890 added Error Dialog

AutoSetFileLinksUtil:
-> imported JabRefDialogService and Localization
->showErrorDialogAndWait(...)

I am currently having trouble writing a test

* Fix errorDialog AutoSetFileLinks

Fixed mistake in first commit.

.lists all exceptions
.notifies user of error via DialogService

* Fix notifying in AutoSetFileLinksAction

- add  returnFileExceptions() in AutoSetFileLinksUtil
- add if ( 'there are exceptions' ) -> notify user in AutoSetFileLinkAction (placement still unclear, might be changed later)

* Fixed checkstyle error in AutoSetFileLinksUtilTest

* Fixed import order in JabRefFrame

* Update JabRefFrame.java

* Refactored to fail fast

* Update JabRef_en.properties

* Included remarks

* Merge error

Co-authored-by: Carl Christian Snethlage <[email protected]>
Co-authored-by: Carl Christian Snethlage <[email protected]>
@github-actions
Copy link
Contributor

This issue has been inactive for half a year. Since JabRef is constantly evolving this issue may not be relevant any longer and it will be closed in two weeks if no further activity occurs.

As part of an effort to ensure that the JabRef team is focusing on important and valid issues, we would like to ask if you could update the issue if it still persists. This could be in the following form:

  • If there has been a longer discussion, add a short summary of the most important points as a new comment (if not yet existing).
  • Provide further steps or information on how to reproduce this issue.
  • Upvote the initial post if you like to see it implemented soon. Votes are not the only metric that we use to determine the requests that are implemented, however, they do factor into our decision-making process.
  • If all information is provided and still up-to-date, then just add a short comment that the issue is still relevant.

Thank you for your contribution!

@github-actions github-actions bot added the status: stale Issues marked by a bot as "stale". All issues need to be investigated manually. label Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ui good first issue An issue intended for project-newcomers. Varies in difficulty. [outdated] type: enhancement status: stale Issues marked by a bot as "stale". All issues need to be investigated manually.
Projects
None yet
Development

No branches or pull requests

4 participants