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

Password for shared PostgreSQL database will not be remembered #6869

Closed
1 task done
m-mauersberger opened this issue Sep 4, 2020 · 4 comments · Fixed by #7154 or #7364
Closed
1 task done

Password for shared PostgreSQL database will not be remembered #6869

m-mauersberger opened this issue Sep 4, 2020 · 4 comments · Fixed by #7154 or #7364

Comments

@m-mauersberger
Copy link
Contributor

JabRef version 5.2--2020-09-03--1283f9f on openSUSE Leap 15.1.

Steps to reproduce the behavior:

  1. Open a shared (PostgreSQL) database and tick "Remember Password" (without "Use SSL").
  2. Reopen the database.
  3. The password has not been remembered and there are TimeOut messages for SSLSocket on the console (see log files).

Do you have an idea where the problem is?

Credentials input pane
%d [%thread] %-5level %logger - %msg%n javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
  at com.sun.crypto.provider.CipherCore.unpad(Unknown Source) ~[?:?]
  at com.sun.crypto.provider.CipherCore.fillOutputBuffer(Unknown Source) ~[?:?]
  at com.sun.crypto.provider.CipherCore.doFinal(Unknown Source) ~[?:?]
  at com.sun.crypto.provider.AESCipher.engineDoFinal(Unknown Source) ~[?:?]
  at javax.crypto.Cipher.doFinal(Unknown Source) ~[?:?]
  at org.jabref.logic.shared.security.Password.decrypt(Unknown Source) ~[org.jabref:?]
  at org.jabref.gui.shared.SharedDatabaseLoginDialogViewModel.applyPreferences(Unknown Source) ~[org.jabref:?]
  at org.jabref.gui.shared.SharedDatabaseLoginDialogViewModel.<init>(Unknown Source) ~[org.jabref:?]
  at org.jabref.gui.shared.SharedDatabaseLoginDialogView.initialize(Unknown Source) ~[org.jabref:?]
  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
  at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
  at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source) ~[org.jabref.merged.module:?]
  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
  at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
  at com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.fxml.FXMLLoader.loadImpl(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.fxml.FXMLLoader.loadImpl(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.fxml.FXMLLoader.load(Unknown Source) ~[org.jabref.merged.module:?]
  at com.airhacks.afterburner.views.ViewLoader.load(Unknown Source) ~[org.jabref.merged.module:?]
  at org.jabref.gui.shared.SharedDatabaseLoginDialogView.<init>(Unknown Source) ~[org.jabref:?]
  at org.jabref.gui.shared.ConnectToSharedDatabaseCommand.execute(Unknown Source) ~[org.jabref:?]
  at org.jabref.gui.actions.JabRefAction.lambda$new$2(Unknown Source) ~[org.jabref:?]
  at org.controlsfx.control.action.Action.handle(Unknown Source) ~[org.jabref.merged.module:?]
  at org.controlsfx.control.action.Action.handle(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.event.Event.fireEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.scene.control.MenuItem.fire(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.event.Event.fireEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.scene.Scene$MouseHandler.process(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.scene.Scene.processMouseEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) ~[org.jabref.merged.module:?]
  at java.security.AccessController.doPrivileged(Unknown Source) ~[?:?]
  at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.glass.ui.View.handleMouseEvent(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.glass.ui.View.notifyMouse(Unknown Source) ~[org.jabref.merged.module:?]
  at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) ~[org.jabref.merged.module:?]
  at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source) ~[org.jabref.merged.module:?]
  at java.lang.Thread.run(Unknown Source) [?:?]

When running (every 500 ms as defined in `PostgresSQLNotificationListener`)
javax.net.ssl|WARNING|21|JabRef CachedThreadPool|2020-09-04 10:39:24.818 CEST|null:-1|handling exception (
"throwable" : {
java.net.SocketTimeoutException: Read timed out
	at java.base/sun.nio.ch.NioSocketImpl.timedRead(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl.implRead(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl.read(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl$1.read(Unknown Source)
	at java.base/java.net.Socket$SocketInputStream.read(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)
	at org.jabref.merged.module@5.2.60/org.postgresql.core.VisibleBufferedInputStream.readMore(Unknown Source)
	at org.jabref.merged.module@5.2.60/org.postgresql.core.VisibleBufferedInputStream.ensureBytes(Unknown Source)
	at org.jabref.merged.module@5.2.60/org.postgresql.core.PGStream.hasMessagePending(Unknown Source)
	at org.jabref.merged.module@5.2.60/org.postgresql.core.v3.QueryExecutorImpl.processNotifies(Unknown Source)
	at org.jabref.merged.module@5.2.60/org.postgresql.jdbc.PgConnection.getNotifications(Unknown Source)
	at org.jabref.merged.module@5.2.60/org.postgresql.jdbc.PgConnection.getNotifications(Unknown Source)
	at org.jabref@5.2.60/org.jabref.logic.shared.listener.PostgresSQLNotificationListener.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)}

)

socketTimeOut_SSL.log

@koppor
Copy link
Member

koppor commented Sep 21, 2020

My idea won't help you much: Somewhere in the preferences. I think, it is org.jabref.logic.shared.prefs.SharedDatabasePreferences.

The JabRef team decided to remove any preference storing related tests, because tests should not change the developer's productive settings.

Are the connection properties themselves remembered?

I see following in the code - it could be that while switching from Java 8 to a higher version, the encryption algorithms might have get lost. - Do you see something in the log file?

        try {
            setPassword(new Password(properties.getPassword().toCharArray(), properties.getUser()).encrypt());
        } catch (GeneralSecurityException | UnsupportedEncodingException e) {
            LOGGER.error("Could not store the password due to encryption problems.", e);
        }

@koppor
Copy link
Member

koppor commented Sep 22, 2020

Maybe because of the changes at #6853?

@tobiasdiez
Copy link
Member

This should be fixed in the latest development version. Could you please check the build from http://builds.jabref.org/master/. Thanks! Please remember to make a backup of your library before trying-out this version.

@bazjo
Copy link
Contributor

bazjo commented Jan 18, 2021

This still was an issue in the latest release, should be finally fixed with #7364

@koppor koppor moved this to Done in Prioritization Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
4 participants