Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded (Error upload files to hawkbit) #2219

Closed
AlexHCom opened this issue Jan 23, 2025 · 22 comments

Comments

@AlexHCom
Copy link

When uploading a file larger than 1Mb, the following error is displayed on the screenshot

Image

The system is deployed using docker compose with the new version of images version 0.7.0 (I did not observe this problem on version 0.4.1).
I added the following parameters to hawkbit/hawkbit-update-server, but they did not help:
environment: - SPRING_HTTP_MULTIPART_FILE_SIZE_THRESHOLD=2MB - SPRING_HTTP_MULTIPART_MAX_FILE_SIZE=10MB - SPRING_HTTP_MULTIPART_MAX_REQUEST_SIZE=50MB
Can you tell me how to change the parameters to increase file uploads in docker compose in which image and what parameters to add?
P.S.: we are currently testing on the monolit version, but we plan to switch to the micro-services version

Translated with DeepL.com (free version)

@avgustinmm
Copy link
Contributor

This seem like a pure Spring exception / problem and you have to fix it by configuring Spring properly.
If the problem is with passing the properties to the docker containers when using "docker-compose" files from hawkbit you could check "Configuration" section in https://github.com/eclipse-hawkbit/hawkbit/blob/master/docker/README.md

Note that in your case the application consists of two containers - monolith update server and simple web ui server - where you get the exception? You may try to add configuration to the simple ui also (I'm not sure who exactly drops the large files).

@AlexHCom
Copy link
Author

I change parameters in docker image and have next errors:
java.lang.OutOfMemoryError: Java heap space hawkbit-simple-ui-1 | Dumping heap to java_pid1.hprof ... hawkbit-simple-ui-1 | Unable to create java_pid1.hprof: Permission denied hawkbit-simple-ui-1 | 2025-01-24T13:24:38.053Z ERROR 1 --- [spring.application.name_IS_UNDEFINED] [:] [nio-8088-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed: java.lang.OutOfMemoryError: Java heap space] with root cause hawkbit-simple-ui-1 | hawkbit-simple-ui-1 | java.lang.OutOfMemoryError: Java heap space hawkbit-simple-ui-1 | at java.base/java.util.Arrays.copyOf(Unknown Source) ~[na:na] hawkbit-simple-ui-1 | at java.base/java.io.ByteArrayOutputStream.ensureCapacity(Unknown Source) ~[na:na] hawkbit-simple-ui-1 | at java.base/java.io.ByteArrayOutputStream.write(Unknown Source) ~[na:na] hawkbit-simple-ui-1 | at java.base/java.io.OutputStream.write(Unknown Source) ~[na:na] hawkbit-simple-ui-1 | at feign.form.multipart.Output.write(Output.java:60) ~[feign-form-13.5.jar:na] hawkbit-simple-ui-1 | at feign.form.spring.SpringSingleMultipartFileWriter.write(SpringSingleMultipartFileWriter.java:48) ~[feign-form-spring-13.5.jar:na] hawkbit-simple-ui-1 | at feign.form.multipart.AbstractWriter.write(AbstractWriter.java:35) ~[feign-form-13.5.jar:na] hawkbit-simple-ui-1 | at feign.form.MultipartFormContentProcessor.process(MultipartFormContentProcessor.java:85) ~[feign-form-13.5.jar:na] hawkbit-simple-ui-1 | at feign.form.FormEncoder.encode(FormEncoder.java:101) ~[feign-form-13.5.jar:na] hawkbit-simple-ui-1 | at feign.form.spring.SpringFormEncoder.encode(SpringFormEncoder.java:80) ~[feign-form-spring-13.5.jar:na] hawkbit-simple-ui-1 | at org.springframework.cloud.openfeign.support.SpringEncoder.encode(SpringEncoder.java:108) ~[spring-cloud-openfeign-core-4.2.0.jar:4.2.0] hawkbit-simple-ui-1 | at org.springframework.cloud.openfeign.support.PageableSpringEncoder.encode(PageableSpringEncoder.java:105) ~[spring-cloud-openfeign-core-4.2.0.jar:4.2.0] hawkbit-simple-ui-1 | at feign.RequestTemplateFactoryResolver$BuildFormEncodedTemplateFromArgs.resolve(RequestTemplateFactoryResolver.java:235) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.RequestTemplateFactoryResolver$BuildTemplateByResolvingArgs.create(RequestTemplateFactoryResolver.java:107) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:48) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:104) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at jdk.proxy2/jdk.proxy2.$Proxy120.uploadArtifact(Unknown Source) ~[na:na] hawkbit-simple-ui-1 | at org.eclipse.hawkbit.ui.simple.view.SoftwareModuleView$AddArtifactsDialog.lambda$new$1412afe8$1(SoftwareModuleView.java:310) ~[classes/:0.7.0] hawkbit-simple-ui-1 | at org.eclipse.hawkbit.ui.simple.view.SoftwareModuleView$AddArtifactsDialog$$Lambda$1965/0x000079275783cd70.onComponentEvent(Unknown Source) ~[na:na] hawkbit-simple-ui-1 | at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:239) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.component.ComponentEventBus.fireEvent(ComponentEventBus.java:228) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.component.Component.fireEvent(Component.java:411) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.component.upload.Upload.fireUploadSuccess(Upload.java:478) ~[vaadin-upload-flow-24.3.7.jar:na] hawkbit-simple-ui-1 | at com.vaadin.flow.component.upload.Upload$DefaultStreamVariable.streamingFinished(Upload.java:775) ~[vaadin-upload-flow-24.3.7.jar:na] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.streamToReceiver(StreamReceiverHandler.java:563) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.handleFileUploadValidationAndData(StreamReceiverHandler.java:415) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.handleStream(StreamReceiverHandler.java:304) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.handleMultipartFileUploadFromParts(StreamReceiverHandler.java:249) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.doHandleMultipartFileUpload(StreamReceiverHandler.java:202) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.handleRequest(StreamReceiverHandler.java:162) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamRequestHandler.handleRequest(StreamRequestHandler.java:116) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1574) ~[flow-server-24.3.7.jar:24.3.7]
maybe who know how to fix this error in monolit services?

@avgustinmm
Copy link
Contributor

You could see the Docker file how the memory is configured:

ARG X_MS=768m
ENV X_MS=${X_MS}
ARG X_MX=768m
ENV X_MX=${X_MX}

so, you may increase your memory in order to do not get OOM (if it is possible - I mean for your usecase it may require too much memory).
Maybe the file is buffered in the memory - probably the impl shell be reconsidered if the file could be not be loaded in memory at once.

@AlexHCom
Copy link
Author

@avgustinmm I changed parameters:
ARG PROFILES=h2 ENV PROFILES=${PROFILES} ARG X_MS=2048m ENV X_MS=${X_MS} ARG X_MX=10240m ENV X_MX=${X_MX} ARG XX_MAX_METASPACE_SIZE=1024m ENV XX_MAX_METASPACE_SIZE=${XX_MAX_METASPACE_SIZE} ARG XX_METASPACE_SIZE=1024m ENV XX_METASPACE_SIZE=${XX_METASPACE_SIZE}
and I have next error:
hawkbit-simple-ui-1 | Caused by: feign.FeignException$InternalServerError: [500 ] during [POST] to [http://hawkbit:8080/rest/v1/softwaremodules/1/artifacts?filename=update-image-raspberrypi4-64.rootfs-20250116142415.swu] [MgmtSoftwareModuleRestApi#uploadArtifact(Long,MultipartFile,String,String,String,String)]: [{"exceptionClass":"org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException","errorCode":"hawkbit.server.error.artifact.uploadFailed","message":"Upload of artifact failed with internal server error."}]

full log error:
hawkbit-simple-ui-1 | 2025-01-28T09:25:18.938Z ERROR 1 --- [spring.application.name_IS_UNDEFINED] [:] [nio-8088-exec-9] c.v.flow.server.DefaultErrorHandler : hawkbit-simple-ui-1 | hawkbit-simple-ui-1 | com.vaadin.flow.server.UploadException: Upload failed hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.streamToReceiver(StreamReceiverHandler.java:582) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.handleFileUploadValidationAndData(StreamReceiverHandler.java:415) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.handleStream(StreamReceiverHandler.java:304) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.handleMultipartFileUploadFromParts(StreamReceiverHandler.java:249) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.doHandleMultipartFileUpload(StreamReceiverHandler.java:202) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.handleRequest(StreamReceiverHandler.java:162) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamRequestHandler.handleRequest(StreamRequestHandler.java:116) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1574) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106) ~[vaadin-spring-24.3.7.jar:na] hawkbit-simple-ui-1 | at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.34.jar:6.0] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:633) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:409) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:304) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:268) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:142) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:178) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1088) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:978) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[tomcat-embed-core-10.1.34.jar:6.0] hawkbit-simple-ui-1 | at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.34.jar:6.0] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:101) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:117) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191) ~[spring-security-web-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:113) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.servlet.handler.HandlerMappingIntrospector.lambda$createCacheFilter$3(HandlerMappingIntrospector.java:243) ~[spring-webmvc-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:113) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration$CompositeFilterChainProxy.doFilter(WebMvcSecurityConfiguration.java:238) ~[spring-security-config-6.4.2.jar:6.4.2] hawkbit-simple-ui-1 | at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:362) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:278) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.2.1.jar:6.2.1] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:397) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) ~[tomcat-embed-core-10.1.34.jar:10.1.34] hawkbit-simple-ui-1 | at java.base/java.lang.Thread.run(Unknown Source) ~[na:na] hawkbit-simple-ui-1 | Caused by: feign.FeignException$InternalServerError: [500 ] during [POST] to [http://hawkbit:8080/rest/v1/softwaremodules/1/artifacts?filename=update-image-raspberrypi4-64.rootfs-20250116142415.swu] [MgmtSoftwareModuleRestApi#uploadArtifact(Long,MultipartFile,String,String,String,String)]: [{"exceptionClass":"org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException","errorCode":"hawkbit.server.error.artifact.uploadFailed","message":"Upload of artifact failed with internal server error."}] hawkbit-simple-ui-1 | at feign.FeignException.serverErrorStatus(FeignException.java:281) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.FeignException.errorStatus(FeignException.java:226) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.FeignException.errorStatus(FeignException.java:213) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:103) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at org.eclipse.hawkbit.ui.simple.SimpleUIApp.lambda$static$1(SimpleUIApp.java:60) ~[classes/:0.7.0] hawkbit-simple-ui-1 | at feign.InvocationContext.decodeError(InvocationContext.java:133) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.InvocationContext.proceed(InvocationContext.java:80) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.ResponseHandler.handleResponse(ResponseHandler.java:69) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:109) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:53) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:104) ~[feign-core-13.5.jar:na] hawkbit-simple-ui-1 | at jdk.proxy2/jdk.proxy2.$Proxy120.uploadArtifact(Unknown Source) ~[na:na] hawkbit-simple-ui-1 | at org.eclipse.hawkbit.ui.simple.view.SoftwareModuleView$AddArtifactsDialog.lambda$new$1412afe8$1(SoftwareModuleView.java:310) ~[classes/:0.7.0] hawkbit-simple-ui-1 | at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:239) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.component.ComponentEventBus.fireEvent(ComponentEventBus.java:228) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.component.Component.fireEvent(Component.java:411) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | at com.vaadin.flow.component.upload.Upload.fireUploadSuccess(Upload.java:478) ~[vaadin-upload-flow-24.3.7.jar:na] hawkbit-simple-ui-1 | at com.vaadin.flow.component.upload.Upload$DefaultStreamVariable.streamingFinished(Upload.java:775) ~[vaadin-upload-flow-24.3.7.jar:na] hawkbit-simple-ui-1 | at com.vaadin.flow.server.communication.StreamReceiverHandler.streamToReceiver(StreamReceiverHandler.java:563) ~[flow-server-24.3.7.jar:24.3.7] hawkbit-simple-ui-1 | ... 106 common frames omitted

@avgustinmm
Copy link
Contributor

do you have any error on the update server side?

@AlexHCom
Copy link
Author

No, only previously errors

@AlexHCom
Copy link
Author

but I have next warning:
hawkbit-1 | 2025-01-28T09:46:02.284Z WARN 1 --- [update-server] [:] [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning hawkbit-1 | 2025-01-28T09:46:02.678Z WARN 1 --- [update-server] [:] [ main] .i.s.PathMatchingResourcePatternResolver : Failed to search in directory [/] for files matching pattern [rest-messages*.properties]: java.io.UncheckedIOException: java.nio.file.FileSystemLoopException: /dev/fd/150 hawkbit-1 | 2025-01-28T09:46:04.364Z WARN 1 --- [update-server] [:] [ main] r$InitializeUserDetailsManagerConfigurer : Global AuthenticationManager configured with an AuthenticationProvider bean. UserDetailsService beans will not be used by Spring Security for automatically configuring username/password login. Consider removing the AuthenticationProvider bean. Alternatively, consider using the UserDetailsService in a manually instantiated DaoAuthenticationProvider. If the current configuration is intentional, to turn off this warning, increase the logging level of 'org.springframework.security.config.annotation.authentication.configuration.InitializeUserDetailsBeanManagerConfigurer' to ERROR

@AlexHCom
Copy link
Author

@avgustinmm maybe need add other docker image

Image

@avgustinmm
Copy link
Contributor

500 error (internal server error) indicates that probably an unexpected error has occurred on the the update server.
Not sure what could be the problem.

  • Do you have problems only with the big files? Does upload of small files works fine?
  • have you increased memory on the update server also?

@AlexHCom
Copy link
Author

@avgustinmm

  • all files
  • yes, I increased memory on the update server also and simple-ui

Image

@AlexHCom
Copy link
Author

@avgustinmm where in docker image I can change next parameters:
spring.servlet.multipart.max-file-size
spring.servlet.multipart.max-request-size ?

@AlexHCom
Copy link
Author

I find what error, but I dont know how to fix this error: hawkbit-simple-ui-1 | 2025-01-29T09:58:11.008Z DEBUG 1 --- [spring.application.name_IS_UNDEFINED] [:] [nio-8088-exec-1] org.apache.hc.client5.http.wire : http-outgoing-8 >> "--194b17f32cd--[\r][\n]"
hawkbit-1 | 2025-01-29T09:58:11.066Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.m.jdbc.client.impl.StandardClient : execute query: ROLLBACK
hawkbit-1 | 2025-01-29T09:58:11.066Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.m.jdbc.client.impl.StandardClient : execute query: set autocommit=1
hawkbit-1 | 2025-01-29T09:58:11.067Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.mariadb.jdbc.message.server.OkPacket : System variable change: autocommit = ON
hawkbit-1 | 2025-01-29T09:58:11.067Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] e.h.r.j.MultiTenantJpaTransactionManager : Not closing pre-bound JPA EntityManager after transaction
hawkbit-1 | 2025-01-29T09:58:11.067Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.s.retry.support.RetryTemplate : Checking for rethrow: count=1; for: 'org.eclipse.hawkbit.repository.jpa.management.JpaArtifactManagement.create'
hawkbit-1 | 2025-01-29T09:58:11.067Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.s.retry.support.RetryTemplate : Retry failed last attempt: count=1; for: 'org.eclipse.hawkbit.repository.jpa.management.JpaArtifactManagement.create'
hawkbit-1 | 2025-01-29T09:58:11.067Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] .e.h.r.j.a.ExceptionMappingAspectHandler : Handling exception org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException
hawkbit-1 | 2025-01-29T09:58:11.068Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] .m.m.a.ExceptionHandlerExceptionResolver : Using @ExceptionHandler org.eclipse.hawkbit.rest.RestConfiguration$ResponseExceptionHandler#handleSpServerRtExceptions(HttpServletRequest, Exception)
hawkbit-1 | 2025-01-29T09:58:11.069Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] stConfiguration$ResponseExceptionHandler : Handling exception org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException of request http://hawkbit:8080/rest/v1/softwaremodules/1/artifacts
hawkbit-1 | 2025-01-29T09:58:11.069Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/hal+json', given [application/hal+json] and supported [application/json, application/*+json, application/cbor, application/yaml]
hawkbit-1 | 2025-01-29T09:58:11.070Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing [ExceptionInfo(exceptionClass=org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException, (truncated)...]
hawkbit-1 | 2025-01-29T09:58:11.071Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [AbstractServerRtException(error=SP_ARTIFACT_UPLOAD_FAILED, info=null)]
hawkbit-1 | 2025-01-29T09:58:11.071Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.j.s.OpenEntityManagerInViewInterceptor : Closing JPA EntityManager in OpenEntityManagerInViewInterceptor
hawkbit-1 | 2025-01-29T09:58:11.071Z DEBUG 1 --- [update-server] [DEFAULT:admin] [nio-8080-exec-9] o.s.web.servlet.DispatcherServlet : Completed 500 INTERNAL_SERVER_ERROR
hawkbit-simple-ui-1 | 2025-01-29T09:58:11.073Z DEBUG 1 --- [spring.application.name_IS_UNDEFINED] [:] [nio-8088-exec-1] org.apache.hc.client5.http.wire : http-outgoing-8 << "HTTP/1.1 500 [\r][\n]"
hawkbit-simple-ui-1 | 2025-01-29T09:58:11.073Z DEBUG 1 --- [spring.application.name_IS_UNDEFINED] [:] [nio-8088-exec-1] org.apache.hc.client5.http.wire : http-outgoing-8 << "X-Content-Type-Options: nosniff[\r][\n]"
hawkbit-simple-ui-1 | 2025-01-29T09:58:11.073Z DEBUG 1 --- [spring.application.name_IS_UNDEFINED] [:] [nio-8088-exec-1] org.apache.hc.client5.http.wire : http-outgoing-8 << "X-XSS-Protection: 0[\r][
`

@avgustinmm
Copy link
Contributor

@avgustinmm where in docker image I can change next parameters: spring.servlet.multipart.max-file-size spring.servlet.multipart.max-request-size ?

All spring properties you could add as described in #2219 (comment)
You probably could add them in JAVA_OPTS as -Dspring.servlet.multipart.max-file-size=333333

@avgustinmm
Copy link
Contributor

avgustinmm commented Jan 29, 2025

Regarding OOM - I took a look, and:

  • it seems that Simple UI, using a feign client, used to load the whole artificat into memory (seems there is no other option with feign(?)). I just did (and merged) this PR - Simple UI: Streaming upload #2254, which makes the upload streaming. Thus no memory increase shall be needed anymore (change is still in the master only).
  • on the update server it seems that tomcat handles downloads in more sophisticate way and maybe it uses files (File System) to do not load whole download into memory - so there should not be required too much memory

Regarding you '500' issues - it could be related to tomcat handling - e.g. need to access FS or whatever.
You could try to enable some spring web/tomcat debugs in order to find out the reason.

Anyway, I just tested the following (using latest docker images):

  • docker compose -f docker-compose-monolith-with-simple-ui-mysql.yml up
  • login to http://localhost:8088 (Simple UI)
  • created SM with uploading a file (small)
  • upload was successful

So, to me, it seems that the latest (0.7.0) docker images and the incorporated jar files (monolith & simple ui) are fine and support artifact uploads if properly configured.

@AlexHCom
Copy link
Author

@avgustinmm last version docker image for hawkbit-update-server has next error:
hawkbit-1 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: Failed to load driver class org.mariadb.jdbc.Driver in either of HikariConfig class loader or Thread context classloader
I run new version docker compose https://github.com/eclipse-hawkbit/hawkbit/blob/master/docker/docker-compose-monolith-with-simple-ui-mysql.yml
Previosly version this file docker-compose-monolith-mysql.yml had config folder with application.yml

@avgustinmm
Copy link
Contributor

I do the same:

  • have you checked out the last hawkbit project (e.g. docker compose file)
  • which image is the monolith update server - in 0.7.0 the mariadb driver shall be in the jar. there where problems with previous relase AFAIR.
  • note that there is no more mysql image - hawkbit/hawkbit-update-server:latest-mysql is not released anymore. you should use hawkbit/hawkbit-update-server:latest which supports mysql also

@AlexHCom
Copy link
Author

@avgustinmm now works services with small files, but we upload to devices swu files size more 500Mb. I added next parameters: environment: - 'SPRING_APPLICATION_JSON={"hawkbit.server.mgmtUrl": "http://hawkbit:8080"}' - 'SPRING_SERVLET_MULTIPART_MAX-FILE-SIZE=333333' - 'SPRING_SERVLET_MULTIPART_MAX-REQUEST-SIZE=2048MB' restart: always
and after upload files more 500Mb, log send this warning:
2025-01-29T15:19:05.160Z WARN 1 --- [spring.application.name_IS_UNDEFINED] [:] [nio-8088-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded]
What needs to fix and where?

@AlexHCom
Copy link
Author

@avgustinmm i found problem with docker image

@avgustinmm
Copy link
Contributor

what was the problem? with which docker image?

@AlexHCom
Copy link
Author

AlexHCom commented Feb 3, 2025

@avgustinmm for bigger files, need change next parameters in hawkbit-simple-ui:
ARG PROFILES=h2 ENV PROFILES=${PROFILES} **ARG X_MS=2048m** ENV X_MS=${X_MS} **ARG X_MX=10240m** ENV X_MX=${X_MX} **ARG XX_MAX_METASPACE_SIZE=1024m** ENV XX_MAX_METASPACE_SIZE=${XX_MAX_METASPACE_SIZE} **ARG XX_METASPACE_SIZE=1024m** ENV XX_METASPACE_SIZE=${XX_METASPACE_SIZE} ARG XSS=300K ENV XSS=${XSS} ARG GC=G1 ENV GC=${GC}
and added to docker compose to file docker-compose-monolith-with-simple-ui-mysql.yml and docker-compose-monolith-mysql.yml add next parameters:
- 'SPRING_SERVLET_MULTIPART_MAX-FILE-SIZE=333333MB' - 'SPRING_SERVLET_MULTIPART_MAX-REQUEST-SIZE=1024MB'

@avgustinmm
Copy link
Contributor

Ok, so, as I understand now it works. With next version OOM should not occur even with smaller memory.
So, I could close the issue?

@AlexHCom AlexHCom closed this as completed Feb 3, 2025
@AlexHCom
Copy link
Author

AlexHCom commented Feb 3, 2025

Thank you, Mr. @avgustinmm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants