pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Unable to connect to 9.5 via JDBC driver 1207
15+ messages / 6 participants
[nested] [flat]

* Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 17:08  rob stone <floriparob@gmail.com>
  0 siblings, 2 replies; 15+ messages in thread

From: rob stone @ 2016-02-02 17:08 UTC (permalink / raw)
  To: pgsql-jdbc

Hello,

I downloaded the 9.5 release as Debian packages and everything is
working as intended except for obtaining a connection via the JDBC
driver.

I use ExecuteQuery a lot. Both it and a silly little Java class that I
wrote to test connecting both return the same error.

I downloaded the Java source and tried to figure out what is happening
without any success.




org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
"127.0.0.1", user "timeman", database "timemanager", SSL off
	at
org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(Connectio
nFactoryImpl.java:427)
	at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Connect
ionFactoryImpl.java:203)
	at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.
java:65)
	at
org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:159)
	at org.postgresql.Driver.makeConnection(Driver.java:416)
	at org.postgresql.Driver.connect(Driver.java:283)
	at
org.executequery.datasource.SimpleDataSource.getConnection(SimpleDataSo
urce.java:102)
	at
org.executequery.datasource.SimpleDataSource.getConnection(SimpleDataSo
urce.java:83)
	at
org.executequery.datasource.ConnectionPoolImpl.createConnection(Connect
ionPoolImpl.java:254)
	at
org.executequery.datasource.ConnectionPoolImpl.ensureCapacity(Connectio
nPoolImpl.java:202)
	at
org.executequery.datasource.ConnectionPoolImpl.setMinimumConnections(Co
nnectionPoolImpl.java:421)
	at
org.executequery.datasource.ConnectionManager.createDataSource(Connecti
onManager.java:87)
	at
org.executequery.databasemediators.spi.DefaultConnectionBuilder.createD
ataSource(DefaultConnectionBuilder.java:122)
	at
org.executequery.databasemediators.spi.DefaultConnectionBuilder.access$
000(DefaultConnectionBuilder.java:35)
	at
org.executequery.databasemediators.spi.DefaultConnectionBuilder$1.const
ruct(DefaultConnectionBuilder.java:100)
	at
org.underworldlabs.swing.util.SwingWorker$2.run(SwingWorker.java:130)
	at java.lang.Thread.run(Thread.java:745)


--------------------------------------

my pg_hba.conf file

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
# host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
# host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                trust
#host    replication     postgres        127.0.0.1/32            trust
#host    replication     postgres        ::1/128                 trust



-----------------------------------

I can run psql without any problems.

postgres@roblaptop:/home/postgres/data95$ psql -d timemanager -U
timeman -p 5434
psql (9.5.0)
Type "help" for help.

timemanager=> select count(*) from error_messages;
 count 
-------
   357
(1 row)

timemanager=> 



Please let me know if any further information is required.


Thanks,
Rob


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 17:20  Radoslav Petrov <rado@edno.moe>
  parent: rob stone <floriparob@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Radoslav Petrov @ 2016-02-02 17:20 UTC (permalink / raw)
  To: pgsql-jdbc

Hi Rob,
try to uncomment the following in pg_hba.conf:

# IPv4 local connections:
# host    all              all             127.0.0.1/32            trust

To become:

# IPv4 local connections:
host    all             all             127.0.0.1/32            trust

You can check the documentation here: 
http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html

