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

JabRef error if keyword group has no name #9776

Closed
2 tasks done
alfureu opened this issue Apr 18, 2023 · 16 comments · Fixed by #10369
Closed
2 tasks done

JabRef error if keyword group has no name #9776

alfureu opened this issue Apr 18, 2023 · 16 comments · Fixed by #10369
Labels
bug Confirmed bugs or reports that are very likely to be bugs FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty. groups

Comments

@alfureu
Copy link

alfureu commented Apr 18, 2023

Update: Read on at #9776 (comment)

JabRef version

5.9 (latest release)

Operating system

macOS

Details on version and operating system

macOS 13.3.1

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

  1. import a biblatex library created on linux machine and with the special field priority
  2. error opening (does not open)
JabRef 5.9--2023-01-08--76253f1a7
Mac OS X 13.3.1 aarch64 
Java 19.0.1 
JavaFX 19+11

Appendix

...

Log File
java.lang.NumberFormatException: For input string: "priority"
	at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.base/java.lang.Integer.parseInt(Unknown Source)
	at java.base/java.lang.Integer.parseInt(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.keywordGroupFromString(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.fromString(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.importGroups(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.MetaDataParser.parse(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.MetaDataParser.parse(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.fileformat.BibtexParser.parseFileContent(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.fileformat.BibtexParser.parse(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.OpenDatabase.loadDatabase(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.gui.importer.actions.OpenDatabaseAction.loadDatabase(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.gui.importer.actions.OpenDatabaseAction.lambda$openTheFile$1(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
	at org.jabref.merged.module@5.9.60000/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)

@koppor
Copy link
Member

koppor commented Apr 18, 2023

Which JabRef version was run on the Linux machine? I would assume 3.8.2.

@koppor
Copy link
Member

koppor commented Apr 18, 2023

Can you send the whole bib file to us? Find my email adress in my GitHub profile. - The stacktrace org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.keywordGroupFromString indicates that something else is going on.

@koppor koppor added the bug Confirmed bugs or reports that are very likely to be bugs label Apr 18, 2023
@alfureu
Copy link
Author

alfureu commented Apr 18, 2023

Which JabRef version was run on the Linux machine? I would assume 3.8.2.

I am running v5.9 also on the Linux machine (Fedora 37 and flatpak install from Software store)

@alfureu
Copy link
Author

alfureu commented Apr 18, 2023

Can you send the whole bib file to us? Find my email adress in my GitHub profile. - The stacktrace org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.keywordGroupFromString indicates that something else is going on.

I am not sure I can send it to you as the whole bib file is rather huge (25+ MB) and is a part of a research project. The thing is, this is a bib file collated from multiple sources of various quality for a larger review (hence we use the priority classification). It contains non-Latin characters as well, just checked and the file is encoded as UTF-8 with LF with some non-ASCII characters (checked with VScode). I need to change whether I can open this file on a Windows 10 machine JabRef too... will feed back once I get access to such a machine

@Siedlerchr
Copy link
Member

Siedlerchr commented Apr 18, 2023

Can you try to open the file with the latest development version? I vaguely remember something about this
https://builds.jabref.org/main/
(It will report as broken on mac, but then you can allow the app in the Apple security because it's not signed/notarized)

@Siedlerchr
Copy link
Member

On may you need to execute xattr -d com.apple.quarantine /Applications/JabRef.app in the terminal

@alfureu
Copy link
Author

alfureu commented Apr 18, 2023

Can you try to open the file with the latest development version? I vaguely remember something about this https://builds.jabref.org/main/ (It will report as broken on mac, but then you can allow the app in the Apple security because it's not signed/notarized)

I tried to open it, and it provided the following error:

java.lang.NumberFormatException: For input string: "priority"
	at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.base/java.lang.Integer.parseInt(Unknown Source)
	at java.base/java.lang.Integer.parseInt(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.util.GroupsParser.keywordGroupFromString(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.util.GroupsParser.fromString(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.util.GroupsParser.importGroups(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.util.MetaDataParser.parse(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.util.MetaDataParser.parse(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.fileformat.BibtexParser.parseFileContent(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.fileformat.BibtexParser.parse(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(Unknown Source)
	at org.jabref@5.10.554/org.jabref.logic.importer.OpenDatabase.loadDatabase(Unknown Source)
	at org.jabref@5.10.554/org.jabref.gui.importer.actions.OpenDatabaseAction.loadDatabase(Unknown Source)
	at org.jabref@5.10.554/org.jabref.gui.importer.actions.OpenDatabaseAction.lambda$openTheFile$1(Unknown Source)
	at org.jabref@5.10.554/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
	at org.jabref@5.10.554/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
	at org.jabref.merged.module@5.10.554/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)

@alfureu
Copy link
Author

alfureu commented Apr 18, 2023

Can you send the whole bib file to us? Find my email adress in my GitHub profile. - The stacktrace org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.keywordGroupFromString indicates that something else is going on.

I tried to send the file to your email, hopefully it will go through.

@Siedlerchr
Copy link
Member

Thanks! Received it!

@Siedlerchr
Copy link
Member

@alfureu Good news. I found the issue and a fix for you is simple. The problem is that the Keyword Group for the field priority did not have a name! At the end of the file, where the group metadata is defined
replace:

2 KeywordGroup:\;0\;priority\;prio1\;1\;0\;1\;0x8a8a8aff\;\;\;;
with
2 KeywordGroup:Test\;0\;priority\;prio1\;1\;0\;1\;0x8a8a8aff\;\;\;;

and voila it works again :)

I will do more tests to find how this could be even possible to prevent such cases in the future.

@Siedlerchr Siedlerchr changed the title JabRef error if priority field enabled on macOS JabRef error if keyword group has no name Apr 18, 2023
@alfureu
Copy link
Author

alfureu commented Apr 18, 2023

Hm, this is interesting. Literally what I did was that I saved the bib file in JabRef on Linux, and I tried to open it on JabRef macOS. No idea what is happening between these. I was also surprised that the file does not open. Thanks for looking into this!

@Siedlerchr
Copy link
Member

I could reproduce this now with another library. Saving is not a problem, but on opening the parser fails to properly parse the group structure (off by one)

@alfureu
Copy link
Author

alfureu commented Apr 18, 2023

amazing, I was able to open the file in JabRef on macOS. Thanks again, great work! Will leave the ticket open until it gets fixed in the code by the devs

@koppor koppor added this to the v5.10 milestone Apr 29, 2023
@koppor koppor removed this from the v5.10 milestone May 8, 2023
@ShuaijuLv
Copy link

Hi, I am the university of adelaide student. Our group would like to sovle the issue. I think the solution above consider abnormally formatted data. Can I have the test file?

@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label May 20, 2023
@github-actions
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.

@Siedlerchr
Copy link
Member

To test this. Create a new library, add some entries and create a new automatic keyword group without a name.
save the library and reopen

@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Sep 8, 2023
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 FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty. groups
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants