Error Code 403 Forbidden: Timeout Issues when uploading/downloading Large Files to S3
written-by
Santhosh Kumar
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
legacy-article
learn-legacy-article-disclaimer-text
Issue
- Experiencing timeout and permission issues when uploading/downloading large files (in GBs) using Liferay's simple file system.
ERROR [http-nio-0.0.0.0-8080-exec-41][PortletServlet:109] Unable to process portlet com_liferay_document_library_web_portlet_DLAdminPortlet: com.liferay.portal.kernel.exception.SystemException: {errorCode=403 Forbidden, errorType=Client, message=Forbidden (Service: Amazon S3; Status Code: 403; Error Code: 403 Forbidden; Request ID: null; S3 Extended Request ID: null; Proxy: null), requestId=null, statusCode=403}
javax.portlet.PortletException: com.liferay.portal.kernel.exception.SystemException: {errorCode=403 Forbidden, errorType=Client, message=Forbidden (Service: Amazon S3; Status Code: 403; Error Code: 403 Forbidden; Request ID: null; S3 Extended Request ID: null; Proxy: null), requestId=null, statusCode=403}
Environment
- Liferay DXP 7.4
- AWS S3
- CloudFront
Resolution
- Large files getting stuck during upload could be caused by incorrect S3 permissions or timeouts between CloudFront and the application server.
- Check the permissions of S3 bucket policies. Refer to this documentation to ensure the user or role used by Liferay DXP has the required permissions.
- Verify CloudFront configurations for potential issues.
- Increase the
multipartUploadThreshold
value in the S3 configuration to a larger amount (e.g., 2GB). The optimal value depends on network conditions and server resources.
- For timeout issues with large files (>2GB) or multiple uploads, increase timeout settings in both CloudFront (Origin Response Timeout, Keep-alive Timeout, Origin Connection Timeout) and Tomcat's
<Connector>
in server.xml (e.g., connectionTimeout="600000"
).
- Enable debug logging for
com.liferay.portal.upload.UploadServletRequestImpl
to identify timeouts, permission errors, or other issues related to the upload process.
- If issues persist when using CloudFront, bypass it temporarily and test direct access to the application and S3 to identify if CloudFront is contributing to the timeouts.
- If the issue is isolated to CloudFront, reach out to the infrastructure or AWS support team for further investigation.
Additional Information
did-this-article-resolve-your-issue