Internal Server error 500 when uploading images

You should change the server setting to increase the max_allowed_packet.

With ODK Aggregate 1.2, the MySQL datastore code was changed so that it
stored data in LONGBLOB chunks (2^32 bytes). As opposed to BLOB previously.

Apparently, this requires a change to the MySQL installation to increase
the "max_allowed_packet" size.

From the MySQL manual:

The maximum size of a BLOB or TEXT object is determined by its type, but
the largest value you actually can transmit between the client and server
is determined by the amount of available memory and the size of the
communications buffers. You can change the message buffer size by changing
the value of the
max_allowed_packethttps://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_max_allowed_packetvariable,
but you must do so for both the server and your client program.
For example, both
mysqlhttps://dev.mysql.com/doc/refman/5.6/en/mysql.htmland
mysqldump https://dev.mysql.com/doc/refman/5.6/en/mysqldump.html enable
you to change the client-side
max_allowed_packethttps://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_max_allowed_packetvalue.
See Section 8.11.2,
“Tuning Server Parameters”https://dev.mysql.com/doc/refman/5.6/en/server-parameters.html,
Section 4.5.1, “mysql — The MySQL Command-Line
Tool”https://dev.mysql.com/doc/refman/5.6/en/mysql.html,
and Section 4.5.4, “mysqldump — A Database Backup
Program”https://dev.mysql.com/doc/refman/5.6/en/mysqldump.html.
You may also want to compare the packet sizes and the size of the data
objects you are storing with the storage requirements, see Section 11.6,
“Data Type Storage
Requirements”https://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html

You must increase this value if you are using large
BLOBhttp://docs.oracle.com/cd/E17952_01/refman-5.0-en/blob.htmlcolumns
or long strings. It should be as big as the largest
BLOB http://docs.oracle.com/cd/E17952_01/refman-5.0-en/blob.html you want
to use. The protocol limit for
max_allowed_packethttp://docs.oracle.com/cd/E17952_01/refman-5.0-en/server-system-variables.html#sysvar_max_allowed_packetis
1GB. The value should be a multiple of 1024; nonmultiples are rounded
down to the nearest multiple.

When you change the message buffer size by changing the value of the
max_allowed_packethttp://docs.oracle.com/cd/E17952_01/refman-5.0-en/server-system-variables.html#sysvar_max_allowed_packetvariable,
you should also change the buffer size on the client side if your
client program permits it. On the client side,
max_allowed_packethttp://docs.oracle.com/cd/E17952_01/refman-5.0-en/server-system-variables.html#sysvar_max_allowed_packethas
a default of 1GB. Some programs such as
mysql http://docs.oracle.com/cd/E17952_01/refman-5.0-en/mysql.html and *
mysqldump*http://docs.oracle.com/cd/E17952_01/refman-5.0-en/mysqldump.htmlenable
you to change the client-side value by setting
max_allowed_packethttp://docs.oracle.com/cd/E17952_01/refman-5.0-en/server-system-variables.html#sysvar_max_allowed_packeton
the command line or in an option file.

··· --------------- Irksome. Makes me hate MySQL.

Mitch

On Tue, Aug 14, 2012 at 6:26 PM, Chien-Li Chung cchung@camelthorn.comwrote:

Hi Mitch.

I saw this error message in my tomcat6-stdout log file.

Caused by: org.springframework.dao.TransientDataAccessResourceException:
PreparedStatementCallback; SQL [INSERT INTO
odk_prod.DEMO_AUG2012_SCHOOL_IMAGE_BLB ( _URI, _CREATOR_URI_USER,
_CREATION_DATE, _LAST_UPDATE_URI_USER, _LAST_UPDATE_DATE,
_TOP_LEVEL_AURI, VALUE ) VALUES ( ?, ?, ?, ?, ?, ?, ? ) ]; Packet for
query is too large (2686969 > 1048576). You can change this value on the
server by setting the max_allowed_packet' variable.; nested exception is
com.mysql.jdbc.PacketTooBigException: Packet for query is too large
(2686969 > 1048576). You can change this value on the server by setting the
max_allowed_packet' variable.

Does this mean I just a smaller image size or change the
max_allowed_packet to 4MB?

Thanks.

/Chien-Li

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com