RE: Custom S3 Plugin

Chandrashekar NM, modified 6 Years ago. New Member Posts: 24 Join Date: 4/30/15 Recent Posts
Hello,
We have our Liferay DXP 7.0 Instances running in Clustered mode deployed in AWS Cloud. We have Liferay's document storage in AWS S3.
Due to recent Organizational policy updates, we cannot store the AWS Secret Key as plain text in cfg file or in Database.
So for that, we took the S3 implementation of Liferay and have overridden the S3Store class. In this class the Secret Key is decrypted and then used as normal S3Store implementation of Liferay.
We have added the following property in portal-ext.properties and also in cfg file in /osgi/configs
dl.store.impl = <custom s3store></custom>

The implementation is working as expected but we observed that we are getting following exception related to AWS S3 in one of the custom portlet where we use Documents and Media Library features
com.liferay.portal.kernel.exception.SystemException: Failed to reset the input stream;&nbsp; If the request involves an input stream, the maximum stream buffer size can be configured via request.getRequestClientOptions().setReadLimit(int)
Please let me know if I have missed anything or we need to make any additional configurations for fixing this issue.
Thansk & regards,
Chandrashekar NM
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Chandrashekar NM:

 The implementation is working as expected but we observed that we are getting following exception related to AWS S3 in one of the custom portlet where we use Documents and Media Library features
An exception is useful with a bit of context from the stacktrace that accompanies it - at least down to your custom servlet. Some context from that custom servlet would also be good.
Do you also observe the same behavior with the stock S3Store implementation?
Which (exact) version are you on? (e.g. please state the fixpack that you have installed)
Chandrashekar NM, modified 6 Years ago. New Member Posts: 24 Join Date: 4/30/15 Recent Posts
HI Olaf,
Thanks for your reply.
Please find attached logs for your reference.
The same behavior was not seen until this plugin was deployed and configured to be used by Liferay. We have not reverted to the default still as we have some dependency.
Our servers are running on liferay-dxp-digital-enterprise-7.0-ga1 patched with de-36 fix-pack level.
Thanks & Regards,
Chandrashekar
thumbnail
Christoph Rabel, modified 6 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
The exception obviously happens in your code:
        at com.xyz.portal.store.s3.S3Store.transform(S3Store.java:736)
Did you try to google it?
"Caused by: com.amazonaws.ResetException: Failed to reset the input stream;  If the request involves an input stream, the maximum stream buffer size can be configured via request.getRequestClientOptions().setReadLimit(int)"
Not sure, if it helps, but I get e.g. this result:
https://stackoverflow.com/questions/55629623/why-we-need-to-setreadlimitint-in-aws-s3-java-client
Chandrashekar NM, modified 6 Years ago. New Member Posts: 24 Join Date: 4/30/15 Recent Posts
Hi
Have already seen this link and tried setting up the values both in the cfg[inside osgi/configs] file and also in System Settings[Foundation -> S3 Store Configuration]
  • Minimum Part Size = 5242880 [In System Settings]
    
  • minimumUploadPartSize = 5242880 [com.xyz.portal.store.s3.configuration.S3StoreConfiguration-default]
    
But the result is still the same.
Am I missing any any other configurations?
Thanks & Regards,
Chandrashekar NM