SAP Knowledge Base Article - Preview

3507186 - Apache return 502 response code even if the application return other response code while upload file size exceeded

Symptom

When you upload file which exceeded max limit size. The MaxUploadSizeExceededException will be thrown. And the Application(Tomcat) will return the 500 response code or other response code defined by you. It could be 413 or 400. But the Apache server response to the Client as 502 - Bad Gateway.

Below are the logs in Apache side and Application(Tomcat) side.

Logs in Apache

{"localServerName": "acc.cp96avkh5f-customers1-s3-public.model-t.cc.commerce.ondemand.com", "remoteHost": "193.16.224.5", "x_forwarded_for": "-",  "True-Client-IP": "-", "X-TOUS-CHANNEL": "1", "identdUsername": "-", "remoteUser": "-", "time": "[13/Aug/2024:05:25:01 +0000]", "requestFirstLine": "POST /electronics/en/import/csv/saved-cart HTTP/1.1", "status": "502", "bytes": "232", "referer": "https://acc.cp96avkh5f-customers1-s3-public.model-t.cc.commerce.ondemand.com/electronics/en/import/csv/saved-cart", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36", "responseTime":9226808}

[Tue Aug 13 05:25:04.413752 2024] [proxy:error] [pid 36110:tid 123777318714168] (32)Broken pipe: [client 193.16.224.5:12402] AH01084: pass request body failed to 10.245.9.17:8081 (10.245.9.17), referer https://acc.cp96avkh5f-customers1-s3-public.model-t.cc.commerce.ondemand.com/electronics/en/import/csv/saved-cart

[Tue Aug 13 05:25:04.413797 2024] [proxy_http:error] [pid 36110:tid 123777318714168] [client 193.16.224.5:12402] AH01097: pass request body failed to 10.245.9.17:8081 (10.245.9.17) from 193.16.224.5 (), referer https://acc.cp96avkh5f-customers1-s3-public.model-t.cc.commerce.ondemand.com/electronics/en/import/csv/saved-cart

Logs in Storefront

{"origin":"access-log","timeMillis":1723526701449,"thread":"hybrisHTTP11","contextMap":{"remoteHost":"10.245.8.11","remoteUser":null,"requestLine":"POST /electronics/en/import/csv/saved-cart HTTP/1.1","statusCode":500,"bytesSent":165,"processMillis":47,"commitMillis":47,"connectionStatus":"-"}}

{"origin":"catalina","timeMillis":1723526701448,"thread":"hybrisHTTP11","level":"SEVERE","loggerName":"org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[DispatcherServlet]","threadId":330,"threadPriority":5,"message":"Servlet.service() for servlet [DispatcherServlet] in context with path [] threw exception [Error while processing internal filterchain. Exception occurred at chain position: 11 of 17. Current filter: 'de.hybris.platform.yacceleratorstorefront.filters.FileUploadFilter@72158dec'!; nested exception is org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size of 11240 bytes exceeded; nested exception is org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (11611562) exceeds the configured maximum (11240)] with root cause","contextMap":{"sourceClassName":"org.apache.catalina.core.StandardWrapperValve","sourceMethodName":"invoke"},"thrown":{"localizedMessage":"the request was rejected because its size (11611562) exceeds the configured maximum (11240)","message":"the request was rejected because its size (11611562) exceeds the configured maximum (11240)","name":"org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException","extendedStackTrace":[{"class":"org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl","method":"<init>","file":"FileUploadBase.java","line":1007},{"class":"org.apache.commons.fileupload.FileUploadBase","method":"getItemIterator","file":"FileUploadBase.java","line":334},{"class":"org.apache.commons.fileupload.FileUploadBase","method":"parseRequest","file":"FileUploadBase.java","line":358},{"class":"org.apache.commons.fileupload.servlet.ServletFileUpload","method":"parseRequest","file":"ServletFileUpload.java","line":113},{"class":"org.springframework.web.multipart.commons.CommonsMultipartResolver","method":"parseRequest","file":"CommonsMultipartResolver.java","line":192},{"class":"org.springframework.web.multipart.commons.CommonsMultipartResolver","method":"resolveMultipart","file":"CommonsMultipartResolver.java","line":176},{"class":"org.springframework.web.multipart.support.MultipartFilter","method":"doFilterInternal","file":"MultipartFilter.java","line":115},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"de.hybris.platform.yacceleratorstorefront.filters.FileUploadFilter","method":"doFilterInternal","file":"FileUploadFilter.java","line":35},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.yacceleratorstorefront.filters.UrlEncoderFilter","method":"doFilterInternal","file":"UrlEncoderFilter.java","line":67},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.yacceleratorstorefront.filters.StorefrontFilter","method":"doFilterInternal","file":"StorefrontFilter.java","line":69},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.yacceleratorstorefront.filters.cms.CMSSiteFilter","method":"doFilterInternal","file":"CMSSiteFilter.java","line":93},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.servicelayer.web.PolyglotPersistenceCallbackFilter","method":"doFilter","file":"PolyglotPersistenceCallbackFilter.java","line":36},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.yacceleratorstorefront.filters.RequestLoggerFilter","method":"doFilterInternal","file":"RequestLoggerFilter.java","line":64},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.yacceleratorstorefront.filters.AcceleratorAddOnFilter","method":"doFilter","file":"AcceleratorAddOnFilter.java","line":83},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.servicelayer.web.WebAppMediaFilter","method":"doFilter","file":"WebAppMediaFilter.java","line":161},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.servicelayer.web.session.stale.impl.DefaultStaleSessionCheckingFilterChain","method":"filterWithStaleSessionChecking","file":"DefaultStaleSessionCheckingFilterChain.java","line":92},{"class":"de.hybris.platform.servicelayer.web.session.stale.impl.DefaultStaleSessionCheckingFilterChain","method":"doFilter","file":"DefaultStaleSessionCheckingFilterChain.java","line":58},{"class":"de.hybris.platform.servicelayer.web.SessionFilter","method":"doFilterInternal","file":"SessionFilter.java","line":122},{"class":"de.hybris.platform.servicelayer.web.SessionFilter","method":"doFilter","file":"SessionFilter.java","line":84},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.servicelayer.web.Log4JFilter","method":"doFilter","file":"Log4JFilter.java","line":37},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.servicelayer.web.session.NoSessionRepositoryFilter","method":"doFilter","file":"NoSessionRepositoryFilter.java","line":28},{"class":"de.hybris.platform.servicelayer.web.session.HybrisSpringSessionFilter","method":"doFilterWithSessionRepository","file":"HybrisSpringSessionFilter.java","line":78},{"class":"de.hybris.platform.servicelayer.web.session.HybrisSpringSessionFilter","method":"doFilter","file":"HybrisSpringSessionFilter.java","line":63},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain","method":"doFilter","file":"AbstractPlatformFilterChain.java","line":308},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain","method":"processStandardFilterChain","file":"AbstractPlatformFilterChain.java","line":216},{"class":"de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain","method":"doFilterInternal","file":"AbstractPlatformFilterChain.java","line":193},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"de.hybris.platform.yacceleratorstorefront.filters.UrlPathFilter","method":"doFilterInternal","file":"UrlPathFilter.java","line":75},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"org.springframework.web.filter.DelegatingFilterProxy","method":"invokeDelegate","file":"DelegatingFilterProxy.java","line":354},{"class":"org.springframework.web.filter.DelegatingFilterProxy","method":"doFilter","file":"DelegatingFilterProxy.java","line":267},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"internalDoFilter","file":"ApplicationFilterChain.java","line":178},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"doFilter","file":"ApplicationFilterChain.java","line":153},{"class":"org.apache.tomcat.websocket.server.WsFilter","method":"doFilter","file":"WsFilter.java","line":51},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"internalDoFilter","file":"ApplicationFilterChain.java","line":178},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"doFilter","file":"ApplicationFilterChain.java","line":153},{"class":"org.springframework.web.filter.CharacterEncodingFilter","method":"doFilterInternal","file":"CharacterEncodingFilter.java","line":201},{"class":"org.springframework.web.filter.OncePerRequestFilter","method":"doFilter","file":"OncePerRequestFilter.java","line":117},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"internalDoFilter","file":"ApplicationFilterChain.java","line":178},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"doFilter","file":"ApplicationFilterChain.java","line":153},{"class":"de.hybris.platform.yacceleratorstorefront.filters.AcceleratorAddOnFilter","method":"doFilter","file":"AcceleratorAddOnFilter.java","line":83},{"class":"org.springframework.web.filter.DelegatingFilterProxy","method":"invokeDelegate","file":"DelegatingFilterProxy.java","line":354},{"class":"org.springframework.web.filter.DelegatingFilterProxy","method":"doFilter","file":"DelegatingFilterProxy.java","line":267},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"internalDoFilter","file":"ApplicationFilterChain.java","line":178},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"doFilter","file":"ApplicationFilterChain.java","line":153},{"class":"de.hybris.platform.servicelayer.web.XSSFilter","method":"processPatternsAndDoFilter","file":"XSSFilter.java","line":351},{"class":"de.hybris.platform.servicelayer.web.XSSFilter","method":"doFilter","file":"XSSFilter.java","line":299},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"internalDoFilter","file":"ApplicationFilterChain.java","line":178},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"doFilter","file":"ApplicationFilterChain.java","line":153},{"class":"org.apache.catalina.core.StandardWrapperValve","method":"invoke","file":"StandardWrapperValve.java","line":168},{"class":"org.apache.catalina.core.StandardContextValve","method":"invoke","file":"StandardContextValve.java","line":90},{"class":"org.apache.catalina.authenticator.AuthenticatorBase","method":"invoke","file":"AuthenticatorBase.java","line":481},{"class":"org.apache.catalina.core.StandardHostValve","method":"invoke","file":"StandardHostValve.java","line":130},{"class":"org.apache.catalina.valves.RemoteIpValve","method":"invoke","file":"RemoteIpValve.java","line":765},{"class":"org.apache.catalina.valves.AbstractAccessLogValve","method":"invoke","file":"AbstractAccessLogValve.java","line":670},{"class":"de.hybris.tomcat.StoreJvmRouteAsContextParameterValve","method":"invoke","file":"StoreJvmRouteAsContextParameterValve.java","line":44},{"class":"org.apache.catalina.valves.ErrorReportValve","method":"invoke","file":"ErrorReportValve.java","line":93},{"class":"org.apache.catalina.core.StandardEngineValve","method":"invoke","file":"StandardEngineValve.java","line":74},{"class":"org.apache.catalina.connector.CoyoteAdapter","method":"service","file":"CoyoteAdapter.java","line":346},{"class":"org.apache.coyote.http11.Http11Processor","method":"service","file":"Http11Processor.java","line":390},{"class":"org.apache.coyote.AbstractProcessorLight","method":"process","file":"AbstractProcessorLight.java","line":63},{"class":"org.apache.coyote.AbstractProtocol$ConnectionHandler","method":"process","file":"AbstractProtocol.java","line":928},{"class":"org.apache.tomcat.util.net.NioEndpoint$SocketProcessor","method":"doRun","file":"NioEndpoint.java","line":1794},{"class":"org.apache.tomcat.util.net.SocketProcessorBase","method":"run","file":"SocketProcessorBase.java","line":52},{"class":"org.apache.tomcat.util.threads.ThreadPoolExecutor","method":"runWorker","file":"ThreadPoolExecutor.java","line":1191},{"class":"org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker","method":"run","file":"ThreadPoolExecutor.java","line":659},{"class":"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable","method":"run","file":"TaskThread.java","line":63},{"class":"java.lang.Thread","method":"run","file":"Thread.java","line":840}]}}

We could check the response code in Distributed trace in Dynatrace as well.


Read more...

Environment

SAP Commerce Cloud

Product

SAP Commerce Cloud 2205 ; SAP Commerce Cloud 2211

Keywords

Apache, 502, Tomcat, response code, maxSwallowSize, Upload file , KBA , CEC-SCC-CLA-ENV-EMG , Environment Management , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.