On 2.02.2016 19:08, rob stone wrote:
> Hello,
>
> I downloaded the 9.5 release as Debian packages and everything is
> working as intended except for obtaining a connection via the JDBC
> driver.
>
> I use ExecuteQuery a lot. Both it and a silly little Java class that I
> wrote to test connecting both return the same error.
>
> I downloaded the Java source and tried to figure out what is happening
> without any success.
>
>
>
>
> org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
> "127.0.0.1", user "timeman", database "timemanager", SSL off
> 	at
> org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(Connectio
> nFactoryImpl.java:427)
> 	at
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Connect
> ionFactoryImpl.java:203)
> 	at
> org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.
> java:65)
> 	at
> org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:159)
> 	at org.postgresql.Driver.makeConnection(Driver.java:416)
> 	at org.postgresql.Driver.connect(Driver.java:283)
> 	at
> org.executequery.datasource.SimpleDataSource.getConnection(SimpleDataSo
> urce.java:102)
> 	at
> org.executequery.datasource.SimpleDataSource.getConnection(SimpleDataSo
> urce.java:83)
> 	at
> org.executequery.datasource.ConnectionPoolImpl.createConnection(Connect
> ionPoolImpl.java:254)
> 	at
> org.executequery.datasource.ConnectionPoolImpl.ensureCapacity(Connectio
> nPoolImpl.java:202)
> 	at
> org.executequery.datasource.ConnectionPoolImpl.setMinimumConnections(Co
> nnectionPoolImpl.java:421)
> 	at
> org.executequery.datasource.ConnectionManager.createDataSource(Connecti
> onManager.java:87)
> 	at
> org.executequery.databasemediators.spi.DefaultConnectionBuilder.createD
> ataSource(DefaultConnectionBuilder.java:122)
> 	at
> org.executequery.databasemediators.spi.DefaultConnectionBuilder.access$
> 000(DefaultConnectionBuilder.java:35)
> 	at
> org.executequery.databasemediators.spi.DefaultConnectionBuilder$1.const
> ruct(DefaultConnectionBuilder.java:100)
> 	at
> org.underworldlabs.swing.util.SwingWorker$2.run(SwingWorker.java:130)
> 	at java.lang.Thread.run(Thread.java:745)
>
>
> --------------------------------------
>
> my pg_hba.conf file
>
> # TYPE  DATABASE        USER            ADDRESS                 METHOD
>
> # "local" is for Unix domain socket connections only
> local   all             all                                     trust
> # IPv4 local connections:
> # host    all             all             127.0.0.1/32            trust
> # IPv6 local connections:
> # host    all             all             ::1/128                 trust
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> #local   replication     postgres                                trust
> #host    replication     postgres        127.0.0.1/32            trust
> #host    replication     postgres        ::1/128                 trust
>
>
>
> -----------------------------------
>
> I can run psql without any problems.
>
> postgres@roblaptop:/home/postgres/data95$ psql -d timemanager -U
> timeman -p 5434
> psql (9.5.0)
> Type "help" for help.
>
> timemanager=> select count(*) from error_messages;
>   count
> -------
>     357
> (1 row)
>
> timemanager=>
>
>
>
> Please let me know if any further information is required.
>
>
> Thanks,
> Rob
>
>

-- 
Поздрави,       | Best regards,
Радослав Петров | Radoslav Petrov

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 18:54  Thomas Kellerer <spam_eater@gmx.net>
  parent: rob stone <floriparob@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Thomas Kellerer @ 2016-02-02 18:54 UTC (permalink / raw)
  To: pgsql-jdbc

rob stone schrieb am 02.02.2016 um 18:08:
> Hello,
>
> I downloaded the 9.5 release as Debian packages and everything is
> working as intended except for obtaining a connection via the JDBC
> driver.
>
> org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
> "127.0.0.1", user "timeman", database "timemanager", SSL off
> 	at

I had the same problem, I could only resolve it by switching back to 1206





-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 18:57  Dave Cramer <pg@fastcrypt.com>
  parent: Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 1 reply; 15+ messages in thread

From: Dave Cramer @ 2016-02-02 18:57 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc

In this case there are no tcp connections allowed in pg_hba.conf.

java by default only connects to tcp connections. psql will connect to
local socket in the example above

try psql -h localhost ... to see the same results

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 2 February 2016 at 13:54, Thomas Kellerer <spam_eater@gmx.net> wrote:

> rob stone schrieb am 02.02.2016 um 18:08:
>
>> Hello,
>>
>> I downloaded the 9.5 release as Debian packages and everything is
>> working as intended except for obtaining a connection via the JDBC
>> driver.
>>
>> org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
>> "127.0.0.1", user "timeman", database "timemanager", SSL off
>>         at
>>
>
> I had the same problem, I could only resolve it by switching back to 1206
>
>
>
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 19:13  Thomas Kellerer <spam_eater@gmx.net>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Thomas Kellerer @ 2016-02-02 19:13 UTC (permalink / raw)
  To: pgsql-jdbc

As I said: by simply switching to the previous driver, everything was fine.

It works fine with JDBC connections to localhost, but not to a remote server (psql was fine)

I had also one user of SQL Workbench/J who reported the same problem and
after switching to 1206 the problem went away for him as well.


Thomas


Dave Cramer schrieb am 02.02.2016 um 19:57:
> In this case there are no tcp connections allowed in pg_hba.conf.
>
> java by default only connects to tcp connections. psql will connect to local socket in the example above
>
> try psql -h localhost ... to see the same results
>
> Dave Cramer
>
> davec@postgresintl.com <mailto:davec@postgresintl.com>
> www.postgresintl.com <http://www.postgresintl.com;
>
> On 2 February 2016 at 13:54, Thomas Kellerer <spam_eater@gmx.net <mailto:spam_eater@gmx.net>> wrote:
>
>     rob stone schrieb am 02.02.2016 um 18:08:
>
>         Hello,
>
>         I downloaded the 9.5 release as Debian packages and everything is
>         working as intended except for obtaining a connection via the JDBC
>         driver.
>
>         org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
>         "127.0.0.1", user "timeman", database "timemanager", SSL off
>                  at
>
>
>     I had the same problem, I could only resolve it by switching back to 1206
>
>
>
>
>
>
>     --
>     Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org <mailto:pgsql-jdbc@postgresql.org>)
>     To make changes to your subscription:
>     http://www.postgresql.org/mailpref/pgsql-jdbc
>
>




-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 19:16  Dave Cramer <pg@fastcrypt.com>
  parent: Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 1 reply; 15+ messages in thread

From: Dave Cramer @ 2016-02-02 19:16 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc

On 2 February 2016 at 14:13, Thomas Kellerer <spam_eater@gmx.net> wrote:

> As I said: by simply switching to the previous driver, everything was fine.
>
> It works fine with JDBC connections to localhost, but not to a remote
> server (psql was fine)
>
> I had also one user of SQL Workbench/J who reported the same problem and
> after switching to 1206 the problem went away for him as well.
>
>
> Thomas
>
> Well clearly we would like to get to the root of this problem. Is it
possible for you to provide us with more information?

Dave Cramer

davec@postgresintl.com
www.postgresintl.com


> Dave Cramer schrieb am 02.02.2016 um 19:57:
>
>> In this case there are no tcp connections allowed in pg_hba.conf.
>>
>> java by default only connects to tcp connections. psql will connect to
>> local socket in the example above
>>
>> try psql -h localhost ... to see the same results
>>
>> Dave Cramer
>>
>> davec@postgresintl.com <mailto:davec@postgresintl.com>
>> www.postgresintl.com <http://www.postgresintl.com;
>>
>> On 2 February 2016 at 13:54, Thomas Kellerer <spam_eater@gmx.net <mailto:
>> spam_eater@gmx.net>> wrote:
>>
>>     rob stone schrieb am 02.02.2016 um 18:08:
>>
>>         Hello,
>>
>>         I downloaded the 9.5 release as Debian packages and everything is
>>         working as intended except for obtaining a connection via the JDBC
>>         driver.
>>
>>         org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry
>> for host
>>         "127.0.0.1", user "timeman", database "timemanager", SSL off
>>                  at
>>
>>
>>     I had the same problem, I could only resolve it by switching back to
>> 1206
>>
>>
>>
>>
>>
>>
>>     --
>>     Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org <mailto:
>> pgsql-jdbc@postgresql.org>)
>>     To make changes to your subscription:
>>     http://www.postgresql.org/mailpref/pgsql-jdbc
>>
>>
>>
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 19:38  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Tom Lane @ 2016-02-02 19:38 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-jdbc

Dave Cramer <pg@fastcrypt.com> writes:
> On 2 February 2016 at 14:13, Thomas Kellerer <spam_eater@gmx.net> wrote:
>> As I said: by simply switching to the previous driver, everything was fine.
>> It works fine with JDBC connections to localhost, but not to a remote
>> server (psql was fine)
>> I had also one user of SQL Workbench/J who reported the same problem and
>> after switching to 1206 the problem went away for him as well.

> Well clearly we would like to get to the root of this problem. Is it
> possible for you to provide us with more information?

Since the quoted error message mentions a connection from "127.0.0.1",
it's impossible that it is a reply from a remote server (unless your
networking configuration is completely broken).  Presumably what is
happening is that what you think is a connection to a remote PG server
is actually being made to localhost, and the local PG server's pg_hba.conf
doesn't allow the username and/or dbname.  You could check that by turning
on log_connections on both servers.

As to why that would happen as a consequence of a driver version change,
I'm pretty clueless, but I would wonder about differences in driver config
files or the driver's interpretation of a connection URL.  In any case,
certainly not enough information has been given to diagnose it.

			regards, tom lane


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 20:10  Thomas Kellerer <spam_eater@gmx.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 15+ messages in thread

From: Thomas Kellerer @ 2016-02-02 20:10 UTC (permalink / raw)
  To: pgsql-jdbc

Tom Lane schrieb am 02.02.2016 um 20:38:
>>> As I said: by simply switching to the previous driver, everything was fine.
>>> It works fine with JDBC connections to localhost, but not to a remote
>>> server (psql was fine)
>>> I had also one user of SQL Workbench/J who reported the same problem and
>>> after switching to 1206 the problem went away for him as well.
>
>> Well clearly we would like to get to the root of this problem. Is it
>> possible for you to provide us with more information?
>
> Since the quoted error message mentions a connection from "127.0.0.1",
> it's impossible that it is a reply from a remote server (unless your
> networking configuration is completely broken).  Presumably what is
> happening is that what you think is a connection to a remote PG server
> is actually being made to localhost, and the local PG server's pg_hba.conf
> doesn't allow the username and/or dbname.  You could check that by turning
> on log_connections on both servers.
>
> As to why that would happen as a consequence of a driver version change,
> I'm pretty clueless, but I would wonder about differences in driver config
> files or the driver's interpretation of a connection URL.  In any case,
> certainly not enough information has been given to diagnose it.


The initial error message in this thread was not from me.

I am currently not in the office, but I will see if I can reproduce that tomorrow.

I have also contacted the SQL Workbench/J user who reported this to me last week
and asked him to describe his setup as well.

In his case, the error message was:

> FATAL: no pg_hba.conf entry for host "213.xxx.xx.xxx", user "foobar", database "postgres", SSL on

If I understood him correctly, he has no access to the server, so the only thing he did,
was to change the driver and he could connect again.

Thomas



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 21:21  rob stone <floriparob@gmail.com>
  parent: Thomas Kellerer <spam_eater@gmx.net>
  1 sibling, 2 replies; 15+ messages in thread

From: rob stone @ 2016-02-02 21:21 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; pgsql-jdbc

On Tue, 2016-02-02 at 21:10 +0100, Thomas Kellerer wrote:
> Tom Lane schrieb am 02.02.2016 um 20:38:
> > > > 

> > Since the quoted error message mentions a connection from
> > "127.0.0.1",
> > it's impossible that it is a reply from a remote server (unless
> > your
> > networking configuration is completely broken).  Presumably what is
> > happening is that what you think is a connection to a remote PG
> > server
> > is actually being made to localhost, and the local PG server's
> > pg_hba.conf
> > doesn't allow the username and/or dbname.  You could check that by
> > turning
> > on log_connections on both servers.
> > 
> > As to why that would happen as a consequence of a driver version
> > change,
> > I'm pretty clueless, but I would wonder about differences in driver
> > config
> > files or the driver's interpretation of a connection URL.  In any
> > case,
> > certainly not enough information has been given to diagnose it.
> 
> 
> The initial error message in this thread was not from me.
> 
> I am currently not in the office, but I will see if I can reproduce
> that tomorrow.
> 
> I have also contacted the SQL Workbench/J user who reported this to
> me last week
> and asked him to describe his setup as well.
> 
> In his case, the error message was:
> 
> > FATAL: no pg_hba.conf entry for host "213.xxx.xx.xxx", user
> > "foobar", database "postgres", SSL on
> 
> If I understood him correctly, he has no access to the server, so the
> only thing he did,
> was to change the driver and he could connect again.
> 
> Thomas
> 
> 
> 


I'm using a domain socket connection on my laptop. There is NO network.

I've been using JDBC drivers since Postgres 8.x. The pg_hba.conf file
has always been identical.

postgresql-9.4-1200.jdbc41.jar works fine on 9.4.
The issue is with 9.5.

So "local all all trust" according to the pg_hba.conf doco "translates"
to "localhost domain socket connection, any user, any database and
trust the person connecting" -- i.e. don't validate password.

The package org.postgresql.core.v3.ConnectionFactoryImpl doesn't
display enough information in its error message.
It should display the URL used, which has to be built using pg_hba.conf
plus user input.

This:-

con = DriverManager.getConnection(url, user, password);

is the usual way to connect.

I don't know if using port 5434 for 9.5 is an issue. I'm still using
9.4 and its port number is 5433. (Clutching at straws. Probable red
herring.)



Please let me know if there are any other tests that I can run.


Cheers,
Rob




-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 22:13  Dave Cramer <pg@fastcrypt.com>
  parent: rob stone <floriparob@gmail.com>
  1 sibling, 0 replies; 15+ messages in thread

From: Dave Cramer @ 2016-02-02 22:13 UTC (permalink / raw)
  To: rob stone <floriparob@gmail.com>; +Cc: Thomas Kellerer <spam_eater@gmx.net>; pgsql-jdbc

On 2 February 2016 at 16:21, rob stone <floriparob@gmail.com> wrote:

> On Tue, 2016-02-02 at 21:10 +0100, Thomas Kellerer wrote:
> > Tom Lane schrieb am 02.02.2016 um 20:38:
> > > > >
>
> > > Since the quoted error message mentions a connection from
> > > "127.0.0.1",
> > > it's impossible that it is a reply from a remote server (unless
> > > your
> > > networking configuration is completely broken).  Presumably what is
> > > happening is that what you think is a connection to a remote PG
> > > server
> > > is actually being made to localhost, and the local PG server's
> > > pg_hba.conf
> > > doesn't allow the username and/or dbname.  You could check that by
> > > turning
> > > on log_connections on both servers.
> > >
> > > As to why that would happen as a consequence of a driver version
> > > change,
> > > I'm pretty clueless, but I would wonder about differences in driver
> > > config
> > > files or the driver's interpretation of a connection URL.  In any
> > > case,
> > > certainly not enough information has been given to diagnose it.
> >
> >
> > The initial error message in this thread was not from me.
> >
> > I am currently not in the office, but I will see if I can reproduce
> > that tomorrow.
> >
> > I have also contacted the SQL Workbench/J user who reported this to
> > me last week
> > and asked him to describe his setup as well.
> >
> > In his case, the error message was:
> >
> > > FATAL: no pg_hba.conf entry for host "213.xxx.xx.xxx", user
> > > "foobar", database "postgres", SSL on
> >
> > If I understood him correctly, he has no access to the server, so the
> > only thing he did,
> > was to change the driver and he could connect again.
> >
> > Thomas
> >
> >
> >
>
>
> I'm using a domain socket connection on my laptop. There is NO network.
>
> I've been using JDBC drivers since Postgres 8.x. The pg_hba.conf file
> has always been identical.
>
> postgresql-9.4-1200.jdbc41.jar works fine on 9.4.
> The issue is with 9.5.
>
> So "local all all trust" according to the pg_hba.conf doco "translates"
> to "localhost domain socket connection, any user, any database and
> trust the person connecting" -- i.e. don't validate password.
>
> The package org.postgresql.core.v3.ConnectionFactoryImpl doesn't
> display enough information in its error message.
> It should display the URL used, which has to be built using pg_hba.conf
> plus user input.
>
> This:-
>
> con = DriverManager.getConnection(url, user, password);
>
> is the usual way to connect.
>
> I don't know if using port 5434 for 9.5 is an issue. I'm still using
> 9.4 and its port number is 5433. (Clutching at straws. Probable red
> herring.)
>
>
>
> Please let me know if there are any other tests that I can run.
>
>
> Cheers,
> Rob
>
>
> Rob,

So your problem is that when you upgraded postgres to 9.5 you were unable
to connect using the *same* driver

Is that correct ?



Dave Cramer

davec@postgresintl.com
www.postgresintl.com


>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-02 22:39  John R Pierce <pierce@hogranch.com>
  parent: rob stone <floriparob@gmail.com>
  1 sibling, 0 replies; 15+ messages in thread

From: John R Pierce @ 2016-02-02 22:39 UTC (permalink / raw)
  To: pgsql-jdbc

On 2/2/2016 1:21 PM, rob stone wrote:
> I'm using a domain socket connection on my laptop. There is NO network.
>
> I've been using JDBC drivers since Postgres 8.x. The pg_hba.conf file
> has always been identical.

Java and JDBC do not support 'domain sockets' at all.    They default to 
localhost (either 127.0.0.1 or ::1).



-- 
john r pierce, recycling bits in santa cruz



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-03 18:32  rob stone <floriparob@gmail.com>
  parent: Radoslav Petrov <rado@edno.moe>
  0 siblings, 1 reply; 15+ messages in thread

From: rob stone @ 2016-02-03 18:32 UTC (permalink / raw)
  To: Radoslav Petrov <rado@edno.moe>; pgsql-jdbc

On Tue, 2016-02-02 at 19:20 +0200, Radoslav Petrov wrote:
> Hi Rob,
> try to uncomment the following in pg_hba.conf:
> # IPv4 local connections:
> #
> host    all             all             127.0.0.1/32            trust
> To become:
> # IPv4 local connections:
> host    all             all             127.0.0.1/32            trust
> You can check the documentation here: http://www.postgresql.org/docs/
> devel/static/auth-pg-hba-conf.html
> 


Mea culpa!

I haven't a clue as to why I commented out that line. Losing my
marbles, perhaps.

I put that line back into the pg_hba.conf file and everything is now
working as intended.

My apologies for raising a non-issue.

Cheers,
Rob


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-03 18:34  Dave Cramer <pg@fastcrypt.com>
  parent: rob stone <floriparob@gmail.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Dave Cramer @ 2016-02-03 18:34 UTC (permalink / raw)
  To: rob stone <floriparob@gmail.com>; +Cc: Radoslav Petrov <rado@edno.moe>; pgsql-jdbc

Thanks,

Most people tend not to tell us that it was their mistake.

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 3 February 2016 at 13:32, rob stone <floriparob@gmail.com> wrote:

> On Tue, 2016-02-02 at 19:20 +0200, Radoslav Petrov wrote:
> > Hi Rob,
> > try to uncomment the following in pg_hba.conf:
> > # IPv4 local connections:
> > #
> > host    all             all             127.0.0.1/32            trust
> > To become:
> > # IPv4 local connections:
> > host    all             all             127.0.0.1/32            trust
> > You can check the documentation here: http://www.postgresql.org/docs/
> > devel/static/auth-pg-hba-conf.html
> >
>
>
> Mea culpa!
>
> I haven't a clue as to why I commented out that line. Losing my
> marbles, perhaps.
>
> I put that line back into the pg_hba.conf file and everything is now
> working as intended.
>
> My apologies for raising a non-issue.
>
> Cheers,
> Rob
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-04 08:11  Thomas Kellerer <spam_eater@gmx.net>
  parent: Thomas Kellerer <spam_eater@gmx.net>
  1 sibling, 1 reply; 15+ messages in thread

