[syslog-ng] Encoding provlem when writing to postg res

Paul Robert Marino prmarino1 at gmail.com
Wed Oct 15 12:57:15 CEST 2008


I've seen this with other web based apps.
It usualy happens when tere is a control character in the text
unfortunitly most text editors will simply ignore the character so it makes it hard to diagnose. If this is only happening with email related messages (which is not un-common) you may need to handle it at your mail server. Specificlty in the perl script that apears to be generating the message. Here is a regex I've used in the past in webforms  where people would often copy and past fields from outlook that helped with the same error s/\P{IsPrint}//g this regex will strip out any characters that are not unicode printable. 


-----Original Message-----

From:  ml at bortal.de
Subj:  [syslog-ng] Encoding provlem when writing to postg res
Date:  Wed Oct 15, 2008 3:53 am
Size:  1K
To:  syslog-ng at lists.balabit.hu

Hello List,

i get the following error when i try to write to postres:

Error running SQL query; type='pgsql', host='XXX', port='', user='XXX',
database='syslogng', error='ERROR:  invalid byte sequence for encoding
"UTF8": 0xe96461\x0aHINT:  This error can also happen if the byte
sequence does not match the encoding expected by the server, which is
controlled by "client_encoding".\x0a', query='INSERT INTO msg_table
(msg_rcv_time, msg_sent_time, hostname, msg_facility, msg_priority,
msg_text) VALUES (\'2008-10-14T19:59:46+02:00\',
\'2008-10-14T19:59:46+02:00\', \'foo\', \'mail\', \'warning\',
\'mimedefang.pl[3497]: Message contains more than one Subject: header:
Bulletin d\\\'\'info d\\\'\'Enseigner.TV et la fiche p\xffdagogique de
l\\\'\'\xffmission du  mois \xff 14 octobre 208 --> Bulletin d\\\'\'info
d\\\'\'Enseigner.TV et la fiche p\xffdagogique de l\\\'\'\xffmission du 
mois \xff 14 octobre 208\')'


How can i fix this? I am running postgresql-8.1 with Debian 4.0.

Thanks,
Mario



______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.campin.net/syslog-ng/faq.html




More information about the syslog-ng mailing list