413 Request Entity Too Large when uploading file.

810 views
Skip to first unread message

gi...@shaw.ca

unread,
Feb 22, 2016, 1:06:36 PM2/22/16
to ICA-AtoM Users
I have set the limit to -1 in the Atom admin interface..

in /etc/php5/fpm/pool.d/atom.conf  I have set:

php_admin_value[upload_max_filesize = 512M

restarted both nginx and php5-fpm but still get the error above with an 80M file...

Anything else I could do ?

Thanks


Mike G

unread,
Feb 22, 2016, 3:06:22 PM2/22/16
to ICA-AtoM Users, gi...@shaw.ca
Hi,

I think maybe your client_max_body_size setting is too low in nginx. See this site on increasing it: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/

However, I strongly recommend with files that are over a few megabytes to use the CLI digitalobject:load task instead to avoid timeout/entity too large issues. There's a brief outline here: https://www.accesstomemory.org/en/docs/2.3/user-manual/import-export/csv-import/#using-the-digital-object-load-task

We'll likely be moving all import / export tasks to the job scheduler in AtoM in the near-ish future, which will make everything asynchronous and avoid some of these issues.

cheers

gi...@shaw.ca

unread,
Feb 22, 2016, 3:22:37 PM2/22/16
to ICA-AtoM Users, gi...@shaw.ca
I did all that but until I made sure that all nginx worker processes were fully shut down it did not seem to "take".

The CLI digitalobject load task requires the use of the command line. I am sure we are not the only institution that does not have staff that are comfortable with command-line usage.

Having said that, at least I will have the option to do it this way when they get stuck.

Thanks Mike.


Mike G

unread,
Feb 22, 2016, 6:01:45 PM2/22/16
to ICA-AtoM Users, gi...@shaw.ca
I agree that CLI as a workaround isn't ideal for many people. It's been on our list of things to improve for some time, and now that we have the funding for it, users should hopefully have an easier time importing things via the UI in future versions when we revamp it to make it asynchronous.

cheers

Sarah Romkey

unread,
Feb 22, 2016, 6:03:12 PM2/22/16
to ica-ato...@googlegroups.com
A great example of one of the ways in which open source software is free like a kitten, rather than free like a beer :)

Thanks for your involvement in the AtoM community,

Cheers,

Sarah

Sarah Romkey, MAS,MLIS
Archivematica Program Manager
Artefactual Systems
604-527-2056
@archivematica / @accesstomemory



--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/d00e333c-6d2d-40c3-914a-604d4f8d7d0b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

José Anjos

unread,
May 22, 2017, 9:25:50 AM5/22/17
to AtoM Users, gi...@shaw.ca
Hi. I have the same problem.

Changed:
/etc/php/7.0/fpm/pool.d/atom.conf
php_admin_value[memory_limit] = 512M
php_admin_value[max_execution_time] = 120
php_admin_value[post_max_size] = 128M
php_admin_value[upload_max_filesize] = 256M

/etc/php/7.0/fpm/php.ini
post_max_size = 128M
upload_max_filesize = 128M

Add to /etc/nginx/nginx.conf
client_max_body_size 128M;

Nothing worked. I cant upload bigger objects. I'm testing with 100Mb
Cheers,
José Anjos
Atom V.2.3.1

Dan Gillean

unread,
May 22, 2017, 10:53:47 AM5/22/17
to ICA-AtoM Users, BrzI Channel
Hi José,

If you are trying to import via the user interface, the limits could also still be in the browswer - usually browser requests will time out after about 1 minute to prevent long-running tasks from consuming resources. To solve this problem in the long-term, we would need to do some development to allow the job scheduler to handle large file imports asynchronously in the background, much as if you were uploading files via the command-line.

Note that there are 2 ways you can manage digital object imports via the command-line: via the digital object load task, or using the digitalObjectPath or digitalObjectURI columns directly in the archival description CSV templates. See:

For now, this remains the best way to add large digital objects to your AtoM site.

A couple of other reminders that might help:

If you have made changes to the php.ini default settings or to any of the AtoM configuration files, you should restart PHP-FPM after. Using Ubuntu 14.04, you can do this with:

  • sudo service php5-fpm restart

On 16.04, do this with:

  • sudo systemctl restart php7.0-fpm

The same goes for making changes to the Nginx configuration file - you'll want to reload it after:

  • 14.04: sudo service nginx reload
  • 16.04 sudo systemctl reload nginx

I would also recommend clearing the application cache:

  • php symfony cc

One other thing to double-check is that you are updating the correct php.ini file - it is possible there is more than one - one for your browser settings, and one for the command-line, for example - and the location of these files is not consistent, as it depends on a number of other factors. Here are a couple of links to help you locate the file(s) on your system - you might want to double-check to see if there are other files?

For reference for others, here is where you can find a bit more information on some of the values that José is changing:

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.

José Anjos

unread,
May 22, 2017, 11:51:09 AM5/22/17
to AtoM Users, gi...@shaw.ca
Hi Dan,
I've done everything you said and even reboot the server but didn't work.
I think it's not a time problem because when I click on Create it takes like 2 seconds to say:

413 Request Entity Too Large

I think I've change the right files and the attached image shows that the size changed from 64Mb to 256Mb.... it should work :(
Thanks for your help,
José Anjos

To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
AtomUpload.png

Dan Gillean

unread,
May 22, 2017, 12:18:31 PM5/22/17
to ICA-AtoM Users
Hi again José,

What if you just try making some of the values bigger? For example, you have the php_admin_value[upload_max_filesize] set to 256M, but most other values are set to 128M. What if you up those to 256, and reload everything?

Otherwise, I'm not sure! You might try doing a bit more searching online for answers re: php and nginx configuration.

Regards,

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.

David Juhasz

unread,
May 23, 2017, 12:56:26 PM5/23/17
to ica-ato...@googlegroups.com
Hi José,

The 413 error response you are seeing is specific to NGINX, so concentrate on the configuration for NGINX.  This post might be helpful: https://stackoverflow.com/questions/18121227/how-to-avoid-request-entity-too-large-413-error

Best regards,
David

--

David Juhasz
Director, AtoM Technical Services Artefactual Systems Inc. www.artefactual.com

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.

Gomes Silva

unread,
May 24, 2017, 7:35:10 AM5/24/17
to AtoM Users
Hello,

See if this works:

sudo nano /etc/nginx/nginx.conf

http {

##
# Basic Settings
fastcgi_read_timeout 200;
client_max_body_size 256M;
##

nginx -s reload


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.

José Anjos

unread,
May 24, 2017, 8:23:28 AM5/24/17
to AtoM Users
Ok, problem solved. I had changed /etc/nginx/nginx.conf but didn't work because Atom has is own Nginx file configuration:
/etc/nginx/sites-available/atom
client_max_body_size 256M;
Now it works. Maybe  the other configuration files also have influence but now I have everything with 256Mb for now.
Thank you very much for all help,
José Anjos
Reply all
Reply to author
Forward
0 new messages