View Issue Details

IDProjectCategoryView StatusLast Update
0008867mantisbtscriptingpublic2008-08-12 09:35
Reporterlaetitia Assigned Toryandesign  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Summary0008867: APPLICATION ERROR 0000401 while uploading files into MySQL
Description

If there is a file greater than 960Ko, I can not upload sucessfully into MySQL Server. I have the message APPLICATION ERROR 0000401

Additional Information

I try this :

In Mantis configuration file: config_defaults_inc.php or config_inc.php
$g_allow_file_upload = ON;
$g_max_file_size = 2000000; # 2 MB
$g_file_upload_method = DATABASE;

In the PHP configuration file : /etc/php.ini
upload_max_filesize = 2M

In the php Apache module : /etc/httpd/conf.d/php.conf The variable is LimitRequestBody (default to 512kB)
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 2097152
</Files>

If the update method is DATABASE, MySQL can also limit the file size
In /etc/my.cnf the variable max_allowed_packet must be defined.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable = max_allowed_packet=5000000

TagsNo tags attached.

Relationships

related to 0006063 closedgrangeway APPLICATION ERROR 0000401 on MSSQL while uploading files 
has duplicate 0008893 closedgiallu (very) big attachment crashes attachment saving into database 
has duplicate 0005193 closedgiallu Attaching a ZIP file causes an application error. 
has duplicate 0007401 closedgiallu 0000401 application error when you attached a DOC file. 
has duplicate 0009360 closedgiallu Can't upload more than 1,000 kb 
has duplicate 0008812 closedgiallu Application Error 401 on file upload 
has duplicate 0012832 closedatrol size of the attachments 
has duplicate 0006318 closeddregad APPLICATION ERROR 0000401 when uploading a file. 

Activities

laetitia

laetitia

2008-02-08 10:13

reporter   ~0016984

Mantis version : Mantis 1.1.0rc3
Bug linked to 6063

ryandesign

ryandesign

2008-02-08 13:03

reporter   ~0016986

By default, a MySQL server will reject packets over 1 MB in size. If you want to allow larger packets, you need to set max_allowed_packet to a larger value. See:

http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html

laetitia

laetitia

2008-02-11 06:10

reporter   ~0017005

I've done what was indicated in the link. It still does'nt work.
I've done the following setup :

config_inc.php (mantis)
...
$g_allow_file_upload = ON;
$g_max_file_size = 8000000;
$g_file_upload_method = DATABASE;
...

php.ini (php)
...
max_execution_time = 30
memory_limit = 16M
post_max_size = 108M
upload_max_filesize = 102M
...

my.cnf (mysql)
...
[mysqld]
socket = /tmp/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 8M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M

[mysqldump]
quick
max_allowed_packet = 16M
....

httpd.conf (apache) : (et pas dans php.conf, car php est compilé en dur, pas en module d'apache)
...
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 8192000
</Files>
....

laetitia

laetitia

2008-02-11 09:40

reporter   ~0017010

There is nothing about the problem in the apache and mysql logs.

laetitia

laetitia

2008-02-13 04:49

reporter   ~0017036

It's OK, i was reloading the mysql conf file but mysql must be restarted, otherwise the update didn't work and the default value (1Mo) is newly set.

ryandesign

ryandesign

2008-02-13 04:54

reporter   ~0017038

Ok, great! I'm glad that worked for you.