Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-36471

Unable to upload and set company logo for the Site pages when Repository is set to Amazon S3

    Details

      Description

      I have setup my Documents Library for Amazon S3. Upload of files works fine. I'm trying to set company logo for the public and private site pages but it fails to upload and set the logo eventhough it provides option to upload logo from local file system. System reports that "Your request completed successfully.", but logo is not uploaded, there is some call to Amazon S3 logged (WARN) into the log file indicating it tries to connect to Amazon S3 and after some time SocketTimeoutException is also being thrown in the log file.

      Only workaround I have found is to revert settings back to default storage repository configuration and set company logo. After setting up of the logo configure repository back to Amazon S3.

      Steps to reproduce:
      1. Setup Liferay documents library with Amazon S3 (can follow steps here: http://blog.profiq.cz/2013/06/17/introducing-liferay-and-amazon-s3/)
      2. Restart Liferay, upload some file to Document and Media portlet to verify Amazon S3 storage works fine
      3. Setup company Logo via Control Panel -> Site Pages -> Public Pages -> Logo -> select Browse and navigate to logo file to upload
      4. Press Save
      -> it allowed me to select only from my file system, but load was against S3
      14:58:16,204 WARN [http-bio-8080-exec-31][RestStorageService:548] Error Response: PUT '/0/0/11316.png/1.0' – ResponseCode: 307, ResponseStatus: Temporary Redirect, Request Headers: [Date: Wed, 19 Jun 2013 14:58:16 GMT, Content-Type: application/octet-stream, Authorization: AWS AKIAISLS7SIOL5V2FWQA:3Wz879JiRF50d1J6JFbMh0Qtk+w=], Response Headers: [x-amz-request-id: D5D25DA2AF640395, x-amz-id-2: ImXCUrymyj9HahxMSAZq1CfUvJVwpnvhkQfQ6705nv9FdRIgTgkRTDAaMM93gPnR, Location: https://liferayrepository.s3-external-3.amazonaws.com/0%2F0%2F11316.png%2F1.0, Content-Type: application/xml, Transfer-Encoding: chunked, Date: Wed, 19 Jun 2013 14:58:18 GMT, nnCoection: close, Server: AmazonS3]

      5. Massage "Your request completed successfully." has been shown on the page, but logo itself has not been loaded. See attached screenshot.
      6. wait for couple of seconds and observe log file (for example catalina.out for Tomcat)
      -> SocketTimeOutException has been thrown and looks as below

      14:53:11,646 ERROR [http-bio-8080-exec-31][ImageImpl:66] Error reading image 10981
      com.liferay.portal.kernel.exception.SystemException: org.jets3t.service.S3ServiceException: Request Error: java.net.SocketTimeoutException: Read timed out
      at com.liferay.portlet.documentlibrary.store.S3Store.getFileAsStream(S3Store.java:176)
      at com.liferay.portlet.documentlibrary.store.BaseStore.getFileAsStream(BaseStore.java:354)
      at com.liferay.portlet.documentlibrary.store.StoreProxyImpl.getFileAsStream(StoreProxyImpl.java:153)
      at com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.getFileAsStream(SafeFileNameStoreWrapper.java:232)
      at com.liferay.portlet.documentlibrary.store.DLStoreImpl.getFileAsStream(DLStoreImpl.java:262)
      at com.liferay.portlet.documentlibrary.store.DLStoreUtil.getFileAsStream(DLStoreUtil.java:405)
      at com.liferay.portal.model.impl.ImageImpl.getTextObj(ImageImpl.java:57)
      at com.liferay.portal.webserver.WebServerServlet.getImageBytes(WebServerServlet.java:430)
      at com.liferay.portal.webserver.WebServerServlet.writeImage(WebServerServlet.java:1123)
      at com.liferay.portal.webserver.WebServerServlet.service(WebServerServlet.java:254)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:56)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.servlet.filters.header.HeaderFilter.processFilter(HeaderFilter.java:150)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: org.jets3t.service.S3ServiceException: Request Error: java.net.SocketTimeoutException: Read timed out
      at org.jets3t.service.S3Service.listObjects(S3Service.java:1484)
      at com.liferay.portlet.documentlibrary.store.S3Store.getHeadVersionLabel(S3Store.java:454)
      at com.liferay.portlet.documentlibrary.store.S3Store.getFileAsStream(S3Store.java:165)
      ... 72 more
      Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
      at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:830)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:787)
      at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
      at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
      at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
      at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
      at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
      at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
      at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
      at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
      at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
      at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
      at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
      at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
      at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:713)
      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:518)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
      at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:334)
      at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:281)
      at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRestGet(RestStorageService.java:981)
      at org.jets3t.service.impl.rest.httpclient.RestStorageService.listObjectsInternal(RestStorageService.java:1455)
      at org.jets3t.service.impl.rest.httpclient.RestStorageService.listObjectsImpl(RestStorageService.java:1414)
      at org.jets3t.service.StorageService.listObjects(StorageService.java:623)
      at org.jets3t.service.S3Service.listObjects(S3Service.java:1428)
      at org.jets3t.service.S3Service.listObjects(S3Service.java:84)
      at org.jets3t.service.StorageService.listObjects(StorageService.java:423)
      at org.jets3t.service.S3Service.listObjects(S3Service.java:1482)
      ... 74 more

        Attachments

          Activity

            People

            Assignee:
            michael.saechang Michael Saechang
            Reporter:
            rasta.profiq Rastislav Kanocz (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 years, 51 weeks, 2 days ago

                Packages

                Version Package
                7.0.0 M6