jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Can't connect to shared database

Open falschgeldkind opened this issue 4 years ago • 12 comments

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

No response

Checked with the latest development build

  • [X] I made a backup of my libraries before testing the latest development version.
  • [X] I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Open jabref
  2. Click on Connect to shared Database
  3. Wait a couple of seconds
  4. get an error

Appendix

On one windows devices it DID work, on two others it didn't. To test if it's the firewall blocking the connection I deactivated it but to no avail. I tried to directly connect to the database (from an windows machine, where jabref was not able to connect) via Datagrip and that worked. So it seems like it is a bug in Jabref.. Do you have any idea what the problem might be? It may be a bug, but why would it work on one windows machine but not the other ones?

Build date 29.06.2022

Log File
Stacktrace:

Connection error
The connection attempt failed.


org.postgresql.util.PSQLException: The connection attempt failed.
        at [email protected]/org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Unknown Source)
        at [email protected]/org.postgresql.core.ConnectionFactory.openConnection(Unknown Source)
        at [email protected]/org.postgresql.jdbc.PgConnection.<init>(Unknown Source)
        at [email protected]/org.postgresql.Driver.makeConnection(Unknown Source)
        at [email protected]/org.postgresql.Driver.connect(Unknown Source)
        at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
        at [email protected]/org.jabref.logic.shared.DBMSConnection.<init>(Unknown Source)
        at [email protected]/org.jabref.gui.shared.SharedDatabaseUIManager.openNewSharedDatabaseTab(Unknown Source)
        at [email protected]/org.jabref.gui.shared.SharedDatabaseLoginDialogViewModel.openSharedDatabase(Unknown Source)
        at [email protected]/org.jabref.gui.shared.SharedDatabaseLoginDialogViewModel.openDatabase(Unknown Source)
        at [email protected]/org.jabref.gui.shared.SharedDatabaseLoginDialogView.openDatabase(Unknown Source)
        at [email protected]/org.jabref.gui.shared.SharedDatabaseLoginDialogView.lambda$new$0(Unknown Source)
        at [email protected]/org.jabref.gui.util.ControlHelper.lambda$setAction$0(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventHandler$NormalEventFilterRecord.handleCapturingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchCapturingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at [email protected]/javafx.event.Event.fireEvent(Unknown Source)
        at [email protected]/javafx.scene.Node.fireEvent(Unknown Source)
        at [email protected]/javafx.scene.control.Button.fire(Unknown Source)
        at [email protected]/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Unknown Source)
        at [email protected]/com.sun.javafx.scene.control.inputmap.InputMap.handle(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at [email protected]/javafx.event.Event.fireEvent(Unknown Source)
        at [email protected]/javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at [email protected]/javafx.scene.Scene.processMouseEvent(Unknown Source)
        at [email protected]/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
        at [email protected]/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at [email protected]/com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at [email protected]/com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
        at [email protected]/com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(Unknown Source)
        at [email protected]/com.sun.glass.ui.Application.enterNestedEventLoop(Unknown Source)
        at [email protected]/com.sun.glass.ui.EventLoop.enter(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(Unknown Source)
        at [email protected]/javafx.stage.Stage.showAndWait(Unknown Source)
        at [email protected]/javafx.scene.control.HeavyweightDialog.showAndWait(Unknown Source)
        at [email protected]/javafx.scene.control.Dialog.showAndWait(Unknown Source)
        at [email protected]/org.jabref.gui.JabRefDialogService.showCustomDialogAndWait(Unknown Source)
        at [email protected]/org.jabref.gui.shared.ConnectToSharedDatabaseCommand.execute(Unknown Source)
        at [email protected]/org.jabref.gui.actions.JabRefAction.lambda$new$3(Unknown Source)
        at [email protected]/org.controlsfx.control.action.Action.handle(Unknown Source)
        at [email protected]/org.controlsfx.control.action.Action.handle(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at [email protected]/javafx.event.Event.fireEvent(Unknown Source)
        at [email protected]/javafx.scene.control.MenuItem.fire(Unknown Source)
        at [email protected]/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(Unknown Source)
        at [email protected]/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at [email protected]/javafx.event.Event.fireEvent(Unknown Source)
        at [email protected]/javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at [email protected]/javafx.scene.Scene.processMouseEvent(Unknown Source)
        at [email protected]/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
        at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
        at [email protected]/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at [email protected]/com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at [email protected]/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at [email protected]/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketTimeoutException: Connect timed out
        at java.base/java.net.SocksSocketImpl.readSocksReply(Unknown Source)
        at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
        at java.base/java.net.Socket.connect(Unknown Source)
        at [email protected]/org.postgresql.core.PGStream.createSocket(Unknown Source)
        at [email protected]/org.postgresql.core.PGStream.<init>(Unknown Source)
        at [email protected]/org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(Unknown Source)
        ... 115 more

falschgeldkind avatar Jul 01 '22 13:07 falschgeldkind

It seems like there are no version differences between one machine that it worked on and another that it didn't work on...

Details for the Windows Machine that had NO issues:

JabRef 5.7--2022-06-29--92b7d7a Windows 10 10.0 amd64 Java 18.0.1 JavaFX 18+12

Edition Windows 10 Pro Version 21H1 Installiert am ‎24.‎09.‎2021 Betriebssystembuild 19043.1766 Leistung Windows Feature Experience Pack 120.2212.4180.0

Details for the Windows Machine that had issues:

JabRef 5.7--2022-06-29--92b7d7a Windows 10 10.0 amd64 Java 18.0.1 JavaFX 18+12

Edition Windows 10 Pro Version 21H1 Installiert am ‎09.‎09.‎2021 Betriebssystembuild 19043.1766 Leistung Windows Feature Experience Pack 120.2212.4180.0

falschgeldkind avatar Jul 01 '22 14:07 falschgeldkind

Hm: The error indicates some timeout/general connection problem. We recently upgraded to the new driver 42.4.0 in 7c4e22c4ca6d12973696f10bc1985f43a14d1bf5. Does the 5.6 release work? https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md

Caused by: java.net.SocketTimeoutException: Connect timed out
        at java.base/java.net.SocksSocketImpl.readSocksReply(Unknown Source)
        at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
        at java.base/java.net.Socket.connect(Unknown Source)
        at [email protected]/org.postgresql.core.PGStream.createSocket(Unknown Source)
        at [email protected]/org.postgresql.core.PGStream.<init>(Unknown Source)
        at [email protected]/org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(Unknown

Siedlerchr avatar Jul 01 '22 14:07 Siedlerchr

is #8788 fixed in 5.6? if so I can try that.

falschgeldkind avatar Jul 05 '22 16:07 falschgeldkind

Edit: The fix for 8788 was after the release of 5.6, so if it is broken in 5.7, but not broken in 5.6 ...

ThiloteE avatar Jul 05 '22 17:07 ThiloteE

i did try all those things i noted above in the current 5.7 development (main) build at that date. It wouldn't be possible in 5.6 with that database because of #8788 since it hat too many entries.

falschgeldkind avatar Jul 05 '22 17:07 falschgeldkind

To do:

  • [x] Test a90ee23410fabbef12c8114885f2cda1c226de9d

ThiloteE avatar Jul 05 '22 18:07 ThiloteE

I tested locally with a Postgres install here on my mac and that works fine. The error you posted indicates a general connection error to the database. Some network problems probably.

Tested both JabRef 5.7--2022-06-20--41edd28 and the latest dev snapshot from yesterday

Edit// Can you connect with a tool like pgAdmin? If the DB is reachable with that one? https://www.pgadmin.org/

Siedlerchr avatar Jul 05 '22 18:07 Siedlerchr

Yes I tried that. I used Datagrip by netbrains to check if I at least can connect to the postgres server locally as well as on a machine where jabref couldn't connect. And I in fact was able to connect both times.

It may be that Datagrip does lookup the hostname when I connect to the database via the IP. Which would mask that bug/error. I will try that with another tool again tomorrow.

falschgeldkind avatar Jul 06 '22 07:07 falschgeldkind

Weirdly it seems to work if I connect with the hostname of the postgres server but not with the respective IP...

falschgeldkind avatar Jul 06 '22 12:07 falschgeldkind

I looked into the code and thought about it very hard. I believe it's either an issue with the postgres server configuration, the network, a bug in JDBC or the use of it in Jabref.

falschgeldkind avatar Jul 06 '22 19:07 falschgeldkind

It might be a JDBC or postgres issue thing.

Siedlerchr avatar Jul 06 '22 19:07 Siedlerchr

this bug seems to only exist in the Windows version of jabref. Connecting via IP as well as via Hostname works fine on Linux machines... Strange

falschgeldkind avatar Jul 07 '22 13:07 falschgeldkind