mod_security:無法上傳大型檔案/資產

本文提供更新至最新版mod_security,解決您必須上傳大型檔案/資產的問題。

說明 description

環境

Adobe Experience Manager

問題/症狀

mod_security版本9無法上傳大型檔案/資產。 需要透過導覽到作者(繞過Dispatcher)來上傳。

使用者可在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)

Dispatcher記錄中會顯示下列專案:

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.

Apache記錄檔中會顯示下列內容:

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

更新至mod_security的最新版本。

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f