mod_security: Unable to upload large files/assets
This article provides resolution to the issue where you have to upload large files/assets by updating to the latest version of mod_security.
Description description
Environment
Adobe Experience Manager
Issue/Symptoms
The version 9 of mod_security cannot upload large files/assets. They need to be uploaded by navigating to the author (bypassing the dispatcher).
Users see the following in the error.log:
POST /content/dam/test/folder/location/test.createasset.html HTTP/1.1]
com.day.cq.dam.api.AssetManager createAsset: repository exception while creating asset [ /content/dam/test/folder/location/test/largefile.psd]
javax.jcr.RepositoryException: java.io.IOException: org.apache.jackrabbit.core.data.DataStoreException: Error in adding record
....
Caused by: org.apache.jackrabbit.core.data.DataStoreException: Error in adding record
at org.apache.jackrabbit.oak.plugins.blob.AbstractSharedCachingDataStore.addRecord(AbstractSharedCachingDataStore.java:265)
at org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore.addRecordInternal(DataStoreBlobStore.java:821)
at org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore.writeStream(DataStoreBlobStore.java:922)
at org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore.writeBlob(DataStoreBlobStore.java:320)
... 183 common frames omitted
Caused by: org.eclipse.jetty.io.EofException: Early EOF
at org.eclipse.jetty.server.HttpInput$3.getError(HttpInput.java:1207)
at org.eclipse.jetty.server.HttpInput$3.noContent(HttpInput.java:1195)
The following is seen in the dispatcher log:
Spooling request body failed: expected 146851652 bytes, but only 134222982 received.
Spooling request body failed: expected 155287797 bytes, but only 134222313 received.
Spooling request body failed: expected 155287797 bytes, but only 134224609 received.
Spooling request body failed: expected 155287797 bytes, but only 134224235 received.
Spooling request body failed: expected 155287797 bytes, but only 134225743 received.
The following is seen in the apache log:
ModSecurity: Request body (Content-Length) is larger than the configured limit (13107200). [ hostname "hostname A"] [ uri "/content/dam/ams.createasset.html"] [ unique_id "unique id A"] , referer:https://author-tenantid-prd.adobecqms.net/assets.html/content/dam/ams
Resolution resolution
Update to the latest version of mod_security.
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f