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

Custom entry types might crash JabRef on start #11127

Closed
2 tasks done
Doc73 opened this issue Apr 1, 2024 · 11 comments · Fixed by #11132
Closed
2 tasks done

Custom entry types might crash JabRef on start #11127

Doc73 opened this issue Apr 1, 2024 · 11 comments · Fixed by #11132
Labels
[outdated] type: bug Confirmed bugs or reports that are very likely to be bugs
Milestone

Comments

@Doc73
Copy link
Contributor

Doc73 commented Apr 1, 2024

JabRef version

5.13 (latest release)

Operating system

GNU / Linux

Details on version and operating system

Debian Unstable Gnome AMD64

Checked with the latest development build (copy version output from About dialog)

  • 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. $ /opt/jabref/bin/JabRef
  2. Here is the result:
Messages are not initialized before accessing key: Display help on command line options
2024-04-01 23:52:12 [main] org.jabref.Launcher.main()
ERROR: Unexpected exception: java.lang.IllegalArgumentException: Fields [PAGES] already added
	at org.jabref@5.13.60000/org.jabref.model.entry.BibEntryTypeBuilder.withImportantFields(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.logic.importer.util.MetaDataParser.parseCustomEntryType(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.preferences.JabRefPreferences.lambda$getBibEntryTypes$5(Unknown Source)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
	at java.base/java.util.Spliterators$ArraySpliterator.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.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.preferences.JabRefPreferences.getBibEntryTypes(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.preferences.JabRefPreferences.lambda$getCustomEntryTypesRepository$3(Unknown Source)
	at java.base/java.lang.Iterable.forEach(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.preferences.JabRefPreferences.getCustomEntryTypesRepository(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.Launcher.initGlobals(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.Launcher.main(Unknown Source)

Appendix

...

Log File
Messages are not initialized before accessing key: Display help on command line options
2024-04-01 23:52:12 [main] org.jabref.Launcher.main()
ERROR: Unexpected exception: java.lang.IllegalArgumentException: Fields [PAGES] already added
	at org.jabref@5.13.60000/org.jabref.model.entry.BibEntryTypeBuilder.withImportantFields(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.logic.importer.util.MetaDataParser.parseCustomEntryType(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.preferences.JabRefPreferences.lambda$getBibEntryTypes$5(Unknown Source)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
	at java.base/java.util.Spliterators$ArraySpliterator.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.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.preferences.JabRefPreferences.getBibEntryTypes(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.preferences.JabRefPreferences.lambda$getCustomEntryTypesRepository$3(Unknown Source)
	at java.base/java.lang.Iterable.forEach(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.preferences.JabRefPreferences.getCustomEntryTypesRepository(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.Launcher.initGlobals(Unknown Source)
	at org.jabref@5.13.60000/org.jabref.Launcher.main(Unknown Source)```

</details>
@Doc73
Copy link
Contributor Author

Doc73 commented Apr 1, 2024

P. S.: downgraded to v. 5.12, still working

@Siedlerchr
Copy link
Member

Siedlerchr commented Apr 2, 2024 via email

@Siedlerchr Siedlerchr added the [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs label Apr 2, 2024
@koppor koppor added this to the 5.14 milestone Apr 2, 2024
@koppor
Copy link
Member

koppor commented Apr 2, 2024

@Doc73 Please open the file in a text editor, scroll to the very and and paste the selctor_keywords entries here.

@Comment{jabref-meta: selector_keywords:example;example-2;}

@Siedlerchr
Copy link
Member

@koppor This has nothing to do with content selectors, it's about custom entry entry types, but yes they might exist there as well but the stack trace looks like it's coming from the value in the prefs

@Doc73
Copy link
Contributor Author

Doc73 commented Apr 2, 2024

@koppor I have not this line, but I use custom entry type. I'm not at home. Tomorrow evening I will send other infos

@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Apr 2, 2024
@koppor koppor moved this from Normal priority to High priority in Prioritization Apr 2, 2024
@Siedlerchr
Copy link
Member

I can reproduce it now easily:

@Comment{jabref-entrytype: asdfasdf: req[pages] opt[pages]}

if (!containedFields.isEmpty()) {
throw new IllegalArgumentException("Fields " + containedFields + " already added");
}

Hah and it is the exact line I called out in the review #11013 (review)

@Siedlerchr
Copy link
Member

@Doc73 This version should work again https://builds.jabref.org/pull/11132/merge
The culprit is that you somehwere have a custom entry type with duplicated fields e.g. the field pages is both in required and optional fields

@Doc73
Copy link
Contributor Author

Doc73 commented Apr 2, 2024

@Siedlerchr I'll do the tests tomorrow, but I am nearly sure that I have no duplicate fields in my custom types, because I have given a look at the file itself (unfortunately, I can't past the text with my phone)

@Doc73
Copy link
Contributor Author

Doc73 commented Apr 2, 2024

I succeeded!

@Comment{jabref-meta: databaseType:biblatex;}

@Comment{jabref-meta: fileDirectoryLatex-domenico-debian:/home/domenico/Documenti/myLatexProjects/Scholia in Platonem;}

@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 KeywordGroup:Editiones\;1\;keywords\;editiones\;0\;0\;1\;0x008080ff\;\;\;;
1 KeywordGroup:Auctores\;1\;keywords\;auctores\;0\;0\;1\;0xff0000ff\;\;\;;
1 KeywordGroup:Studi\;1\;keywords\;studi\;0\;0\;1\;0x0000ffff\;\;\;;
1 KeywordGroup:Sigle\;1\;keywords\;sigle\;0\;0\;1\;0xffff00ff\;\;\;;
1 KeywordGroup:Scholia\;1\;keywords\;scholia\;0\;0\;1\;0x008000ff\;\;\;;
1 KeywordGroup:Extra\;1\;keywords\;extra\;0\;0\;1\;0x00ff00ff\;\;\;;
1 KeywordGroup:Philigranae\;1\;keywords\;philigranae\;0\;0\;1\;\;\;\;;
1 KeywordGroup:Manuscripti\;1\;keywords\;manuscripti\;0\;0\;1\;\;\;\;;
1 KeywordGroup:Palaeographia\;1\;keywords\;paleografia\;0\;0\;1\;0x800080ff\;\;\;;
1 KeywordGroup:Atti\;0\;keywords\;atti\;0\;0\;1\;0x669966ff\;\;\;;
1 KeywordGroup:MIEI\;1\;keywords\;mio\;0\;0\;1\;0x00ffffff\;\;\;;
1 KeywordGroup:Italian\;1\;keywords\;italian\;0\;0\;1\;\;\;\;;
2 KeywordGroup:Religio\;1\;keywords\;religio\;0\;0\;1\;\;\;\;;
2 KeywordGroup:Duecento\;1\;keywords\;duecento\;0\;0\;1\;\;\;\;;
2 KeywordGroup:Volgare\;1\;keywords\;volgare\;0\;0\;1\;\;\;\;;
2 KeywordGroup:Dante\;1\;keywords\;dante\;0\;0\;1\;\;\;\;;
2 KeywordGroup:General\;1\;keywords\;general\;0\;0\;1\;\;\;\;;
2 KeywordGroup:Prosa Duecento\;1\;keywords\;prosaduecento\;0\;0\;0\;\;\;\;;
2 KeywordGroup:Medioevo\;0\;keywords\;medioevo\;0\;0\;1\;0x8a8a8aff\;\;\;;
}

@Comment{jabref-entrytype: bookinarticle: req[author;bookauthor;date;journal;pages;title;volume] opt[keywords;mainsubtitle;maintitle;note;number;substitle]}

@Comment{jabref-entrytype: bookinincollection: req[author;bookauthor;booktitle;date;location;maintitle;pages;publisher;title] opt[booksubtitle;edition;editor;keywords;mainsubtitle;number;series;substitle;volume]}

@Comment{jabref-entrytype: manuscript: req[collection;library;location;shelfmark] opt[bookpagination;columns;dating;layer;pages;pagetotal;pagination;shortcollection;shorthand;shortlibrary;support]}

@Comment{jabref-entrytype: review: req[author;journal;pages;title;volume;date] opt[number;month;part;eid;note;keywords]}

@Comment{
Local Variables:
bibtex-dialect: biblatex
End:
}

@Siedlerchr
Copy link
Member

Sorry for the trouble we caused, and thank you so much for immediately testing! That's really helpful.

I think we cleaned the existing entry types as well to remove duplicates, it might have been some leftover still in the preferences

@github-project-automation github-project-automation bot moved this from High priority to Done in Prioritization Apr 3, 2024
@Doc73
Copy link
Contributor Author

Doc73 commented Apr 3, 2024

@Siedlerchr
I did my tests in my desktop with Debian Stable. Version 5.13 doesn't start, but the version of https://builds.jabref.org/main/ works fine.
Many thanks!

@koppor koppor changed the title Not starting in Debian Sid Custom entry types might crash JabRef on start Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[outdated] type: bug Confirmed bugs or reports that are very likely to be bugs
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants