pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14166: JDBC driver won't parse error message from DB server in German
5+ messages / 5 participants
[nested] [flat]

* BUG #14166: JDBC driver won't parse error message from DB server in German
@ 2016-05-31 14:32  davygora@sulzer.de
  0 siblings, 1 reply; 5+ messages in thread

From: davygora@sulzer.de @ 2016-05-31 14:32 UTC (permalink / raw)
  To: pgsql-bugs@postgresql.org

The following bug has been logged on the website:

Bug reference:      14166
Logged by:          Yuriy Davygora
Email address:      davygora@sulzer.de
PostgreSQL version: 9.5.3
Operating system:   Windows 7 64 bit
Description:        

Prerequisites (all local, no remote servers):
  - PostgreSQL DB 9.5.3 with locale German_Germany.1252
  - PostgreSQL JDBC driver postgresql-9.4.1208.jar (jre8)
  - Payara JEE server 4.1.1.161.1
  - Oracle JDK 1.8.0_72
  - Misconfiguration of the JDBC connection in the domain.xml file causing
the DB connection error (see below)

The JDBC driver provides a property 'DatabaseName' which I set to the
correct database name which is different from the user name. Here is an
excerpt from domain.xml:

  <property name="DatabaseName" value="database_name"></property>
  <property name="User" value="user_name"></property>
  <property name="PortNumber" value="5432"></property>
  <property name="Url" value="jdbc:postgresql://localhost/"></property>

--------------------------
  
Bug description:

The DB connection error was "database does not exist" (which I found out
after switching the locale from German to English). To fix I had to include
the database name in the URL as follows:

  <property name="Url"
value="jdbc:postgresql://localhost/database_name?"></property>

While the locale of the DB server was still set to German, however, I did
get a different message. Here is an excerpt from the stacktrace:

Caused by: java.io.IOException: Ungültige UTF-8-Sequenz: das erste Byte ist
10xxxxxx: 132
	at org.postgresql.core.UTF8Encoding.decode(UTF8Encoding.java:104)
	at org.postgresql.core.PGStream.ReceiveString(PGStream.java:331)
	at
org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:705)
	at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
	... 90 more
]]

I downloaded the sources of the JDBC driver to find out where the error
comes from. It turned out, that the exception is thrown when the JDBC driver
cannot parse the error message from the DB server. Thus, I don't ever get to
see the original error message.

As mentioned above, setting the locale to English allowed me to see the
error and fix it quickly. However, it would be nice, if the error messages
could be parsed in any language.

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

P.S. This has nothing to do with the reported bug, however it might be a bug
in its own right. While the configuration was still as shown in the
prerequisites section, occasionally the JDBC connection would work, about
30% of the time, on a seemingly random basis.


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


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

* Re: [BUGS] BUG #14166: JDBC driver won't parse error message from DB server in German
@ 2016-06-01 00:23  Michael Paquier <michael.paquier@gmail.com>
  parent: davygora@sulzer.de
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Paquier @ 2016-06-01 00:23 UTC (permalink / raw)
  To: davygora@sulzer.de; +Cc: pgsql-jdbc

On Tue, May 31, 2016 at 11:32 PM,  <davygora@sulzer.de> wrote:
> The following bug has been logged on the website:
>
> Bug reference:      14166
> Logged by:          Yuriy Davygora
> Email address:      davygora@sulzer.de
> PostgreSQL version: 9.5.3
> Operating system:   Windows 7 64 bit
> Description:
>
> Prerequisites (all local, no remote servers):
>   - PostgreSQL DB 9.5.3 with locale German_Germany.1252
>   - PostgreSQL JDBC driver postgresql-9.4.1208.jar (jre8)
>   - Payara JEE server 4.1.1.161.1
>   - Oracle JDK 1.8.0_72
>   - Misconfiguration of the JDBC connection in the domain.xml file causing
> the DB connection error (see below)
>
> The JDBC driver provides a property 'DatabaseName' which I set to the
> correct database name which is different from the user name. Here is an
> excerpt from domain.xml:
>
>   <property name="DatabaseName" value="database_name"></property>
>   <property name="User" value="user_name"></property>
>   <property name="PortNumber" value="5432"></property>
>   <property name="Url" value="jdbc:postgresql://localhost/"></property>
>
> --------------------------
>
> Bug description:
>
> The DB connection error was "database does not exist" (which I found out
> after switching the locale from German to English). To fix I had to include
> the database name in the URL as follows:
>
>   <property name="Url"
> value="jdbc:postgresql://localhost/database_name?"></property>
>
> While the locale of the DB server was still set to German, however, I did
> get a different message. Here is an excerpt from the stacktrace:
>
> Caused by: java.io.IOException: Ungültige UTF-8-Sequenz: das erste Byte ist
> 10xxxxxx: 132
>         at org.postgresql.core.UTF8Encoding.decode(UTF8Encoding.java:104)
>         at org.postgresql.core.PGStream.ReceiveString(PGStream.java:331)
>         at
> org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:705)
>         at
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
>         ... 90 more
> ]]
>
> I downloaded the sources of the JDBC driver to find out where the error
> comes from. It turned out, that the exception is thrown when the JDBC driver
> cannot parse the error message from the DB server. Thus, I don't ever get to
> see the original error message.
>
> As mentioned above, setting the locale to English allowed me to see the
> error and fix it quickly. However, it would be nice, if the error messages
> could be parsed in any language.
>
> --------------------------
>
> P.S. This has nothing to do with the reported bug, however it might be a bug
> in its own right. While the configuration was still as shown in the
> prerequisites section, occasionally the JDBC connection would work, about
> 30% of the time, on a seemingly random basis.

This does not seem related to Postgres itself, but to the JDBC driver,
so I switched the report to pgsql-jdbc.
-- 
Michael


-- 
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] 5+ messages in thread

* Re: [BUGS] BUG #14166: JDBC driver won't parse error message from DB server in German
@ 2016-06-01 08:20  Davygora, Yuriy <Yuriy.Davygora@sulzer.de>
  parent: Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Davygora, Yuriy @ 2016-06-01 08:20 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: pgsql-jdbc

_____________________________________________________________________

  Hello Michael,

  thank you for your feedback. I would like, however, to express a slight doubt in your conclusion, if I may. Apparently it is the server that is sending a malformed byte sequence, because, as far as I can see, the method org.postgresql.core.UTF8Encoding. decode(byte[] data, int offset, int length) in the driver does its job just fine: if it gets a correct byte sequence for a UTF-8 string it produces a correct UTF-8 string.  So my naive assumption would be that it is the server which is sending a malformed byte sequence. I might, however be wrong, because I am overlooking something.

  Best regards,
  Yuriy



_______________________________________________________
Sulzer GmbH
Geschaeftsfuehrende Gesellschafter: Dr. Johann Sulzer, Albert Euba, Thomas Kahabka
Geschaeftsfuehrer: Angelika Rudolph, Harald Lothspeich
Sitz und Registergericht: Stuttgart HRB 7608
http://www.sulzer.de

-----Ursprüngliche Nachricht-----
Von: Michael Paquier [mailto:michael.paquier@gmail.com]
Gesendet: Mittwoch, 1. Juni 2016 02:23
An: Davygora, Yuriy <Yuriy.Davygora@sulzer.de>
Cc: PostgreSQL mailing lists <pgsql-jdbc@postgresql.org>
Betreff: Re: [BUGS] BUG #14166: JDBC driver won't parse error message from DB server in German

On Tue, May 31, 2016 at 11:32 PM,  <davygora@sulzer.de> wrote:
> The following bug has been logged on the website:
>
> Bug reference:      14166
> Logged by:          Yuriy Davygora
> Email address:      davygora@sulzer.de
> PostgreSQL version: 9.5.3
> Operating system:   Windows 7 64 bit
> Description:
>
> Prerequisites (all local, no remote servers):
>   - PostgreSQL DB 9.5.3 with locale German_Germany.1252
>   - PostgreSQL JDBC driver postgresql-9.4.1208.jar (jre8)
>   - Payara JEE server 4.1.1.161.1
>   - Oracle JDK 1.8.0_72
>   - Misconfiguration of the JDBC connection in the domain.xml file
> causing the DB connection error (see below)
>
> The JDBC driver provides a property 'DatabaseName' which I set to the
> correct database name which is different from the user name. Here is
> an excerpt from domain.xml:
>
>   <property name="DatabaseName" value="database_name"></property>
>   <property name="User" value="user_name"></property>
>   <property name="PortNumber" value="5432"></property>
>   <property name="Url"
> value="jdbc:postgresql://localhost/"></property>
>
> --------------------------
>
> Bug description:
>
> The DB connection error was "database does not exist" (which I found
> out after switching the locale from German to English). To fix I had
> to include the database name in the URL as follows:
>
>   <property name="Url"
> value="jdbc:postgresql://localhost/database_name?"></property>
>
> While the locale of the DB server was still set to German, however, I
> did get a different message. Here is an excerpt from the stacktrace:
>
> Caused by: java.io.IOException: Ungültige UTF-8-Sequenz: das erste
> Byte ist
> 10xxxxxx: 132
>         at org.postgresql.core.UTF8Encoding.decode(UTF8Encoding.java:104)
>         at org.postgresql.core.PGStream.ReceiveString(PGStream.java:331)
>         at
> org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:705)
>         at
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
>         ... 90 more
> ]]
>
> I downloaded the sources of the JDBC driver to find out where the
> error comes from. It turned out, that the exception is thrown when the
> JDBC driver cannot parse the error message from the DB server. Thus, I
> don't ever get to see the original error message.
>
> As mentioned above, setting the locale to English allowed me to see
> the error and fix it quickly. However, it would be nice, if the error
> messages could be parsed in any language.
>
> --------------------------
>
> P.S. This has nothing to do with the reported bug, however it might be
> a bug in its own right. While the configuration was still as shown in
> the prerequisites section, occasionally the JDBC connection would
> work, about 30% of the time, on a seemingly random basis.

This does not seem related to Postgres itself, but to the JDBC driver, so I switched the report to pgsql-jdbc.
--
Michael


-- 
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] 5+ messages in thread

* Re: Re: [BUGS] BUG #14166: JDBC driver won't parse error message from DB server in German
@ 2016-06-01 11:09  Dave Cramer <pg@fastcrypt.com>
  parent: Davygora, Yuriy <Yuriy.Davygora@sulzer.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Dave Cramer @ 2016-06-01 11:09 UTC (permalink / raw)
  To: Davygora, Yuriy <Yuriy.Davygora@sulzer.de>; +Cc: Michael Paquier <michael.paquier@gmail.com>; pgsql-jdbc

Yuri,

Thanks for looking at this.

Can you subscribe to the pgsql-jdbc mailing list. Your email was held up
until I could approve it

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 1 June 2016 at 04:20, Davygora, Yuriy <Yuriy.Davygora@sulzer.de> wrote:

> _____________________________________________________________________
>
>   Hello Michael,
>
>   thank you for your feedback. I would like, however, to express a slight
> doubt in your conclusion, if I may. Apparently it is the server that is
> sending a malformed byte sequence, because, as far as I can see, the method
> org.postgresql.core.UTF8Encoding. decode(byte[] data, int offset, int
> length) in the driver does its job just fine: if it gets a correct byte
> sequence for a UTF-8 string it produces a correct UTF-8 string.  So my
> naive assumption would be that it is the server which is sending a
> malformed byte sequence. I might, however be wrong, because I am
> overlooking something.
>
>   Best regards,
>   Yuriy
>
>
>
> _______________________________________________________
> Sulzer GmbH
> Geschaeftsfuehrende Gesellschafter: Dr. Johann Sulzer, Albert Euba, Thomas
> Kahabka
> Geschaeftsfuehrer: Angelika Rudolph, Harald Lothspeich
> Sitz und Registergericht: Stuttgart HRB 7608
> http://www.sulzer.de
>
> -----Ursprüngliche Nachricht-----
> Von: Michael Paquier [mailto:michael.paquier@gmail.com]
> Gesendet: Mittwoch, 1. Juni 2016 02:23
> An: Davygora, Yuriy <Yuriy.Davygora@sulzer.de>
> Cc: PostgreSQL mailing lists <pgsql-jdbc@postgresql.org>
> Betreff: Re: [BUGS] BUG #14166: JDBC driver won't parse error message from
> DB server in German
>
> On Tue, May 31, 2016 at 11:32 PM,  <davygora@sulzer.de> wrote:
> > The following bug has been logged on the website:
> >
> > Bug reference:      14166
> > Logged by:          Yuriy Davygora
> > Email address:      davygora@sulzer.de
> > PostgreSQL version: 9.5.3
> > Operating system:   Windows 7 64 bit
> > Description:
> >
> > Prerequisites (all local, no remote servers):
> >   - PostgreSQL DB 9.5.3 with locale German_Germany.1252
> >   - PostgreSQL JDBC driver postgresql-9.4.1208.jar (jre8)
> >   - Payara JEE server 4.1.1.161.1
> >   - Oracle JDK 1.8.0_72
> >   - Misconfiguration of the JDBC connection in the domain.xml file
> > causing the DB connection error (see below)
> >
> > The JDBC driver provides a property 'DatabaseName' which I set to the
> > correct database name which is different from the user name. Here is
> > an excerpt from domain.xml:
> >
> >   <property name="DatabaseName" value="database_name"></property>
> >   <property name="User" value="user_name"></property>
> >   <property name="PortNumber" value="5432"></property>
> >   <property name="Url"
> > value="jdbc:postgresql://localhost/"></property>
> >
> > --------------------------
> >
> > Bug description:
> >
> > The DB connection error was "database does not exist" (which I found
> > out after switching the locale from German to English). To fix I had
> > to include the database name in the URL as follows:
> >
> >   <property name="Url"
> > value="jdbc:postgresql://localhost/database_name?"></property>
> >
> > While the locale of the DB server was still set to German, however, I
> > did get a different message. Here is an excerpt from the stacktrace:
> >
> > Caused by: java.io.IOException: Ungültige UTF-8-Sequenz: das erste
> > Byte ist
> > 10xxxxxx: 132
> >         at org.postgresql.core.UTF8Encoding.decode(UTF8Encoding.java:104)
> >         at org.postgresql.core.PGStream.ReceiveString(PGStream.java:331)
> >         at
> >
> org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:705)
> >         at
> >
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
> >         ... 90 more
> > ]]
> >
> > I downloaded the sources of the JDBC driver to find out where the
> > error comes from. It turned out, that the exception is thrown when the
> > JDBC driver cannot parse the error message from the DB server. Thus, I
> > don't ever get to see the original error message.
> >
> > As mentioned above, setting the locale to English allowed me to see
> > the error and fix it quickly. However, it would be nice, if the error
> > messages could be parsed in any language.
> >
> > --------------------------
> >
> > P.S. This has nothing to do with the reported bug, however it might be
> > a bug in its own right. While the configuration was still as shown in
> > the prerequisites section, occasionally the JDBC connection would
> > work, about 30% of the time, on a seemingly random basis.
>
> This does not seem related to Postgres itself, but to the JDBC driver, so
> I switched the report to pgsql-jdbc.
> --
> Michael
>
>
> --
> 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] 5+ messages in thread

* Re: Re: [BUGS] BUG #14166: JDBC driver won't parse error message from DB server in German
@ 2016-06-01 11:23  Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Vladimir Sitnikov @ 2016-06-01 11:23 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; Davygora, Yuriy <Yuriy.Davygora@sulzer.de>; +Cc: Michael Paquier <michael.paquier@gmail.com>; pgsql-jdbc

I think the issue duplicates https://github.com/pgjdbc/pgjdbc/issues/165 (Send
client-encoding in startup packet not SET)

Vladimir

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


end of thread, other threads:[~2016-06-01 11:23 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-05-31 14:32 BUG #14166: JDBC driver won't parse error message from DB server in German davygora@sulzer.de
2016-06-01 00:23 ` Michael Paquier <michael.paquier@gmail.com>
2016-06-01 08:20   ` Davygora, Yuriy <Yuriy.Davygora@sulzer.de>
2016-06-01 11:09     ` Dave Cramer <pg@fastcrypt.com>
2016-06-01 11:23       ` Vladimir Sitnikov <sitnikov.vladimir@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