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

The "Remove subgroups" command leaves entries with non-existing groups #7556

Closed
sauliusg opened this issue Mar 21, 2021 · 11 comments
Closed

Comments

@sauliusg
Copy link
Contributor

JabRef version master commit d31ef4d on Linuxmint-20.1

JabRef 100.0.0
Linux 5.8.0-45-generic amd64
Java 14.0.2
JavaFX 16+8

Steps to reproduce the behavior:

  1. Load library 'groups.bib' from the attached 'groups.zip' file;
    groups.zip

  2. Open the groups interface; Left click on "Programming" group to seelct it; right-click on the "Programming" group;

  3. Pick "Remove subgroups", confirm the action;

  4. Hit "Ctrl-S" to save the file.

The the saved file, the "Techniques" group is gone, but the entry that belonged to it still mentions the (now non-existent) group "Techniques":

saulius@starta group-deletion-not-saved/ $ git diff
diff --git a/bugs/group-deletion-not-saved/groups.bib b/bugs/group-deletion-not-saved/groups.bib
index f10fa9002..2a4fd124e 100644
--- a/bugs/group-deletion-not-saved/groups.bib
+++ b/bugs/group-deletion-not-saved/groups.bib
@@ -18,7 +18,6 @@
 0 AllEntriesGroup:;
 1 StaticGroup:Computer science\;2\;1\;0x8a8a8aff\;\;\;;
 2 StaticGroup:Programming\;2\;1\;0x8a8a8aff\;\;\;;
-3 StaticGroup:Techniques\;2\;1\;0x8a8a8aff\;\;\;;
 1 StaticGroup:Chemistry\;2\;1\;0x8a8a8aff\;\;\;;
 2 StaticGroup:Chemiinformatics\;2\;1\;0x8a8a8aff\;\;\;;
 }
saulius@starta group-deletion-not-saved/ $ grep -P 'groups\s*=' groups.bib
  groups    = {Techniques},

In contrast, if I select the "Techniques" group itself and click "Remove group and subgroups", the "Techniques" label is removed from the entries "groups = {...}" field (as expected).

Log File
Paste an excerpt of your log file here
@ThiloteE
Copy link
Member

It has been a while. Can you still reproduce this @sauliusg? I tried with

JabRef 5.6--2022-04-25--5c9d898
Linux 5.4.0-110-generic amd64
Java 17.0.2
JavaFX 18+12

and was not able to reproduce. Should we close?

@sauliusg
Copy link
Contributor Author

I'm getting errors when trying to compile the new JabRef trung (commit e3094ac, master branch):

/home/saulius/src/jabref/src/main/java/org/jabref/gui/logging/GuiAppender.java:14: error: cannot find symbol
@Plugin(name = "GuiAppender", category = "Core", elementType = "appender", printObject = true)
        ^
  symbol:   method name()
  location: @interface Plugin
/home/saulius/src/jabref/src/main/java/org/jabref/gui/logging/GuiAppender.java:14: error: cannot find symbol
@Plugin(name = "GuiAppender", category = "Core", elementType = "appender", printObject = true)
                              ^
  symbol:   method category()
  location: @interface Plugin
/home/saulius/src/jabref/src/main/java/org/jabref/gui/logging/ApplicationInsightsAppender.java:16: error: cannot find symbol
@Plugin(name = "OurApplicationInsightsAppender", category = "Core", elementType = "appender", printObject = true)
        ^
  symbol:   method name()
  location: @interface Plugin
/home/saulius/src/jabref/src/main/java/org/jabref/gui/logging/ApplicationInsightsAppender.java:16: error: cannot find symbol
@Plugin(name = "OurApplicationInsightsAppender", category = "Core", elementType = "appender", printObject = true)
                                                 ^
  symbol:   method category()
  location: @interface Plugin
/home/saulius/src/jabref/src/main/java/module-info.java:46: error: package org.jabref.gui.logging.plugins does not exist
            with org.jabref.gui.logging.plugins.Log4jPlugins;
                                               ^
