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

Can't connect to shared database #8944

Open
2 tasks done
falschgeldkind opened this issue Jul 1, 2022 · 12 comments
Open
2 tasks done

Can't connect to shared database #8944

falschgeldkind opened this issue Jul 1, 2022 · 12 comments

Comments

@falschgeldkind
Copy link
Contributor

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

  • 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. 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 org.jabref.merged.module@5.7.127/org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.postgresql.core.ConnectionFactory.openConnection(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.postgresql.jdbc.PgConnection.<init>(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.postgresql.Driver.makeConnection(Unknown Source)
        at org.jabref.merged.module@5.7.127/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 org.jabref@5.7.127/org.jabref.logic.shared.DBMSConnection.<init>(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.shared.SharedDatabaseUIManager.openNewSharedDatabaseTab(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.shared.SharedDatabaseLoginDialogViewModel.openSharedDatabase(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.shared.SharedDatabaseLoginDialogViewModel.openDatabase(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.shared.SharedDatabaseLoginDialogView.openDatabase(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.shared.SharedDatabaseLoginDialogView.lambda$new$0(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.util.ControlHelper.lambda$setAction$0(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventHandler$NormalEventFilterRecord.handleCapturingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventHandler.dispatchCapturingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.event.Event.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.Node.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.control.Button.fire(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.scene.control.inputmap.InputMap.handle(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.event.Event.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.Scene.processMouseEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.Application.enterNestedEventLoop(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.EventLoop.enter(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.stage.Stage.showAndWait(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.control.HeavyweightDialog.showAndWait(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.control.Dialog.showAndWait(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.JabRefDialogService.showCustomDialogAndWait(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.shared.ConnectToSharedDatabaseCommand.execute(Unknown Source)
        at org.jabref@5.7.127/org.jabref.gui.actions.JabRefAction.lambda$new$3(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.controlsfx.control.action.Action.handle(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.controlsfx.control.action.Action.handle(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.event.Event.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.control.MenuItem.fire(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.event.Event.fireEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.Scene.processMouseEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at org.jabref.merged.module@5.7.127/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at org.jabref.merged.module@5.7.127/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 org.jabref.merged.module@5.7.127/org.postgresql.core.PGStream.createSocket(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.postgresql.core.PGStream.<init>(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(Unknown Source)
        ... 115 more

@falschgeldkind
Copy link
Contributor Author

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

@Siedlerchr
Copy link
Member

Hm:
The error indicates some timeout/general connection problem.
We recently upgraded to the new driver 42.4.0 in 7c4e22c.
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 org.jabref.merged.module@5.7.127/org.postgresql.core.PGStream.createSocket(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.postgresql.core.PGStream.<init>(Unknown Source)
        at org.jabref.merged.module@5.7.127/org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(Unknown

@Siedlerchr Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Jul 1, 2022
@falschgeldkind
Copy link
Contributor Author

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

@ThiloteE
Copy link
Member

ThiloteE commented Jul 5, 2022

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 ...

@falschgeldkind
Copy link
Contributor Author

falschgeldkind commented Jul 5, 2022

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.

@ThiloteE
Copy link
Member

ThiloteE commented Jul 5, 2022

To do:

@Siedlerchr
Copy link
Member

Siedlerchr commented Jul 5, 2022

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/

@falschgeldkind
Copy link
Contributor Author

falschgeldkind commented Jul 6, 2022

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
Copy link
Contributor Author

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

@falschgeldkind
Copy link
Contributor Author

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.

@Siedlerchr
Copy link
Member

Siedlerchr commented Jul 6, 2022

It might be a JDBC or postgres issue thing.

@falschgeldkind
Copy link
Contributor Author

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

@ThiloteE ThiloteE added os: windows and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Jul 13, 2022
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