question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set as Default for Postgres Databases fails

See original GitHub issue

System information:

  • Windows 10 Pro Version 2004 (Build 19041.84)
  • 6.3.5.202002151353

Connection specification:

  • PostgreSql 9.6
  • PostgreSQL standard driver
  • Do you use tunnels or proxies (SSH, SOCKS, etc) : SSH

Describe the problem you’re observing:

Switching to another database is clumsy and fails most of the time with error below:

SQL Error [08001]: Connection to 127.0.0.1:15045 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

However, there is no connection issue and it was working fine on previous version. That was 6.2.4 or something.

Steps to reproduce, if exist:

Include any warning/errors/backtraces from the logs

org.postgresql.util.PSQLException: Connection to 127.0.0.1:16042 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
	at org.postgresql.Driver$ConnectThread.getResult(Driver.java:403)
	at org.postgresql.Driver.connect(Driver.java:261)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.lambda$0(JDBCDataSource.java:157)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:174)
	at org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource.openConnection(PostgreDataSource.java:311)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext.connect(JDBCExecutionContext.java:91)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext.connect(JDBCExecutionContext.java:80)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext.getConnection(JDBCExecutionContext.java:181)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCConnectionImpl.getOriginal(JDBCConnectionImpl.java:60)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCConnectionImpl.cancelBlock(JDBCConnectionImpl.java:693)
	at org.jkiss.dbeaver.model.runtime.BlockCanceler.cancelBlock(BlockCanceler.java:36)
	at org.jkiss.dbeaver.model.runtime.AbstractJob$JobCanceler.run(AbstractJob.java:221)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.net.ConnectException: Connection refused: connect
	at java.base/java.net.PlainSocketImpl.waitForConnect(Native Method)
	at java.base/java.net.PlainSocketImpl.socketConnect(Unknown Source)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
	at java.base/java.net.Socket.connect(Unknown Source)
	at org.postgresql.core.PGStream.<init>(PGStream.java:69)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:158)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
	at org.postgresql.Driver.makeConnection(Driver.java:452)
	at org.postgresql.Driver.access$100(Driver.java:61)
	at org.postgresql.Driver$ConnectThread.run(Driver.java:362)
	at java.base/java.lang.Thread.run(Unknown Source)
!SUBENTRY 3 org.jkiss.dbeaver.model 4 0 2020-02-19 11:41:40.873
!MESSAGE Connection refused: connect
!STACK 0
java.net.ConnectException: Connection refused: connect
	at java.base/java.net.PlainSocketImpl.waitForConnect(Native Method)
	at java.base/java.net.PlainSocketImpl.socketConnect(Unknown Source)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
	at java.base/java.net.Socket.connect(Unknown Source)
	at org.postgresql.core.PGStream.<init>(PGStream.java:69)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:158)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
	at org.postgresql.Driver.makeConnection(Driver.java:452)
	at org.postgresql.Driver.access$100(Driver.java:61)
	at org.postgresql.Driver$ConnectThread.run(Driver.java:362)
	at java.base/java.lang.Thread.run(Unknown Source)
!SESSION 2020-02-19 11:43:06.566 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.5
java.vendor=AdoptOpenJDK
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86_64

!ENTRY org.eclipse.jface 2 0 2020-02-19 11:43:22.529
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2020-02-19 11:43:22.529
!MESSAGE A conflict occurred for CTRL+N:
Binding(CTRL+N,
	ParameterizedCommand(Command(org.eclipse.ui.newWizard,New,
		Open the New item wizard,
		Category(org.eclipse.ui.category.file,File,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@3da55998,
		[Parameter(newWizardId,New Wizard,null,true)],,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+N,
	ParameterizedCommand(Command(org.jkiss.dbeaver.core.sql.editor.open,SQL Editor,
		Open SQL editor (existing or new),
		Category(org.jkiss.dbeaver.core.database,Connection,Database Connection Commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@40ebb56,
		,,true),null),
	org.jkiss.dbeaver.defaultKeyScheme,
	org.jkiss.dbeaver.ui.perspective,,,user)
Binding(CTRL+N,
	ParameterizedCommand(Command(org.jkiss.dbeaver.core.sql.editor.create,New SQL Editor,
		Open new SQL editor (create new script),
		Category(org.jkiss.dbeaver.core.database,Connection,Database Connection Commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5b2fc2c0,
		,,true),null),
	org.jkiss.dbeaver.defaultKeyScheme,
	org.jkiss.dbeaver.ui.perspective,,,user)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
serge-ridercommented, Feb 28, 2020

@uslss please try to reproduce it by putting your machine in sleep mode or by switching to another wifi or by plugging off the network.

1reaction
uslsscommented, Feb 28, 2020

Probably it is completely broken, invalidate doesn’t help, only disconnect and then connect to db does

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default database named postgres on Postgresql server
The postgres database is a default database meant for use by users, ... Postgresql will throw an error if the source DB while...
Read more >
15: 19.3. Starting the Database Server - PostgreSQL
Without -D , the server will try to use the data directory named by the environment variable PGDATA . If that variable is...
Read more >
Documentation: 15: CREATE DATABASE - PostgreSQL
To create a new database: CREATE DATABASE lusiadas;. To create a database sales owned by user salesapp with a default tablespace of salesspace...
Read more >
15: 20.11. Client Connection Defaults - PostgreSQL
The default value for this parameter is "$user", public . This setting supports shared use of a database (where no users have private...
Read more >
Documentation: 15: initdb - PostgreSQL
All checksum failures will be reported in the pg_stat_database view. See Section 30.2 for details. --locale= locale. Sets the default locale for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found