/home/saulius/src/jabref/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java:85: error: JabRefItemDataProvider is not abstract and does not override abstract method getIds() in ItemDataProvider
    private static class JabRefItemDataProvider implements ItemDataProvider {
                   ^
/home/saulius/src/jabref/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java:127: error: getIds() in JabRefItemDataProvider cannot implement getIds() in ItemDataProvider
        public String[] getIds() {
                        ^
  return type String[] is not compatible with Collection<String>
/home/saulius/src/jabref/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java:126: error: method does not override or implement a method from a supertype
        @Override

Did the project switch the the new compiler? Mine is 17.0 ...:

saulius@tasmanijos-velnias jabref/ $ javac --version
javac 17.0.1

@Siedlerchr
Copy link
Member

Yes, we upgraded to jdk18 recently. Your commit looks odd, the branch has also changed a while ago. It's main

@sauliusg
Copy link
Contributor Author

sauliusg commented May 16, 2022

Yes, we upgraded to jdk18 recently.
Thanks for the info. Updated to the jdk18, but still problems (with gradle?):

saulius@tasmanijos-velnias jabref/ $ git branch -av
* main                c38d18b Fix notifications that overlap task bar (#8775)
  remotes/origin/HEAD -> origin/main
  remotes/origin/main c38d18b Fix notifications that overlap task bar (#8775)
saulius@tasmanijos-velnias jabref/ $ ./gradlew assemble

> Configure project :
Project : => 'org.jabref' Java module

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> error: invalid source release: 18

/.../

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

I'm confused if my Gradle is too old, or something with java is wrong, or maybe JAVA_HOME... I'm still searching, but if you have a hint this would be greatly appreciated. :)

UPDATE:

Found the way to compile:

  503  export JAVA_HOME=/usr/lib/jvm/jdk-18
  504  ./gradlew assemble
  505  ./gradlew jlink

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 3m 20s
17 actionable tasks: 5 executed, 12 up-to-date

The missing piece of the puzzle was exporting the correct JAVA_HOME env. variable value; for some reason installing jdk-18_linux-x64_bin.deb did not set this variable.

Now checking if I can reproduce the issue with the new code...

Your commit looks odd, the branch has also changed a while ago. It's main

Yes, that was my typo – sorry – indeed it is now main, I just typed the name that I am used to. The commit number should be unique anyway?

@sauliusg
Copy link
Contributor Author

sauliusg commented May 16, 2022

It has been a while. Can you still reproduce this @sauliusg? I tried with

JabRef 5.6--2022-04-25--5c9d898 Linux 5.4.0-110-generic amd64 Java 17.0.2 JavaFX 18+12

and was not able to reproduce. Should we close?

An attempt to reproduce the situation triggered an "Uncaught exception occurred ..." -- "Index out of bounds ..." situation; see the attached screen shot:
screenshot_2022-05-16_15-07-41

After trying to see the list of all publications I get an empty list; trying to save the database triggers another "Index out of bounds" exception:

screenshot_2022-05-16_15-10-49

The database was partially saved (only BibTeX entry was in the file; the encoding header and the group list was gone).

My setup was:

JabRef 100.0.0
Linux 5.4.0-73-generic amd64 
Java 18.0.1.1 
JavaFX *unknown*

saulius@tasmanijos-velnias jabref/ $ git log --oneline -1
c38d18b (HEAD -> main, origin/main, origin/HEAD) Fix notifications that overlap task bar (#8775)

saulius@tasmanijos-velnias jabref/ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 20.1
Release:	20.1
Codename:	ulyssa

saulius@tasmanijos-velnias jabref/ $ uname -a
Linux tasmanijos-velnias 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

saulius@tasmanijos-velnias jabref/ $ javac --version 
javac 18.0.1.1

saulius@tasmanijos-velnias jabref/ $ java --version 
java 18.0.1.1 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

Command history (all commands reported success):
  190  git clone --depth=10 https://github.com/JabRef/jabref
  191  cd jabref/
  207  sudo dpkg -i ~/down/jdk-18/jdk-18_linux-x64_bin.deb
  263  sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-18/bin/javac 1
  264  sudo update-alternatives --config javac
  503  export JAVA_HOME=/usr/lib/jvm/jdk-18
  504  ./gradlew assemble
  505  ./gradlew jlink
  515  unzip /home/saulius/groups.zip 
  519  ./gradlew build # just to check if this runs successfully now...
  523  ./gradlew run 

Open 'groups.bib' via the 'File' menu.

@sauliusg
Copy link
Contributor Author

On the second attempt, Jabref worked as expected, removing the subgroup from both the group list and the BibTeX entry.

@Siedlerchr
Copy link
Member

Siedlerchr commented May 16, 2022

The database was partially saved (only BibTeX entry was in the file; the encoding header and the group list was gone).

@sauliusg Thanks for the feedback. Which version of JabRef was your bib file previously created?

The encoding header is no longer written (JabRef by default uses utf-8 now)

PS: If you don't want to compile from source, you can get the prebuilt binaries always here for the latest commit https://builds.jabref.org/main/

@sauliusg
Copy link
Contributor Author

The database was partially saved (only BibTeX entry was in the file; the encoding header and the group list was gone).

@sauliusg Thanks for the feedback. Which version of JabRef was your bib file previously created?

I am pretty sure that I created it on the original version for which I reported the bug:

JabRef version master commit https://github.com/JabRef/jabref/commit/d31ef4dc71eb1692af84a36b1e9e747c2384dc45 on Linuxmint-20.1

JabRef 100.0.0
Linux 5.8.0-45-generic amd64
Java 14.0.2
JavaFX 16+8

The encoding header is no longer written (JabRef by default uses utf-8 now)

PS: If you don't want to compile from source, you can get the prebuilt binaries always here for the latest commit https://builds.jabref.org/main/

Thanks, I could try it as well, but now the compilation worked, so I just run it (it is always good when you have a version built from source ... :).

@sauliusg
Copy link
Contributor Author

sauliusg commented May 16, 2022

The encoding header is no longer written (JabRef by default uses utf-8 now)

Thanks for letting me know. We also use utf-8 throughout. The problem of course will be when people will try to open that database with older JabRef versions...

As I have mentioned, on the second (and 4 more) Jabref restart attempts the "Index out of bound ..." errors do not happen, and the database is saved correctly (without the encoding, which is intended as I understand now).

Thus the bugs were transient... So far can not reproduce them. Possibly they were related to the old JabRef configuration, or behaps because of some thread synchronisation issues... Seems very difficult to reproduce.

@sauliusg
Copy link
Contributor Author

sauliusg commented May 16, 2022

OK, I can confirm that the bug is gone, both the the compiled version and in the ore-compiled version from JabRef-5.7-portable_linux.tar.gz. So we can indeed close this issue.

I am a bit worried of course about the initial thread glitch and "Out of Index" exceptions. But I can not reproduce them now; it could have also been related to the fact that I have just changed the Java version, so there were mixed libraries loaded into RAM ir something like this. Unpacking my old JabRef (~/.java) configurations does not cause the bug to reappear, so it's not just my old configuration from JabRef 5.2. that caused it,

@ThiloteE
Copy link
Member

Closing this then :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants