Обсуждение: Connection problems - local IP address refused!

Поиск
Список
Период
Сортировка

Connection problems - local IP address refused!

От
Edson Richter
Дата:
Dear all, I need your advise. Found a tricky situation.

Without any changes in the configuration files, a **local** connection to a local VPN IP address could not be established with the following error:

The error (JDBC connection using driver version 1002):
2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException: ERROR: could not establish connection
  Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user "master", database "master", SSL off

org.postgresql.util.PSQLException: ERROR: could not establish connection
  Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user "master", database "master", SSL off

        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
        at br.com...

Current pg_hba.conf:
local   all             all                                                  peer
host    all             all             127.0.0.1/32             md5
host    all             all             10.68.73.0/24           md5

If I run from the Local Server:
[root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
Senha para usuário master:
psql (9.2.6)
Digite "help" para ajuda.

master=> select count(*) from pessoa;
 count
-------
     9
(1 registro)


If I run from a Remote Server:
[root@myremoteserver ssh]# psql -h 10.68.73.6 -d master -U master
Senha para usuário master:
psql (9.2.6)
Digite "help" para ajuda.

master=> select count(*) from pessoa;
 count
-------
     9
(1 registro)


So, seems that only JDBC is getting in trouble to connect to a local IP address.
Current interfaces (and yes, the tunneling is running - otherwise the remote server could not connect):

[root@mylocalserver logs]# ifconfig
eth0      Link encap:Ethernet  Endereço de HW XX:XX:XX:XX:XX:XX
          inet end.: xxx.xx.xxx.85  Bcast:xxx.xx.xxx.87 Masc:255.255.255.248
          endereço inet6: xxxx::xxx:xxxx:xxxx:xxxx/64 Escopo:Link
          UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1
          RX packets:172557 errors:0 dropped:0 overruns:0 frame:0
          TX packets:293439 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:1000
          RX bytes:24537681 (23.4 MiB)  TX bytes:227413210 (216.8 MiB)
          IRQ:28 Memória:fb000000-fb7fffff

lo        Link encap:Loopback Local
          inet end.: 127.0.0.1  Masc:255.0.0.0
          endereço inet6: ::1/128 Escopo:Máquina
          UP LOOPBACKRUNNING  MTU:16436  Métrica:1
          RX packets:138156 errors:0 dropped:0 overruns:0 frame:0
          TX packets:138156 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:0
          RX bytes:31993170 (30.5 MiB)  TX bytes:31993170 (30.5 MiB)

tun0      Link encap:Não Especificado  Endereço de HW 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet end.: 10.68.73.6  P-a-P:10.68.73.5 Masc:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500 Métrica:1
          RX packets:149106 errors:0 dropped:0 overruns:0 frame:0
          TX packets:274534 errors:0 dropped:199 overruns:0 carrier:0
          colisões:0 txqueuelen:100
          RX bytes:6291572 (6.0 MiB)  TX bytes:381732404 (364.0 MiB)

Re: Connection problems - local IP address refused!

От
Alban Hertroys
Дата:
Are you connecting to the correct host?

On 5 February 2014 12:37, Edson Richter <edsonrichter@hotmail.com> wrote:
> Without any changes in the configuration files, a **local** connection to a
> local VPN IP address could not be established with the following error:
>
> The error (JDBC connection using driver version 1002):
> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException: ERROR:
> could not establish connection
>   Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user "master",
> database "master", SSL off

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.


Re: Connection problems - local IP address refused!

От
Edson Richter
Дата:
Em 05/02/2014 11:12, Alban Hertroys escreveu:
> Are you connecting to the correct host?
>
> On 5 February 2014 12:37, Edson Richter <edsonrichter@hotmail.com> wrote:
>> Without any changes in the configuration files, a **local** connection to a
>> local VPN IP address could not be established with the following error:
>>
>> The error (JDBC connection using driver version 1002):
>> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException: ERROR:
>> could not establish connection
>>    Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user "master",
>> database "master", SSL off
Sure! On the exatcly same server:

[root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
Senha para usuário master:
psql (9.2.6)
Digite "help" para ajuda.

master=> select count(*) from pessoa;
  count
-------
      9
(1 registro)


Re: Connection problems - local IP address refused!

От
rob stone
Дата:
O
n Wed, 2014-02-05 at 09:37 -0200, Edson Richter wrote:W
ithout any changes in the configuration files, a **local** connection to
a local VPN IP address could not be established with the following
error:
>
> The error (JDBC connection using driver version 1002):
> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
> ERROR: could not establish connection
>   Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
> "master", database "master", SSL off
>
> org.postgresql.util.PSQLException: ERROR: could not establish
> connection
>   Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
> "master", database "master", SSL off
>
>         at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
>         at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
>         at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331)
>         at
> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>         at
> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>         at
> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>         at br.com...
>
> Current pg_hba.conf:
> local   all             all
> peer
> host    all             all             127.0.0.1/32             md5
> host    all             all             10.68.73.0/24           md5
>
> If I run from the Local Server:
> [root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
> Senha para usuário master:
> psql (9.2.6)
> Digite "help" para ajuda.
>
> master=> select count(*) from pessoa;
>  count
> -------
>      9
> (1 registro)
>
>
> If I run from a Remote Server:
> [root@myremoteserver ssh]# psql -h 10.68.73.6 -d master -U master
> Senha para usuário master:
> psql (9.2.6)
> Digite "help" para ajuda.
>
> master=> select count(*) from pessoa;
>  count
> -------
>      9
> (1 registro)
>
>
> So, seems that only JDBC is getting in trouble to connect to a local
> IP address.
> Current interfaces (and yes, the tunneling is running - otherwise the
> remote server could not connect):
>
> [root@mylocalserver logs]# ifconfig
> eth0      Link encap:Ethernet  Endereço de HW XX:XX:XX:XX:XX:XX
>           inet end.: xxx.xx.xxx.85  Bcast:xxx.xx.xxx.87
> Masc:255.255.255.248
>           endereço inet6: xxxx::xxx:xxxx:xxxx:xxxx/64 Escopo:Link
>           UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1
>           RX packets:172557 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:293439 errors:0 dropped:0 overruns:0 carrier:0
>           colisões:0 txqueuelen:1000
>           RX bytes:24537681 (23.4 MiB)  TX bytes:227413210 (216.8
> MiB)
>           IRQ:28 Memória:fb000000-fb7fffff
>
> lo        Link encap:Loopback Local
>           inet end.: 127.0.0.1  Masc:255.0.0.0
>           endereço inet6: ::1/128 Escopo:Máquina
>           UP LOOPBACKRUNNING  MTU:16436  Métrica:1
>           RX packets:138156 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:138156 errors:0 dropped:0 overruns:0 carrier:0
>           colisões:0 txqueuelen:0
>           RX bytes:31993170 (30.5 MiB)  TX bytes:31993170 (30.5 MiB)
>
> tun0      Link encap:Não Especificado  Endereço de HW
> 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
>           inet end.: 10.68.73.6  P-a-P:10.68.73.5
> Masc:255.255.255.255
>           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500 Métrica:1
>           RX packets:149106 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:274534 errors:0 dropped:199 overruns:0 carrier:0
>           colisões:0 txqueuelen:100
>           RX bytes:6291572 (6.0 MiB)  TX bytes:381732404 (364.0 MiB)
>


The current JDBC version is 1100.

Re: Connection problems - local IP address refused!

От
Adrian Klaver
Дата:
On 02/05/2014 05:43 AM, Edson Richter wrote:
> Em 05/02/2014 11:12, Alban Hertroys escreveu:
>> Are you connecting to the correct host?
>>
>> On 5 February 2014 12:37, Edson Richter <edsonrichter@hotmail.com> wrote:
>>> Without any changes in the configuration files, a **local**
>>> connection to a
>>> local VPN IP address could not be established with the following error:
>>>
>>> The error (JDBC connection using driver version 1002):
>>> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
>>> ERROR:
>>> could not establish connection
>>>    Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>>> "master",
>>> database "master", SSL off
> Sure! On the exatcly same server:
>
> [root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
> Senha para usuário master:
> psql (9.2.6)
> Digite "help" para ajuda.

The error message:

  Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
"master", database "master", SSL off

indicates your JDBC connection is not connecting to a database with the
pg_hba.conf you think it is.

What are the connection parameters for the JDBC connection?

So where is the database running?

What interface is it listening on?

I know it has been asked, but is there another Postgres instance running?


--
Adrian Klaver
adrian.klaver@gmail.com


Re: Connection problems - local IP address refused!

От
Edson Richter
Дата:
Em 05/02/2014 13:03, Adrian Klaver escreveu:
> On 02/05/2014 05:43 AM, Edson Richter wrote:
>> Em 05/02/2014 11:12, Alban Hertroys escreveu:
>>> Are you connecting to the correct host?
>>>
>>> On 5 February 2014 12:37, Edson Richter <edsonrichter@hotmail.com>
>>> wrote:
>>>> Without any changes in the configuration files, a **local**
>>>> connection to a
>>>> local VPN IP address could not be established with the following
>>>> error:
>>>>
>>>> The error (JDBC connection using driver version 1002):
>>>> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
>>>> ERROR:
>>>> could not establish connection
>>>>    Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>>>> "master",
>>>> database "master", SSL off
>> Sure! On the exatcly same server:
>>
>> [root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
>> Senha para usuário master:
>> psql (9.2.6)
>> Digite "help" para ajuda.
>
> The error message:
>
>  Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
> "master", database "master", SSL off
>
> indicates your JDBC connection is not connecting to a database with
> the pg_hba.conf you think it is.
>
> What are the connection parameters for the JDBC connection?
>
> So where is the database running?
>
> What interface is it listening on?
>
> I know it has been asked, but is there another Postgres instance running?
>
>
Well, there is only one PostgreSQL database running in this machine. It
has three interfaces:

lo (127.0.0.1)
eth0 (xxx.xxx.xxx.xxx)
tun0 (10.68.73.6)

PostgreSQL is configured to listen_adrress =  '*'
Firewall allows evertyhing from lo and tun0.
AFAIK (please correct me if I'm wrong) JDBC knows nothing about
pg_hba.conf; this error message comes from PostgresSQL, don't?
I can connect in the very same machine using psql. It is really weird
problem.

I'll need to dig a bit more.

Edson



Re: Connection problems - local IP address refused!

От
Adrian Klaver
Дата:
On 02/05/2014 08:53 AM, Edson Richter wrote:
> Em 05/02/2014 13:03, Adrian Klaver escreveu:
>> On 02/05/2014 05:43 AM, Edson Richter wrote:
>>> Em 05/02/2014 11:12, Alban Hertroys escreveu:
>>>> Are you connecting to the correct host?
>>>>
>>>> On 5 February 2014 12:37, Edson Richter <edsonrichter@hotmail.com>
>>>> wrote:
>>>>> Without any changes in the configuration files, a **local**
>>>>> connection to a
>>>>> local VPN IP address could not be established with the following
>>>>> error:
>>>>>
>>>>> The error (JDBC connection using driver version 1002):
>>>>> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
>>>>> ERROR:
>>>>> could not establish connection
>>>>>    Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>>>>> "master",
>>>>> database "master", SSL off
>>> Sure! On the exatcly same server:
>>>
>>> [root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
>>> Senha para usuário master:
>>> psql (9.2.6)
>>> Digite "help" para ajuda.
>>
>> The error message:
>>
>>  Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>> "master", database "master", SSL off
>>
>> indicates your JDBC connection is not connecting to a database with
>> the pg_hba.conf you think it is.
>>
>> What are the connection parameters for the JDBC connection?
>>
>> So where is the database running?
>>
>> What interface is it listening on?
>>
>> I know it has been asked, but is there another Postgres instance running?
>>
>>
> Well, there is only one PostgreSQL database running in this machine. It
> has three interfaces:
>
> lo (127.0.0.1)
> eth0 (xxx.xxx.xxx.xxx)
> tun0 (10.68.73.6)
>
> PostgreSQL is configured to listen_adrress =  '*'
> Firewall allows evertyhing from lo and tun0.
> AFAIK (please correct me if I'm wrong) JDBC knows nothing about
> pg_hba.conf; this error message comes from PostgresSQL, don't?
> I can connect in the very same machine using psql. It is really weird
> problem.

Your JDBC connection does not 'know' about pg_hba.conf but it is
triggering the error and capturing the exception:

2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
ERROR: could not establish connection

It would seem something about the JDBC connection is incorrect. This is
why I asked for the connection parameters in the JDBC connection. For
some reason it is not connecting in the same manner as psql. The chore
now is to find out why?

>
> I'll need to dig a bit more.
>
> Edson
>
>
>


--
Adrian Klaver
adrian.klaver@gmail.com


Re: Connection problems - local IP address refused!

От
Edson Richter
Дата:
Em 05/02/2014 15:08, Adrian Klaver escreveu:
> On 02/05/2014 08:53 AM, Edson Richter wrote:
>> Em 05/02/2014 13:03, Adrian Klaver escreveu:
>>> On 02/05/2014 05:43 AM, Edson Richter wrote:
>>>> Em 05/02/2014 11:12, Alban Hertroys escreveu:
>>>>> Are you connecting to the correct host?
>>>>>
>>>>> On 5 February 2014 12:37, Edson Richter <edsonrichter@hotmail.com>
>>>>> wrote:
>>>>>> Without any changes in the configuration files, a **local**
>>>>>> connection to a
>>>>>> local VPN IP address could not be established with the following
>>>>>> error:
>>>>>>
>>>>>> The error (JDBC connection using driver version 1002):
>>>>>> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
>>>>>> ERROR:
>>>>>> could not establish connection
>>>>>>    Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>>>>>> "master",
>>>>>> database "master", SSL off
>>>> Sure! On the exatcly same server:
>>>>
>>>> [root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
>>>> Senha para usuário master:
>>>> psql (9.2.6)
>>>> Digite "help" para ajuda.
>>>
>>> The error message:
>>>
>>>  Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>>> "master", database "master", SSL off
>>>
>>> indicates your JDBC connection is not connecting to a database with
>>> the pg_hba.conf you think it is.
>>>
>>> What are the connection parameters for the JDBC connection?
>>>
>>> So where is the database running?
>>>
>>> What interface is it listening on?
>>>
>>> I know it has been asked, but is there another Postgres instance
>>> running?
>>>
>>>
>> Well, there is only one PostgreSQL database running in this machine. It
>> has three interfaces:
>>
>> lo (127.0.0.1)
>> eth0 (xxx.xxx.xxx.xxx)
>> tun0 (10.68.73.6)
>>
>> PostgreSQL is configured to listen_adrress =  '*'
>> Firewall allows evertyhing from lo and tun0.
>> AFAIK (please correct me if I'm wrong) JDBC knows nothing about
>> pg_hba.conf; this error message comes from PostgresSQL, don't?
>> I can connect in the very same machine using psql. It is really weird
>> problem.
>
> Your JDBC connection does not 'know' about pg_hba.conf but it is
> triggering the error and capturing the exception:
>
> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
> ERROR: could not establish connection
>
> It would seem something about the JDBC connection is incorrect. This
> is why I asked for the connection parameters in the JDBC connection.
> For some reason it is not connecting in the same manner as psql. The
> chore now is to find out why?
>

You are right. And then, problem becomes even more weird. The JDBC
connection is:

  <Resource auth="Container" description="Master Database"
               driverClassName="org.postgresql.Driver"
               maxActive="5" maxIdle="0" name="jdbc/master"
               username="master" password="xxxx"
               type="javax.sql.DataSource"
               removeAbandoned="true" removeAbandonedTimeout="60"
               logAbandoned="true"
url="jdbc:postgresql://127.0.0.1:5432/master?charset=UTF-8"/>

Must be something related to reverse address resolution (converting from
127.0.0.1 to "MyLocalServer" and then "MyLocalServer" is being mapped to
10.68.73.6), must be affected by the VPN.
I just can't figure out why and where...

Edson

>>
>> I'll need to dig a bit more.
>>
>> Edson
>>
>>
>>
>
>



Re: Connection problems - local IP address refused!

От
Edson Richter
Дата:
Em 05/02/2014 11:51, rob stone escreveu:
> O
> n Wed, 2014-02-05 at 09:37 -0200, Edson Richter wrote:W
> ithout any changes in the configuration files, a **local** connection to
> a local VPN IP address could not be established with the following
> error:
>> The error (JDBC connection using driver version 1002):
>> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
>> ERROR: could not establish connection
>>    Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>> "master", database "master", SSL off
>>
>> org.postgresql.util.PSQLException: ERROR: could not establish
>> connection
>>    Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>> "master", database "master", SSL off
>>
>>          at
>> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
>>          at
>> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
>>          at
>> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
>>          at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
>>          at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
>>          at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331)
>>          at
>> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>>          at
>> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>>          at
>> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>>          at br.com...
>>
>> Current pg_hba.conf:
>> local   all             all
>> peer
>> host    all             all             127.0.0.1/32             md5
>> host    all             all             10.68.73.0/24           md5
>>
>> If I run from the Local Server:
>> [root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
>> Senha para usuário master:
>> psql (9.2.6)
>> Digite "help" para ajuda.
>>
>> master=> select count(*) from pessoa;
>>   count
>> -------
>>       9
>> (1 registro)
>>
>>
>> If I run from a Remote Server:
>> [root@myremoteserver ssh]# psql -h 10.68.73.6 -d master -U master
>> Senha para usuário master:
>> psql (9.2.6)
>> Digite "help" para ajuda.
>>
>> master=> select count(*) from pessoa;
>>   count
>> -------
>>       9
>> (1 registro)
>>
>>
>> So, seems that only JDBC is getting in trouble to connect to a local
>> IP address.
>> Current interfaces (and yes, the tunneling is running - otherwise the
>> remote server could not connect):
>>
>> [root@mylocalserver logs]# ifconfig
>> eth0      Link encap:Ethernet  Endereço de HW XX:XX:XX:XX:XX:XX
>>            inet end.: xxx.xx.xxx.85  Bcast:xxx.xx.xxx.87
>> Masc:255.255.255.248
>>            endereço inet6: xxxx::xxx:xxxx:xxxx:xxxx/64 Escopo:Link
>>            UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1
>>            RX packets:172557 errors:0 dropped:0 overruns:0 frame:0
>>            TX packets:293439 errors:0 dropped:0 overruns:0 carrier:0
>>            colisões:0 txqueuelen:1000
>>            RX bytes:24537681 (23.4 MiB)  TX bytes:227413210 (216.8
>> MiB)
>>            IRQ:28 Memória:fb000000-fb7fffff
>>
>> lo        Link encap:Loopback Local
>>            inet end.: 127.0.0.1  Masc:255.0.0.0
>>            endereço inet6: ::1/128 Escopo:Máquina
>>            UP LOOPBACKRUNNING  MTU:16436  Métrica:1
>>            RX packets:138156 errors:0 dropped:0 overruns:0 frame:0
>>            TX packets:138156 errors:0 dropped:0 overruns:0 carrier:0
>>            colisões:0 txqueuelen:0
>>            RX bytes:31993170 (30.5 MiB)  TX bytes:31993170 (30.5 MiB)
>>
>> tun0      Link encap:Não Especificado  Endereço de HW
>> 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
>>            inet end.: 10.68.73.6  P-a-P:10.68.73.5
>> Masc:255.255.255.255
>>            UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500 Métrica:1
>>            RX packets:149106 errors:0 dropped:0 overruns:0 frame:0
>>            TX packets:274534 errors:0 dropped:199 overruns:0 carrier:0
>>            colisões:0 txqueuelen:100
>>            RX bytes:6291572 (6.0 MiB)  TX bytes:381732404 (364.0 MiB)
>>
>
> The current JDBC version is 1100.
> >From where did you obtain version 1002?

I've downloaded the source, add some debug information and build from
the sources. I've been using this for a long time.

> I think that your PostgreSql version and JDBC version are incompatible.
Well, should I use 9.3 1100 with a 9.2.6 server database?
> I use ExecuteQuery and JDBC drivers daily for testing, etc.

I've processed > 1.000.000 transactions with this driver in this server
last month...

> The error your are pulling appears to be an issue with versions.

Well, I'll give a try with a new driver, but I do suspect something
wrong in identifying network names...

Thanks for your help. I'll try your suggestion.

Regards,

Edson
>
> HTH
>
> Robert
>
>
>



Re: Connection problems - local IP address refused!

От
Edson Richter
Дата:
Em 05/02/2014 15:08, Adrian Klaver escreveu:
> On 02/05/2014 08:53 AM, Edson Richter wrote:
>> Em 05/02/2014 13:03, Adrian Klaver escreveu:
>>> On 02/05/2014 05:43 AM, Edson Richter wrote:
>>>> Em 05/02/2014 11:12, Alban Hertroys escreveu:
>>>>> Are you connecting to the correct host?
>>>>>
>>>>> On 5 February 2014 12:37, Edson Richter <edsonrichter@hotmail.com>
>>>>> wrote:
>>>>>> Without any changes in the configuration files, a **local**
>>>>>> connection to a
>>>>>> local VPN IP address could not be established with the following
>>>>>> error:
>>>>>>
>>>>>> The error (JDBC connection using driver version 1002):
>>>>>> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
>>>>>> ERROR:
>>>>>> could not establish connection
>>>>>>    Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>>>>>> "master",
>>>>>> database "master", SSL off
>>>> Sure! On the exatcly same server:
>>>>
>>>> [root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
>>>> Senha para usuário master:
>>>> psql (9.2.6)
>>>> Digite "help" para ajuda.
>>>
>>> The error message:
>>>
>>>  Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user
>>> "master", database "master", SSL off
>>>
>>> indicates your JDBC connection is not connecting to a database with
>>> the pg_hba.conf you think it is.
>>>
>>> What are the connection parameters for the JDBC connection?
>>>
>>> So where is the database running?
>>>
>>> What interface is it listening on?
>>>
>>> I know it has been asked, but is there another Postgres instance
>>> running?
>>>
>>>
>> Well, there is only one PostgreSQL database running in this machine. It
>> has three interfaces:
>>
>> lo (127.0.0.1)
>> eth0 (xxx.xxx.xxx.xxx)
>> tun0 (10.68.73.6)
>>
>> PostgreSQL is configured to listen_adrress =  '*'
>> Firewall allows evertyhing from lo and tun0.
>> AFAIK (please correct me if I'm wrong) JDBC knows nothing about
>> pg_hba.conf; this error message comes from PostgresSQL, don't?
>> I can connect in the very same machine using psql. It is really weird
>> problem.
>
> Your JDBC connection does not 'know' about pg_hba.conf but it is
> triggering the error and capturing the exception:
>
> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException:
> ERROR: could not establish connection
>
> It would seem something about the JDBC connection is incorrect. This
> is why I asked for the connection parameters in the JDBC connection.
> For some reason it is not connecting in the same manner as psql. The
> chore now is to find out why?

Thanks, Adrian!

Your ideas helped a lot to get me to the solution.
My problem was I had a "context.xml" file in my deployment folder.
I can't say why Tomcat wasn't reading this file in the past - but
anyway, removing the context.xml file from the deployment solved the
problem.

Regards,

Edson


>
>>
>> I'll need to dig a bit more.
>>
>> Edson
>>
>>
>>
>
>