Skip to content

Database corruption due to incorrect adding and deleting subgroups in a group if their number exceeds 15 #2600

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

Closed
ph0boss opened this issue Mar 2, 2017 · 7 comments
Assignees
Labels
component: groups [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs

Comments

@ph0boss
Copy link

ph0boss commented Mar 2, 2017

JabRef version on 3.8.2

Steps to reproduce:

  1. Create an empty database
  2. Create a group (no need to add anything to it)
  3. Add 16 subgroups to this group. The first 15 subgroups are added without a problem. After adding the 16 subgroup you will notice a visual bug - an empty space above the 16 subgroup.
  4. Remove the 16th subgroup.
  5. The database is broken and jabref will not start, trying to open this database.
  6. Console output when starting jabref after the database became corrupt is below.
    Please, help me restore my database, I've been working on it for 4 months.

java -jar '/home/ph0boss/portablesoftlinux/Jabref/JabRef-3.8.2.jar'
13:43:22.015 [AWT-EventQueue-0] INFO net.sf.jabref.logic.importer.OpenDatabase - Opening: /home/ph0boss/Downloads/temp/arst.bib
13:43:22.104 [AWT-EventQueue-0] ERROR net.sf.jabref.FallbackExceptionHandler - Uncaught exception Occurred in Thread[AWT-EventQueue-0,6,main]
java.util.NoSuchElementException: No value present
at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_121]
at net.sf.jabref.logic.importer.util.GroupsParser.importGroups(GroupsParser.java:51) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.util.MetaDataParser.parse(MetaDataParser.java:63) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.util.MetaDataParser.parse(MetaDataParser.java:33) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.fileformat.BibtexParser.parseFileContent(BibtexParser.java:218) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.fileformat.BibtexParser.parse(BibtexParser.java:150) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(BibtexImporter.java:70) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.Importer.importDatabase(Importer.java:65) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(BibtexImporter.java:62) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.OpenDatabase.loadDatabase(OpenDatabase.java:64) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.logic.importer.OpenDatabase.loadDatabase(OpenDatabase.java:43) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.JabRefGUI.openLastEditedDatabases(JabRefGUI.java:210) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.JabRefGUI.openWindow(JabRefGUI.java:94) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.JabRefGUI.(JabRefGUI.java:63) ~[JabRef-3.8.2.jar:?]
at net.sf.jabref.JabRefMain.lambda$start$1(JabRefMain.java:128) ~[JabRef-3.8.2.jar:?]
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) ~[?:1.8.0_121]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) ~[?:1.8.0_121]
at java.awt.EventQueue.access$500(EventQueue.java:97) ~[?:1.8.0_121]
at java.awt.EventQueue$3.run(EventQueue.java:709) ~[?:1.8.0_121]
at java.awt.EventQueue$3.run(EventQueue.java:703) ~[?:1.8.0_121]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_121]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) ~[?:1.8.0_121]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) ~[?:1.8.0_121]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [?:1.8.0_121]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_121]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_121]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_121]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_121]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_121]

Example of a broken database

% Encoding: UTF-8

@comment{jabref-meta: databaseType:bibtex;}

@comment{jabref-meta: groupstree:
0 AllEntriesGroup:;
1 ExplicitGroup:12;0;;
2 ExplicitGroup:1;0;;
2 ExplicitGroup:2;0;;
2 ExplicitGroup:3;0;;
2 ExplicitGroup:4;0;;
2 ExplicitGroup:5;0;;
2 ExplicitGroup:6;0;;
2 ExplicitGroup:7;0;;
2 ExplicitGroup:8;0;;
2 ExplicitGroup:9;0;;
2 ExplicitGroup:10;0;;
2 ExplicitGroup:11;0;;
2 ExplicitGroup:12;0;;
2 ExplicitGroup:13;0;;
2 ExplicitGroup:14;0;;
2 ExplicitGroup:15;0;;
0 ExplicitGroup:16;0;;
2 ExplicitGroup:17;0;;
}

@Siedlerchr
Copy link
Member

Hi, yes I can reproduce your problem. I will try to look into that

@Siedlerchr
Copy link
Member

I fixed the import/opening, but your database has to be fixed as well: You are apparently using the old? groups format without the slashes.
So I took your group code and manually converted it to new structure:
The hierarchy is the same.

@Comment{jabref-meta: groupstree:
0 AllEntriesGroup:;
1 ExplicitGroup:12\;0\;;
2 ExplicitGroup:1\;0\;;
2 ExplicitGroup:2\;0\;;
2 ExplicitGroup:3\;0\;;
2 ExplicitGroup:4\;0\;;
2 ExplicitGroup:5\;0\;;
2 ExplicitGroup:6\;0\;;
2 ExplicitGroup:7\;0\;;
2 ExplicitGroup:8\;0\;;
2 ExplicitGroup:9\;0\;;
2 ExplicitGroup:10\;0\;;
2 ExplicitGroup:11\;0\;;
2 ExplicitGroup:12\;0\;;
2 ExplicitGroup:13\;0\;;
2 ExplicitGroup:14\;0\;;
2 ExplicitGroup:15\;0\;;
0 ExplicitGroup:16\;0\;;
2 ExplicitGroup:17\;0\;;
}

@Siedlerchr
Copy link
Member

You can try this out in a couple of minutes with the dev version from here:
https://builds.jabref.org/subGroups/

As we are currently switching to a new groups interface, the fully functionality it not yet implemented.

@ph0boss
Copy link
Author

ph0boss commented Mar 3, 2017

Thanks for your help! The database published here was just for example. My actual database was too big to be sent here and it is using slashes. I solved the problem by simply deleting the subgroup that was causing the problem and added it in GUI as a subgroup in another group.
As for the dev version, it didn't start. Console output:

Error: Could not find or load main class org.jabref.JabRefMain

I'm using fedora 25, openjdk version "1.8.0_121" if it helps

@Siedlerchr
Copy link
Member

Okay, glad that it worked out now for you!.
As the dev version is using the new GUI technology JavaFX, you may need to install openjfx which provides the additional gui libraries.
Alternative you could (we recommend it) install the oracle java 8 jdk/jre.

@ph0boss
Copy link
Author

ph0boss commented Mar 4, 2017

That worked well as far as I tried. At least adding and removing the 16th entry went smoothly. Thanks for fixing!

@Siedlerchr
Copy link
Member

Fixed with #2611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: groups [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs
Projects
None yet
Development

No branches or pull requests

2 participants