From: Thomas Kellerer @ 2016-02-04 08:11 UTC (permalink / raw)
  To: pgsql-jdbc

Thomas Kellerer schrieb am 02.02.2016 um 21:10:
> I am currently not in the office, but I will see if I can reproduce that tomorrow.

I tried to reproduce this, but unfortunately I couldn't. And the server logs are also 
no longer available (being just a development/test database)

One thing that might be interesting: the database was migrated from 9.4 to 9.5 using pg_upgrade

And the error occurred after the first start of 9.5. When I got the error, I remembered 
the experience that was reported to me, that switching the drivers helped. So I switched the 
driver (1206) and the connection worked. Now using 1207 again, the error unfortunately 
does not occur any more. 

The _server_ changed it's IP address at some point, I am not sure when that was or if 
that is important at all. 

As I can't reproduce this any longer, I'm fine with just disposing this as "probably a user error"

Thomas






-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Unable to connect to 9.5 via JDBC driver 1207
@ 2016-02-05 17:35  rob stone <floriparob@gmail.com>
  parent: Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 0 replies; 15+ messages in thread

From: rob stone @ 2016-02-05 17:35 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; pgsql-jdbc

On Thu, 2016-02-04 at 09:11 +0100, Thomas Kellerer wrote:
> Thomas Kellerer schrieb am 02.02.2016 um 21:10:
> > I am currently not in the office, but I will see if I can reproduce
> > that tomorrow.
> 
> I tried to reproduce this, but unfortunately I couldn't. And the
> server logs are also 
> no longer available (being just a development/test database)
> 
> One thing that might be interesting: the database was migrated from
> 9.4 to 9.5 using pg_upgrade
> 
> As I can't reproduce this any longer, I'm fine with just disposing
> this as "probably a user error"
> 
> Thomas
> 
Hello Thomas,

Yes, it was just a "user error".
I'd compiled 9.5rc1 and was testing it out.
Weeks later I downloaded the deb binaries so as to have an "official"
version but overlooked pg_hba.conf changes.
Thus the JDBC connection failed.

So my understanding of this is that it looks up the IP address of
"localhost" and then trawls thru pg_hba.conf looking for an entry
containing that IP address, and if it exists, try the connection,
otherwise throw an error.

Cheers,
Robert


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 15+ messages in thread


end of thread, other threads:[~2016-02-05 17:35 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-02-02 17:08 Unable to connect to 9.5 via JDBC driver 1207 rob stone <floriparob@gmail.com>
2016-02-02 17:20 ` Radoslav Petrov <rado@edno.moe>
2016-02-03 18:32   ` rob stone <floriparob@gmail.com>
2016-02-03 18:34     ` Dave Cramer <pg@fastcrypt.com>
2016-02-02 18:54 ` Thomas Kellerer <spam_eater@gmx.net>
2016-02-02 18:57   ` Dave Cramer <pg@fastcrypt.com>
2016-02-02 19:13     ` Thomas Kellerer <spam_eater@gmx.net>
2016-02-02 19:16       ` Dave Cramer <pg@fastcrypt.com>
2016-02-02 19:38         ` Tom Lane <tgl@sss.pgh.pa.us>
2016-02-02 20:10           ` Thomas Kellerer <spam_eater@gmx.net>
2016-02-02 21:21             ` rob stone <floriparob@gmail.com>
2016-02-02 22:13               ` Dave Cramer <pg@fastcrypt.com>
2016-02-02 22:39               ` John R Pierce <pierce@hogranch.com>
2016-02-04 08:11             ` Thomas Kellerer <spam_eater@gmx.net>
2016-02-05 17:35               ` rob stone <floriparob@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox