a Picture upload error in 5.8 HF05

After the picture upload there is no preview of it. In the logfile is recorded:

2014-01-31 18:26:30,701 WARN [Transaction] Error ending association for XAResource org.apache.geronimo.transaction.manager.WrapperNamedXAResource@4e3d3e45; transaction will roll back. XA error code: -3 javax.transaction.xa.XAException

...

Caused by: org.nuxeo.ecm.core.storage.StorageException: Could not insert: INSERT INTO “image_metadata” (“id”, “icc_profile”, “white_balance”, “pixel_xdimension”, “yresolution”, “copyright”, “color_space”, “date_time_original”, “orientation”, “xresolution”, “user_comment”, “image_description”, “pixel_ydimension”, “iso_speed_ratings”, “equipment”, “fnumber”, “focal_length”, “exposure_time”) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.insertSimpleRows(JDBCRowMapper.java:606)
...

Caused by: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO “image_metadata” (“id”, “icc_profile”, “white_balance”, “pixel_xdimension”, “yresolution”, “copyright”, “color_space”, “date_time_original”, “orientation”, “xresolution”, “user_comment”, “image_description”, “pixel_ydimension”, “iso_speed_ratings”, “equipment”, “fnumber”, “focal_length”, “exposure_time”) VALUES ('c85a74b1-f253-441e-bdcf-d440a2aef14f', NULL, 'auto', 3264, 72, NULL, 'SRGB', '2014-01-31 10:43:44.000000 +01:00:00', 'TOP_LEFT', 72, 'KJKJAKJKJAďż˝ecuteBatch(AbstractJdbc2Statement.java:2893)

at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.insertSimpleRows(JDBCRowMapper.java:590)
... 20 more

Caused by: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding “UTF8”: 0x00

at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
... 25 more
0 votes

1 answers

1842 views

ANSWER

The stack trace is incomplete at the end, we're missing a detailed cause.
01/31/2014

I updated the original question with your stack trace. Please don't use the answers section to post things that are not answers.
01/31/2014



The cause is:

ERROR: invalid byte sequence for encoding "UTF8": 0x00

So one of the strings that is passed contains a U+0000 character, which PostgreSQL forbids. Which string exactly is difficult to determine using just the logs, but it seems to be the EXIF UserComment field that contains garbage

We'll see if the strings can be sanitized a bit before being saved into the Nuxeo document. I opened NXP-13682 for this. If possible please attach to that ticket an example image for which the problem occurs (if the image can be freely distributed — if not, please send it by email to me, fg@nuxeo.com).

0 votes



I will send it by email
01/31/2014

The User-Comment metadata can be a binary. There is already an issue tracking that: https://jira.nuxeo.com/browse/NXP-13671
01/31/2014