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

Import from CLI fails sometimes #7359

Closed
1 task
tobiasdiez opened this issue Jan 17, 2021 · 6 comments
Closed
1 task

Import from CLI fails sometimes #7359

tobiasdiez opened this issue Jan 17, 2021 · 6 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs cli import os: windows

Comments

@tobiasdiez
Copy link
Member

JabRef 5.2--2020-12-14--e9be339
Windows 10 10.0 amd64
Java 14.0.2

Steps to reproduce the behavior:

  1. Go to https://arxiv.org/abs/1109.0517
  2. Send to JabRef using Browser Extension
  3. Get following error:

Importing in unknown format: curves Error opening file 'curves': Could not find a suitable import format. Importing in unknown format: with Error opening file 'with': Could not find a suitable import format. Importing in unknown format: complemetary Error opening file 'complemetary': Could not find a suitable import format. Importing in unknown format: series} Error opening file 'series}': Could not find a suitable import format. Importing in unknown format: url Error opening file 'url': Could not find a suitable import format. Importing in unknown format: = Error opening file '=': Could not find a suitable import format. %d [%thread] %-5level %logger - %msg%n java.nio.file.InvalidPathException: Illegal char <:> at index 5: {http://arxiv.org/abs/1109.0517} at sun.nio.fs.WindowsPathParser.normalize(Unknown Source) ~[?:?] at sun.nio.fs.WindowsPathParser.parse(Unknown Source) ~[?:?] at sun.nio.fs.WindowsPathParser.parse(Unknown Source) ~[?:?] at sun.nio.fs.WindowsPath.parse(Unknown Source) ~[?:?] at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source) ~[?:?] at java.nio.file.Path.of(Unknown Source) ~[?:?] at org.jabref.cli.ArgumentProcessor.importFile(Unknown Source) ~[org.jabref:?] at org.jabref.cli.ArgumentProcessor.importAndOpenFiles(Unknown Source) ~[org.jabref:?] at org.jabref.cli.ArgumentProcessor.processArguments(Unknown Source) ~[org.jabref:?] at org.jabref.cli.ArgumentProcessor.(Unknown Source) ~[org.jabref:?] at org.jabref.gui.JabRefMain.start(Unknown Source) ~[org.jabref:?] at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source) ~[org.jabref.merged.module:?] at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(Unknown Source) ~[org.jabref.merged.module:?] at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source) ~[org.jabref.merged.module:?] at java.security.AccessController.doPrivileged(Unknown Source) ~[?:?] at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source) ~[org.jabref.merged.module:?] at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source) ~[org.jabref.merged.module:?] at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) ~[org.jabref.merged.module:?] at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source) ~[org.jabref.merged.module:?] at java.lang.Thread.run(Unknown Source) [?:?]

For some reason, JabRef tries to find the import format although we call it with "--importBibtex".

@tobiasdiez tobiasdiez added bug Confirmed bugs or reports that are very likely to be bugs cli import labels Jan 17, 2021
@Siedlerchr
Copy link
Member

I think this is the same underlying bug as in #7347

egal char <:> at index 5: {http://arxiv.org/abs/1109.0517} at sun.nio.fs.WindowsPathParser.normalize(Unknown Source) ~[?:?] at sun.nio.fs.WindowsPathParser.parse(Unknown Source) ~[?:

@LyzardKing
Copy link
Collaborator

I can't reproduce this issue on Linux.
Both the snap and flatpak import the reference correctly.

@tobiasdiez
Copy link
Member Author

Thanks, that's good to know. Than it might be a problem with the powershell script that is used as the communication bridge between Firefox and JabRef.

@Siedlerchr
Copy link
Member

The bibtex I receive on mac looks like this: The error in your stacktrace is coming from importFile, but that is never called when I import when debugging.

@article{matheus_explicit_2012,
	title = {Explicit {Teichm}{\textbackslash}"uller curves with complemetary series},
	url = {http://arxiv.org/abs/1109.0517},
	abstract = {We construct an explicit family of arithmetic Teichm{\textbackslash}"uller curves \${\textbackslash}mathcal\{C\}\_\{2k\}\$, \$k{\textbackslash}in{\textbackslash}mathbb\{N\}\$, supporting \${\textbackslash}textrm\{SL\}(2,{\textbackslash}mathbb\{R\})\$-invariant probabilities \${\textbackslash}mu\_\{2k\}\$ such that the associated \${\textbackslash}textrm\{SL\}(2,{\textbackslash}mathbb\{R\})\$-representation on \$L{\textasciicircum}2({\textbackslash}mathcal\{C\}\_\{2k\}, {\textbackslash}mu\_\{2k\})\$ has complementary series for every \$k{\textbackslash}geq 3\$. Actually, the size of the spectral gap along this family goes to zero. In particular, the Teichm{\textbackslash}"uller geodesic flow restricted to these explicit arithmetic Teichm{\textbackslash}"uller curves \${\textbackslash}mathcal\{C\}\_\{2k\}\$ has arbitrarily slow rate of exponential mixing.},
	urldate = {2021-01-18},
	journal = {arXiv:1109.0517 [math]},
	author = {Matheus, Carlos and Weitze-Schmithüsen, Gabriela},
	month = aug,
	year = {2012},
	note = {arXiv: 1109.0517},
	keywords = {Mathematics - Dynamical Systems},
	annote = {Comment: 46 pages, 10 figures. Final version (based on the referee report). To appear in Bulletin SMF},
	file = {arXiv Fulltext PDF:https\://arxiv.org/pdf/1109.0517.pdf:application/pdf}
}

And from your stacktrace I see why it fails:

private static Optional<ParserResult> importFile(String argument) {
String[] data = argument.split(",");
String address = data[0];
Path file;
if (address.startsWith("http://") || address.startsWith("https://") || address.startsWith("ftp://")) {
// Download web resource to temporary file
try {
file = new URLDownload(address).toTemporaryFile();
} catch (IOException e) {
System.err.println(Localization.lang("Problem downloading from %1", address) + e.getLocalizedMessage());
return Optional.empty();
}
} else {
if (OS.WINDOWS) {
file = Path.of(address);
} else {
file = Path.of(address.replace("~", System.getProperty("user.home")));
}
}

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

@Siedlerchr
Copy link
Member

Thank you for reporting this issue. We think, that is already fixed in our development version and consequently the change will be included in the next release.

We would like to ask you to use a development build from https://builds.jabref.org/main and report back if it works for you. Please remember to make a backup of your library before trying-out this version.

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 cli import os: windows
Projects
Archived in project
Development

No branches or pull requests

3 participants