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

java.lang.UnsupportedOperationException: Unexpected message id from the client #16664

Open
alexanoid opened this issue Apr 21, 2023 · 105 comments
Open

Comments

@alexanoid
Copy link

alexanoid commented Apr 21, 2023

Description of the bug

From time to time I may see the following PUSH error in the logs:

2023-04-20T17:12:20.587+03:00 DEBUG 1539148 --- [XNIO-1 task-4] c.v.f.s.communication.ServerRpcHandler   : Unexpected message id from the client. Expected sync id: 0, got 1. Message start: { type: publishedEventHandler node: 120.0 feature: null } { type: publishedEventHandler node: 48.0 feature: null } { type: channel node: 1.0 feature: null } 
2023-04-20T17:12:20.588+03:00 DEBUG 1539148 --- [XNIO-1 task-9] c.v.f.server.communication.UidlWriter    : * Creating response to client
2023-04-20T17:12:20.589+03:00 ERROR 1539148 --- [XNIO-1 task-4] c.d.u.e.handlers.CustomErrorHandler      : Something wrong

java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected sync id: 0, got 1. more details logged on DEBUG level.
	at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:310) ~[flow-server-24.1.0.alpha3.jar!/:24.1.0.alpha3]
	at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:114) ~[flow-server-24.1.0.alpha3.jar!/:24.1.0.alpha3]
	at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[flow-server-24.1.0.alpha3.jar!/:24.1.0.alpha3]
	at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1529) ~[flow-server-24.1.0.alpha3.jar!/:24.1.0.alpha3]
	at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398) ~[flow-server-24.1.0.alpha3.jar!/:24.1.0.alpha3]
	at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106) ~[vaadin-spring-24.1.0.alpha3.jar!/:na]
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614) ~[jakarta.servlet-api-6.0.0.jar!/:6.0.0]
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:258) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToServlet(ServletInitialHandler.java:193) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:186) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImplSetup(RequestDispatcherImpl.java:136) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:99) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141) ~[spring-webmvc-6.0.7.jar!/:6.0.7]
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:178) ~[spring-webmvc-6.0.7.jar!/:6.0.7]
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51) ~[spring-webmvc-6.0.7.jar!/:6.0.7]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081) ~[spring-webmvc-6.0.7.jar!/:6.0.7]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974) ~[spring-webmvc-6.0.7.jar!/:6.0.7]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1011) ~[spring-webmvc-6.0.7.jar!/:6.0.7]
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.0.7.jar!/:6.0.7]
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547) ~[jakarta.servlet-api-6.0.0.jar!/:6.0.0]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.0.7.jar!/:6.0.7]
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614) ~[jakarta.servlet-api-6.0.0.jar!/:6.0.0]
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:172) ~[undertow-websockets-jsr-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:100) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:151) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:129) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter.doFilterInternal(OAuth2AuthorizationRequestRedirectFilter.java:181) ~[spring-security-oauth2-client-6.0.2.jar!/:6.0.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:117) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191) ~[spring-security-web-6.0.2.jar!/:6.0.2]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:352) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:268) ~[spring-web-6.0.7.jar!/:6.0.7]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.7.jar!/:6.0.7]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.7.jar!/:6.0.7]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.7.jar!/:6.0.7]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.7.jar!/:6.0.7]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101) ~[undertow-servlet-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859) ~[undertow-core-2.3.4.Final.jar!/:2.3.4.Final]
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
	at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) ~[xnio-api-3.8.8.Final.jar!/:3.8.8.Final]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na] 

Expected behavior

Theres is no such issues in the Vaadin application

Minimal reproducible example

n/a. I see such issue on the prod env. from time to time

Versions

  • Vaadin / Flow version: 24.1.0.alpha3
  • Java version: 17
  • OS version:
  • Browser version (if applicable):
  • Application Server (if applicable): Undertow from spring-boot-starter-undertow with Spring Boot 3.0.5
  • IDE (if applicable):
@mcollovati
Copy link
Collaborator

Hi, thanks for the issue.
It seems like the first message from the client is lost somewhere. However, it is hard to say what happens only looking at the server log.

What PUSH transport are you using? Will you be able to provide also the browser console logs, if you can reproduce the error in development mode? Is there something your application does on the first page load? Do you have some particular Vaadin setting on (e.g. eagerServerLoad or @PreserveOnRefresh)?

@alexanoid
Copy link
Author

Hi!

I use:

@Push(transport = Transport.LONG_POLLING, value = PushMode.MANUAL)

Also, I use:

vaadin.eagerServerLoad=true

because I implemented IndexHtmlRequestListener in order to add html meta tags

In case I'll reproduce it on my dev env, I'll try to provide browser logs

@mcollovati
Copy link
Collaborator

Is it possible that you are somehow invoking ui.push() during page load outside a ui.access(...)?

@alexanoid
Copy link
Author

I checked all of the code, there are no such issues. I always use the following pattern:

        var ui = UI.getCurrent();
        listenableFuture.addCallback(jobApplicationMatrix -> {
            ui.access(() -> {
                //do some ui updates
                ui.push();
            });
        }, err -> {
            logger.error("Error", err);
            ui.access(() -> {
                //do some ui updates
                ui.push();;
            });
        });

@alexanoid
Copy link
Author

Also, I noticed that after some idle time PUSH notifications stop working at all, until I manually refresh the entire web page in the browser. I do not see any issues in the log (INFO level). Could you please help me figure out this error? What logs or something else should I enable or provide in order to figure out the reason for that?

@czp13
Copy link
Contributor

czp13 commented Apr 25, 2023

Thank you @alexanoid!

Were you able to reproduce it maybe in dev environment?
Also could you share please:

  • the browser logs
  • and the Chrome dev tools network tab -> export network logs:
    image

@alexanoid
Copy link
Author

alexanoid commented Apr 25, 2023

Hi @czp13 , thanks for your response!

Unfortunately, I am unable to replicate it in the development environment. While working in the development environment, I periodically see the following warning in the console:

2023-04-25T14:35:23.204+03:00 WARN 3372 --- [ XNIO-1 task-2] c.v.f.s.communication.ServerRpcHandler : Resynchronizing UI by client's request. A network message was lost before reaching the client and the client is reloading the full UI state. This typically happens because of a bad network connection with packet loss or because of some part of the network infrastructure (load balancer, proxy) terminating a push (websocket or long-polling) connection. If you are using push with a proxy, make sure the push timeout is set to be smaller than the proxy connection timeout

Btw, I exported logs from FF and Chrome consoles:

Additionally, you may test the actual website I am running: https://decisionwanted.com/

If needed, I can enable there any logs you request to help figure out the issue.

@mcollovati
Copy link
Collaborator

Unfortunately, I can't see anything suspicious in the attached logs.
The first error reported is somehow different from the one in the above comment; one seems to be caused by a message not sent from the client, and the second is about the client not receiving a message from the server.

I tried to navigate the application, but I couldn't see any error or page reload.

Where is PUSH used in the application?
When do the different types of error happen? At first page load? During some specific action?

It is quite difficult to understand what is happening, without being able to reproduce the issue.

@alexanoid
Copy link
Author

alexanoid commented Apr 25, 2023

PUSH is used almost anywhere on the website. For example, the following page https://decisionwanted.com/jobs
Several times I have seen a situation, when I leave the website opened for a few hours, then return to the computer after this idle time and was unable to load (refresh) the catalog content by pressing the following Job Catalog Router Link:

jc

By pressing this link, user invokes Job Catalog update via async PUSH

I was able to navigate the website via the router links, but the asynchronous PUSH based content was not delivered to the client. As soon as I refresh the web page by pressing F5 everything starts working correctly.

It is definitely hard to reproduce.. but potentially something is wrong with restoring the PUSH connection sometimes. If you have any ideas what may help to catch the issue.. which logs should be enabled or something else.. I'll b glad to execute it and collect any additional info.

@alexanoid
Copy link
Author

Some additional info:

2023-04-25T19:19:51.421+03:00  WARN 27968 --- [  XNIO-1 task-5] c.v.f.s.communication.ServerRpcHandler   : Resynchronizing UI by client's request. A network message was lost before reaching the client and the client is reloading the full UI state. This typically happens because of a bad network connection with packet loss or because of some part of the network infrastructure (load balancer, proxy) terminating a push (websocket or long-polling) connection. If you are using push with a proxy, make sure the push timeout is set to be smaller than the proxy connection timeout
2023-04-25T19:19:51.432+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.433+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.f.server.communication.UidlWriter    : * Creating response to client
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.444+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load
2023-04-25T19:19:51.445+03:00 DEBUG 27968 --- [  XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Fallback chunk is not available, skipping fallback dependencies load

I have no idea what this means:

c.v.flow.component.internal.UIInternals : Fallback chunk is not available, skipping fallback dependencies load

but maybe it will be also helpful for you

@mcollovati
Copy link
Collaborator

mcollovati commented Apr 25, 2023

The "Fallback ..." message is not relevant to this issue, and it is not a signal of problems .
I finally got something after leaving the page idle for some time.
During the normal push reconnection (because of long polling) the client received a '502 Bad Gatewayfrom the nginx load balancer and then a401`; after that, the page has been reloaded.

image

image

So, it would be interesting to understand why nginx responded with 502 and why we get an unauthorized response on push connection

@alexanoid
Copy link
Author

alexanoid commented Apr 25, 2023

I think this is because I redeployed the app on prod... Enabled Vaadin and Atmosphere logs:

logging.level.com.vaadin=DEBUG
logging.level.org.atmosphere = DEBUG

@alexanoid
Copy link
Author

alexanoid commented Apr 25, 2023

Also, I reduced vaadin.pushLongPollingSuspendTimeout= from 180000 to 60000
and

server.servlet.session.timeout=reduced to 30m (previously I had 7 days)

This is my current application properties:

server.servlet.session.persistent=false
server.servlet.session.tracking-modes=cookie
server.servlet.session.cookie.http-only=true
server.servlet.session.cookie.secure=true
server.servlet.session.cookie.max-age=365d

vaadin.heartbeatInterval=300
vaadin.pushLongPollingSuspendTimeout=60000
vaadin.maxMessageSuspendTimeout=5000
vaadin.closeIdleSessions=false
vaadin.eagerServerLoad=true

some of NGINX parameters:

sendfile                   on;
tcp_nodelay                on;
tcp_nopush                 on;

etag                       off;
if_modified_since          off;

proxy_buffering            off;

proxy_buffer_size          128k;
proxy_buffers              4 256k;
proxy_busy_buffers_size    256k;

proxy_cache                off;
proxy_cache_convert_head   off;
proxy_max_temp_file_size   0;
client_max_body_size       0;

proxy_http_version         1.1;
proxy_pass_request_headers on;
proxy_pass_request_body    on;

proxy_read_timeout         300;
proxy_connect_timeout      300;
proxy_send_timeout         300;
reset_timedout_connection  on;

@mcollovati
Copy link
Collaborator

I tried to open one page and then click something after a couple of hours, but unfortunately did not notice any error.
I will try again with the page you mentioned

@alexanoid
Copy link
Author

alexanoid commented Apr 26, 2023

@mcollovati Thank you! I think I know how to reproduce it:

  1. I test it in FF Browser.
  2. Log in to the system.
  3. Stay on the following page: https://decisionwanted.com/candidates
  4. Click on the Candidate Catalog router link at the top of the page (first tab) - everything should be working properly.
  5. Allow your PC to go into sleep mode for one hour (application session timeout is 30 minutes).
  6. After one hour, wake up your PC and try to press the same Candidate Catalog router link - you should see infinite progress bars and no content.

Looks like something is broken after sleep mode.. There are 3 possible places for the issue:

  1. My application logic
  2. NGINX
  3. Vaadin core

I do not see any errors in the application logs. I log everything (I hope :) )

@alexanoid
Copy link
Author

And logs for another resync issue:

WARN 30600 --- [ XNIO-1 task-4] c.v.f.s.communication.ServerRpcHandler : Resynchronizing UI by client's request. A network message was lost before reaching the client and the client is reloading the full UI state. This typically happens because of a bad network connection with packet loss or because of some part of the network infrastructure (load balancer, proxy) terminating a push (websocket or long-polling) connection. If you are using push with a proxy, make sure the push timeout is set to be smaller than the proxy connection timeout

Uncaught (in promise) Error: Client is resynchronizing
    Ay http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Ay http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    W0 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    cb http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    x http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Gy http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Bg http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Jr http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    nb http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    N http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    onreadystatechange http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    od http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    x2 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    s0 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Yd http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Z2 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Jd http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    mg http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    v3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    A3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    df http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Ot http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    x3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    M http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    L http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    vd http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    od http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    x2 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    s0 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    setTimeout handler*Nv http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Ct http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Bg http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Jr http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    nb http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    N http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    onreadystatechange http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    od http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    x2 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    s0 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Yd http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Z2 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Jd http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    mg http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    v3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    A3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    df http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Ot http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Q3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    H http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    qu http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Bg http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Jr http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    nb http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    N http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    onreadystatechange http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    od http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    x2 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    s0 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Yd http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Z2 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Jd http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    mg http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    v3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    A3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    df http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Ot http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Q3 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    H http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    qu http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    Bg http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Jr http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    ty http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    _1 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    A0 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    H http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    mf http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    G0 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    G http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    Cl http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    od http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    x2 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:3
    s0 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    E http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    setTimeout handler*Xc http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    M1 http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    at http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    pv http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1
    od http://localhost:8080/VAADIN/build/FlowClient-ff998ef5.js:1

FF_27_localhost_console-export-2023-4-27_0-47-52.zip

I often encounter this issue during development mode when I relaunch the application. After restarting, my application tries to reload itself in the Firefox browser but fails with the error mentioned above. Therefore, I have to manually refresh the page with F5.

@knoobie
Copy link
Contributor

knoobie commented Apr 27, 2023

Well.. If you redeploy the application, you are literally killing the backend and the client side can NEVER be in sync when the browser is still opened and sends another request. So that's totally normal. (Except, somebody could expect that I. This case the application refreshes itself to ease development)

@mcollovati
Copy link
Collaborator

From the logs, I can see a new UI instance is created because the server session is expired.
The there are two requests from the client to the server during the push connection establishment.
The first one (server sync id 1) is processed before the push connection is ready, the second one (server sync id 3) after the push connection is active.
So, message with server sync id 2 is lost somewhere.

Can you please share the code related to the click on the tab, such as listeners, push calls related to that click, etc ?
In addition, if you set the log level for UIInternals class to TRACE we should be able to see the stack trace for every server sync id increment.

logging.level.com.vaadin.flow.component.internal.UIInternals=TRACE

Be aware that this will significantly increase the logs size

@alexanoid
Copy link
Author

@knoobie I use Keycloak as an SSO solution, and its session does not expire. So when I redeploy my application, it automatically redirects to the Keycloak login page. Since there is an active SSO session, the user is automatically redirected back to the application. This is how I "emulate" a user re-logging into the application. The resync occurs after this redirect from SSO to the application. In this case, I can only explain that the resync happens, because the application is not fully started yet. But the Vaadin index.html is correctly delivered to the browser at this moment...

@alexanoid
Copy link
Author

alexanoid commented Apr 27, 2023

@mcollovati In the case of clicking on the Candidate Catalog tab, the setParameter() method of the view is executed. Here is a simplified version of the logic:

@Override
   public void setParameter(BeforeEvent event, @OptionalParameter String idParameter) {

......

ListenableFuture<DecisionMatrixPage> listenableFuture = container.queryDecisionMatrixPage(searchJobableDto, pageNumber, pageSize);

       var ui = UI.getCurrent();
       listenableFuture.addCallback(page -> {

           ui.access(() -> {

               boolean emptyPage = page.isEmpty();
               if (table != null) {
                   table.setVisible(!emptyPage);
               }
               if (noJobsVerticalLayout != null) {
                   setNoJobsVerticalLayoutVisible(emptyPage);
               }

               table.setItems(page.getContent());

               BaseLayout baseLayout = VaadinUtils.getRootBaseLayout(UI.getCurrent());
               if (baseLayout != null) {
                   baseLayout.scrollIntoView();
               }

               if (gridPagination != null) {
                   gridPagination.setQueryPageNumber(pageNumber);
                   gridPagination.setTotalItems(page.getTotalElements());
                   gridPagination.getProgressBar().setVisible(false);
               }

               if (page.getTotalElements() <= pageSize) {
                   if(showTotalElementsLabel()) {
                       table.setFooter(VaadinUtils.createHelperLabel(totalJobsLabel));
                   }
               } else {
                   if (gridPagination != null) {
                       table.setFooter(gridPagination);
                       gridPagination.setVisible(true);
                   }
               }

               updatePageUrlWithParameters();

               if (progressBar != null) {
                   progressBar.setVisible(false);
               }

               onPostQueryDecisionMatrixPage(page);

               ui.push();
           });

       }, err -> {
           logger.error("Error", err);
           ui.access(() -> {
               Notification.show(ui.getTranslation("internal.error"));
               ui.push();
               throw new AsyncException("Async error", err);
           }
       });
       });

now, I'm going to enable

logging.level.com.vaadin.flow.component.internal.UIInternals=TRACE

and redeploy the application on the prod

@alexanoid
Copy link
Author

@mcollovati Thank you! I think I know how to reproduce it:

0. I test it in FF Browser.

1. Log in to the system.

2. Stay on the following page: https://decisionwanted.com/candidates

3. Click on the Candidate Catalog router link at the top of the page (first tab) - everything should be working properly.

4. Allow your PC to go into sleep mode for one hour (application session timeout is 30 minutes).

5. After one hour, wake up your PC and try to press the same Candidate Catalog router link - you should see infinite progress bars and no content.

Looks like something is broken after sleep mode.. There are 3 possible places for the issue:

1. My application logic

2. NGINX

3. Vaadin core

I do not see any errors in the application logs. I log everything (I hope :) )

After these steps in the application logs when I click on the Candidate Catalog with TRACE I see the following:

2023-04-27T10:09:44.827+03:00 DEBUG 3420549 --- [XNIO-1 task-5] c.v.f.server.communication.UidlWriter    : * Creating response to client
2023-04-27T10:09:44.829+03:00 TRACE 3420549 --- [XNIO-1 task-5] c.v.flow.component.internal.UIInternals  : Increment syncId:
com.vaadin.flow.component.internal.UIInternals.incrementServerId(UIInternals.java:325)
com.vaadin.flow.server.communication.UidlWriter.createUidl(UidlWriter.java:197)
com.vaadin.flow.server.communication.UidlRequestHandler.createUidl(UidlRequestHandler.java:155)
com.vaadin.flow.server.communication.UidlRequestHandler.writeUidl(UidlRequestHandler.java:145)
com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:115)
com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1529)
com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398)
com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:258)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchToServlet(ServletInitialHandler.java:193)
io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:186)
io.undertow.servlet.spec.RequestDispatcherImpl.forwardImplSetup(RequestDispatcherImpl.java:136)
io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:99)
org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:178)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1011)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:172)
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365)
org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:100)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:151)
org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:129)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter.doFilterInternal(OAuth2AuthorizationRequestRedirectFilter.java:181)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:117)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82)
org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:352)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:268)
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276)
io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132)
io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256)
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
java.base/java.lang.Thread.run(Thread.java:833)

@mcollovati
Copy link
Collaborator

Yes, that trace tells us who originated the server sync id increment, but we need to trace all increments, not just one.
If you can reproduce the issue and then provide the full log, it would be great

@alexanoid
Copy link
Author

This is the only one trace I have in the application logs after the Candidate Catalog tab click with reproduced issue.

On the UI in the Network console I only see one:

POST https://decisionwanted.com/?v-r=uidl&v-uiId=3

REQUEST:

{"csrfToken":"4fb17369-**********-a09fdfd","rpc":[{"type":"publishedEventHandler","node":1,"templateEventMethodName":"connectClient","templateEventMethodArgs":["candidates","","Candidates",null,"client"],"promise":18}],"syncId":55,"clientId":36}

RESPONSE:


for(;;);[{"syncId":56,"clientId":37,"changes":[{"node":9671,"type":"detach"},{"node":9669,"type":"detach"},{"node":9663,"type":"detach"},{"node":9661,"type":"detach"},{"node":9658,"type":"detach"},{"node":9659,"type":"detach"},{"node":9657,"type":"detach"},{"node":9655,"type":"detach"},{"node":9660,"type":"detach"},{"node":9668,"type":"detach"},{"node":9654,"type":"detach"},{"node":9656,"type":"detach"},{"node":9662,"type":"detach"},{"node":9664,"type":"detach"},{"node":9665,"type":"detach"},{"node":9666,"type":"detach"},{"node":9667,"type":"detach"},{"node":9708,"type":"detach"},{"node":9652,"type":"detach"},{"node":9651,"type":"detach"},{"node":5174,"type":"clear","feat":2},{"node":5174,"type":"splice","feat":2,"index":0,"addNodes":[10197]},{"node":5174,"type":"splice","feat":2,"index":1,"addNodes":[10199]},{"node":9653,"type":"detach"},{"node":9670,"type":"detach"},{"node":9672,"type":"detach"},{"node":9673,"type":"detach"},{"node":9674,"type":"detach"},{"node":9675,"type":"detach"},{"node":9676,"type":"detach"},{"node":9677,"type":"detach"},{"node":9678,"type":"detach"},{"node":9679,"type":"detach"},{"node":9680,"type":"detach"},{"node":9681,"type":"detach"},{"node":9682,"type":"detach"},{"node":9683,"type":"detach"},{"node":9684,"type":"detach"},{"node":9685,"type":"detach"},{"node":9686,"type":"detach"},{"node":9687,"type":"detach"},{"node":9688,"type":"detach"},{"node":9689,"type":"detach"},{"node":9690,"type":"detach"},{"node":9691,"type":"detach"},{"node":9692,"type":"detach"},{"node":9693,"type":"detach"},{"node":9694,"type":"detach"},{"node":9695,"type":"detach"},{"node":9696,"type":"detach"},{"node":9697,"type":"detach"},{"node":9698,"type":"detach"},{"node":9699,"type":"detach"},{"node":9700,"type":"detach"},{"node":9701,"type":"detach"},{"node":9702,"type":"detach"},{"node":9703,"type":"detach"},{"node":9704,"type":"detach"},{"node":9705,"type":"detach"},{"node":9706,"type":"detach"},{"node":9707,"type":"detach"},{"node":9709,"type":"detach"},{"node":9710,"type":"detach"},{"node":9711,"type":"detach"},{"node":9712,"type":"detach"},{"node":10138,"type":"attach"},{"node":10138,"type":"put","key":"tag","feat":0,"value":"vaadin-progress-bar"},{"node":10138,"type":"put","key":"min","feat":1,"value":0},{"node":10138,"type":"put","key":"max","feat":1,"value":1},{"node":10138,"type":"put","key":"indeterminate","feat":1,"value":true},{"node":10138,"type":"put","key":"value","feat":1,"value":0},{"node":10139,"type":"attach"},{"node":10139,"type":"put","key":"tag","feat":0,"value":"vaadin-form-layout"},{"node":10139,"type":"splice","feat":2,"index":0,"addNodes":[10138]},{"node":10139,"type":"put","key":"responsiveSteps","feat":1,"value":[{"minWidth":"0","columns":1}]},{"node":10139,"type":"splice","feat":11,"index":0,"add":["search-job-form","search-form-hideable"]},{"node":10139,"type":"put","key":"id","feat":3,"value":"e2f03b04-f0b4-464d-984f-9fd622f99627"},{"node":10139,"type":"put","key":"flex-shrink","feat":12,"value":"0.0"},{"node":10139,"type":"put","key":"width","feat":12,"value":"25em"},{"node":10139,"type":"put","key":"flex-grow","feat":12,"value":"1.0"},{"node":10140,"type":"attach"},{"node":10140,"type":"put","key":"tag","feat":0,"value":"span"},{"node":10140,"type":"put","key":"height","feat":12,"value":"25px"},{"node":10141,"type":"attach"},{"node":10141,"type":"put","key":"tag","feat":0,"value":"vaadin-icon"},{"node":10142,"type":"attach"},{"node":10142,"type":"put","key":"visible","feat":0,"value":true},{"node":10142,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10143,"type":"attach"},{"node":10143,"type":"put","key":"tag","feat":0,"value":"vaadin-icon"},{"node":10144,"type":"attach"},{"node":10144,"type":"put","key":"visible","feat":0,"value":true},{"node":10144,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10145,"type":"attach"},{"node":10145,"type":"put","key":"text","feat":7,"value":"1"},{"node":10146,"type":"attach"},{"node":10146,"type":"put","key":"tag","feat":0,"value":"span"},{"node":10147,"type":"attach"},{"node":10147,"type":"put","key":"tag","feat":0,"value":"vaadin-integer-field"},{"node":10148,"type":"attach"},{"node":10148,"type":"put","key":"tag","feat":0,"value":"vaadin-icon"},{"node":10149,"type":"attach"},{"node":10149,"type":"put","key":"visible","feat":0,"value":true},{"node":10149,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10150,"type":"attach"},{"node":10150,"type":"put","key":"tag","feat":0,"value":"vaadin-icon"},{"node":10151,"type":"attach"},{"node":10151,"type":"put","key":"visible","feat":0,"value":true},{"node":10151,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10152,"type":"attach"},{"node":10152,"type":"put","key":"tag","feat":0,"value":"vaadin-horizontal-layout"},{"node":10153,"type":"attach"},{"node":10153,"type":"put","key":"visible","feat":0,"value":false},{"node":10153,"type":"put","key":"tag","feat":0,"value":"vaadin-progress-bar"},{"node":10154,"type":"attach"},{"node":10154,"type":"put","key":"visible","feat":0,"value":false},{"node":10154,"type":"put","key":"tag","feat":0,"value":"vaadin-vertical-layout"},{"node":10155,"type":"attach"},{"node":10155,"type":"put","key":"tag","feat":0,"value":"div"},{"node":10156,"type":"attach"},{"node":10156,"type":"put","key":"tag","feat":0,"value":"div"},{"node":10157,"type":"attach"},{"node":10157,"type":"put","key":"tag","feat":0,"value":"div"},{"node":10158,"type":"attach"},{"node":10158,"type":"put","key":"visible","feat":0,"value":false},{"node":10158,"type":"put","key":"tag","feat":0,"value":"div"},{"node":10159,"type":"attach"},{"node":10159,"type":"put","key":"text","feat":7,"value":"Досвід роботи кандидатів"},{"node":10160,"type":"attach"},{"node":10160,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10161,"type":"attach"},{"node":10161,"type":"put","key":"text","feat":7,"value":"Каталог кандидатів"},{"node":10162,"type":"attach"},{"node":10162,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10163,"type":"attach"},{"node":10163,"type":"put","key":"tag","feat":0,"value":"vaadin-horizontal-layout"},{"node":10164,"type":"attach"},{"node":10164,"type":"put","key":"text","feat":7,"value":"Так само, скористайтеся пошуком в каталозі кандидатів, та запропонуйте вакансії відповіднім кандидатам"},{"node":10165,"type":"attach"},{"node":10165,"type":"put","key":"tag","feat":0,"value":"label"},{"node":10166,"type":"attach"},{"node":10166,"type":"put","key":"text","feat":7,"value":"Мої вакансії"},{"node":10167,"type":"attach"},{"node":10167,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10168,"type":"attach"},{"node":10168,"type":"put","key":"text","feat":7,"value":"Розмістити вакансію"},{"node":10169,"type":"attach"},{"node":10169,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10170,"type":"attach"},{"node":10170,"type":"put","key":"tag","feat":0,"value":"vaadin-horizontal-layout"},{"node":10171,"type":"attach"},{"node":10171,"type":"put","key":"text","feat":7,"value":"Для пошуку кандидатів, розмістіть вакансію в каталозі вакансій"},{"node":10172,"type":"attach"},{"node":10172,"type":"put","key":"tag","feat":0,"value":"label"},{"node":10173,"type":"attach"},{"node":10173,"type":"put","key":"text","feat":7,"value":"Додавання вакансії"},{"node":10174,"type":"attach"},{"node":10174,"type":"put","key":"tag","feat":0,"value":"h3"},{"node":10175,"type":"attach"},{"node":10175,"type":"put","key":"text","feat":7,"value":"Мої кандидати"},{"node":10176,"type":"attach"},{"node":10176,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10177,"type":"attach"},{"node":10177,"type":"put","key":"text","feat":7,"value":"Порекомендувати кандидата"},{"node":10178,"type":"attach"},{"node":10178,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10179,"type":"attach"},{"node":10179,"type":"put","key":"tag","feat":0,"value":"vaadin-horizontal-layout"},{"node":10180,"type":"attach"},{"node":10180,"type":"put","key":"text","feat":7,"value":"Якщо ви знаєте людину, яка шукає роботу, та хочете порекомендувати її на вакансії за винагороду, то створіть профіль цього кандидата в каталозі кандидатів"},{"node":10181,"type":"attach"},{"node":10181,"type":"put","key":"tag","feat":0,"value":"label"},{"node":10182,"type":"attach"},{"node":10182,"type":"put","key":"text","feat":7,"value":"Каталог вакансій"},{"node":10183,"type":"attach"},{"node":10183,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10184,"type":"attach"},{"node":10184,"type":"put","key":"text","feat":7,"value":"Так само, скористайтеся пошуком в каталозі вакансій, та подайте заявки на відповідні вам вакансії. Завдяки цьому, система буде вдосконалювати свої знання про ваш профіль, що дозволить рекомендувати вам максимально відповідні вакансії"},{"node":10185,"type":"attach"},{"node":10185,"type":"put","key":"tag","feat":0,"value":"label"},{"node":10186,"type":"attach"},{"node":10186,"type":"put","key":"text","feat":7,"value":"Мій профіль"},{"node":10187,"type":"attach"},{"node":10187,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10188,"type":"attach"},{"node":10188,"type":"put","key":"tag","feat":0,"value":"vaadin-horizontal-layout"},{"node":10189,"type":"attach"},{"node":10189,"type":"put","key":"text","feat":7,"value":"Заповніть свій профіль, якщо кандидатом є саме ви. Це дасть вам змогу самостійно відгукуватися на вакансії, a системі показувати для вас відповідні рекомендації"},{"node":10190,"type":"attach"},{"node":10190,"type":"put","key":"tag","feat":0,"value":"label"},{"node":10191,"type":"attach"},{"node":10191,"type":"put","key":"text","feat":7,"value":"Додавання профілю кандидата"},{"node":10192,"type":"attach"},{"node":10192,"type":"put","key":"tag","feat":0,"value":"h3"},{"node":10193,"type":"attach"},{"node":10193,"type":"put","key":"tag","feat":0,"value":"span"},{"node":10194,"type":"attach"},{"node":10194,"type":"put","key":"visible","feat":0,"value":false},{"node":10194,"type":"put","key":"tag","feat":0,"value":"vaadin-vertical-layout"},{"node":10195,"type":"attach"},{"node":10195,"type":"put","key":"tag","feat":0,"value":"vaadin-progress-bar"},{"node":10195,"type":"put","key":"min","feat":1,"value":0},{"node":10195,"type":"put","key":"max","feat":1,"value":1},{"node":10195,"type":"put","key":"indeterminate","feat":1,"value":true},{"node":10195,"type":"put","key":"value","feat":1,"value":0},{"node":10196,"type":"attach"},{"node":10196,"type":"put","key":"tag","feat":0,"value":"div"},{"node":10196,"type":"splice","feat":2,"index":0,"addNodes":[10195,10194,10158,10140]},{"node":10196,"type":"put","key":"width","feat":12,"value":"100%"},{"node":10196,"type":"put","key":"flex-grow","feat":12,"value":"2.0"},{"node":10197,"type":"attach"},{"node":10197,"type":"put","key":"tag","feat":0,"value":"div"},{"node":10197,"type":"splice","feat":2,"index":0,"addNodes":[10196,10139]},{"node":10197,"type":"splice","feat":11,"index":0,"add":["content","gap-m","align-items","stretch"]},{"node":10197,"type":"put","key":"display","feat":12,"value":"flex"},{"node":10197,"type":"put","key":"width","feat":12,"value":"100%"},{"node":10198,"type":"attach"},{"node":10198,"type":"put","key":"tag","feat":0,"value":"vaadin-icon"},{"node":10198,"type":"put","key":"icon","feat":3,"value":"vaadin:search"},{"node":10198,"type":"put","key":"slot","feat":3,"value":"suffix"},{"node":10199,"type":"attach"},{"node":10199,"type":"put","key":"visible","feat":0,"value":true},{"node":10199,"type":"put","key":"tag","feat":0,"value":"vaadin-button"},{"node":10199,"type":"splice","feat":2,"index":0,"addNodes":[10198]},{"node":10199,"type":"put","key":"theme","feat":3,"value":"icon primary"},{"node":10199,"type":"put","key":"click","feat":4,"value":"F8oCtNArLiI="},{"node":10199,"type":"put","key":"z-index","feat":12,"value":"10000"},{"node":10199,"type":"put","key":"top","feat":12,"value":"6rem"},{"node":10199,"type":"put","key":"display","feat":12,"value":"flex"},{"node":10199,"type":"put","key":"position","feat":12,"value":"fixed"},{"node":10199,"type":"put","key":"right","feat":12,"value":"0.5rem"}],"execute":[[null,"candidates?status=all","setTimeout(() => window.history.replaceState($0, '', $1))"],["Candidates | DecisionWanted.com","document.title = $0"],[[0,5202],"return (function() { var el = this; setTimeout(function() {el.scrollIntoView();}, 0);}).apply($0)"],[[0,10147],"return (function() { this._shouldSetInvalid = function (invalid) { return false };}).apply($0)"],[false,[0,3],"return (function() { this.serverConnected($0)}).apply($1)"],[18,null,[0,1],"return (function() { this.$server['}p']($0, true, $1)}).apply($2)"]]}]

and UI with infinitive progress bars. The issue is very well producible right now

@alexanoid
Copy link
Author

Looks like after sleep mode and wake up - PUSH stopped working at all. Only XHR requests are working

@mcollovati
Copy link
Collaborator

Nice catch. But it seems to me this is a different issue from the one causing the resynchronization.
It seems we have

  1. a problem with PUSH+long-polling not able to reconnect after sleep mode
  2. an issue with a message lost (probably by PUSH+long-polling) after a redirection caused by a local session expiration

Now that you can reproduce the issue, do you mind creating a simple project so that we can debug locally?

@alexanoid
Copy link
Author

Sure, let me see what I can do with a sample project. The biggest problem that this project is a huge code base.. I'll try

@alexanoid
Copy link
Author

That's crazy, but I'm unable to reproduce issue #1 on localhost. However, this issue is reproducible on the production environment where NGINX is involved. So, I suspect right now that there is some NGINX misconfiguration or something like that.

@alexanoid
Copy link
Author

alexanoid commented Apr 28, 2023

Also, the issue #1 is only reproducible in FF browser. In Chrome and MS Edge everything is working fine.

I even tried to change the Linux settings, to:

sysctl -w net.ipv4.tcp_keepalive_time=60
sysctl -w net.ipv4.tcp_keepalive_intvl=15
sysctl -w net.ipv4.tcp_keepalive_probes=5

it doesn't help.

For some unknown reason after sleep mode and session expiration, PUSH stops working in Vaadin application opened in FF browser (I test it under Win 10).

In FF in this case it only sends the following requests:

https://decisionwanted.com/?v-r=uidl&v-uiId=7

and doesn't send the

https://decisionwanted.com/VAADIN/push?v-r=push&v-uiId=2&v-....

Chrome sends both..

@mcollovati
Copy link
Collaborator

That is really weird. Please, double check that the application is effectively using web sockets and has not fallback to long polling

@knoobie
Copy link
Contributor

knoobie commented May 23, 2023

Push over XHR uses websockets as protocol, so it's highly possible your nginx config has to be adopted.

@alexanoid
Copy link
Author

I already have the following config in place:

	    proxy_http_version 1.1;
	    proxy_set_header Upgrade $http_upgrade;
	    proxy_set_header Connection "Upgrade";

Websockets work fine, when it work. I tried to debug my iPhone with dev console on MacBook, and do not see fallback to long polling

@alexanoid alexanoid reopened this May 23, 2023
@alexanoid
Copy link
Author

I apologize, accidentally clicked close button here

@alexanoid
Copy link
Author

alexanoid commented May 23, 2023

I don't know is it related but found a few errors(actually alerts) in NGINX error log:

2023/05/23 20:19:30 [alert] 1354970#1354970: *499843 could not allocate new session in SSL session shared cache "le_nginx_SSL" while SSL handshaking, client: *****, server: ****

Applied the fix to letsencrypt from here: https://serverfault.com/questions/1045597/could-not-allocate-new-session-in-ssl-session-shared-cache-le-nginx-ssl-while

ssl_session_cache shared: le_nginx_SSL:20m; # before 10m

@alexanoid
Copy link
Author

The same issue also, after resync - XHR works with WEBSOCKET_XHR transport, but PUSH doesn't work.

In the application log I see the following:

2023-05-23T22:06:20.663+03:00  INFO 1917501 --- [Catalina-utility-1] c.d.u.c.s.v.VaadinSessionConfiguration   : Session destroy event: com.vaadin.flow.server.SessionDestroyEvent[source=com.vaadin.flow.spring.SpringVaadinServletService@4b912824]
2023-05-23T22:06:20.881+03:00  WARN 1917501 --- [http-nio-8080-exec-6] c.v.f.s.communication.ServerRpcHandler   : Resynchronizing UI by client's request. A network message was lost before reaching the client and the client is reloading the full UI state. This typically happens because of a bad network connection with packet loss or because of some part of the network infrastructure (load balancer, proxy) terminating a push (websocket or long-polling) connection. If you are using push with a proxy, make sure the push timeout is set to be smaller than the proxy connection timeout
2023-05-23T22:07:20.665+03:00  INFO 1917501 --- [Catalina-utility-1] c.d.u.c.s.v.VaadinSessionConfiguration   : Session destroy event: com.vaadin.flow.server.SessionDestroyEvent[source=com.vaadin.flow.spring.SpringVaadinServletService@4b912824]
2023-05-23T22:07:20.665+03:00  INFO 1917501 --- [Catalina-utility-1] c.d.u.c.s.v.VaadinSessionConfiguration   : Session destroy event: com.vaadin.flow.server.SessionDestroyEvent[source=com.vaadin.flow.spring.SpringVaadinServletService@4b912824]


@alexanoid
Copy link
Author

Hi @mcollovati ! I apologize for disturbing you, but is there any progress on this issue? I checked my logs and there are still a bunch of the following errors there:

2023-06-03T12:04:07.267+03:00  INFO 489675 --- [http-nio-8080-exec-4] c.d.u.c.s.v.VaadinSessionConfiguration   : A new UI has been initialized
2023-06-03T12:04:10.663+03:00 ERROR 489675 --- [http-nio-8080-exec-4] c.d.u.e.handlers.CustomErrorHandler      : Something wrong happened

java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected sync id: 3, got 4. more details logged on DEBUG level.
	at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:313) ~[flow-server-24.1.0.alpha6.jar!/:24.1.0.alpha6]
	at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:114) ~[flow-server-24.1.0.alpha6.jar!/:24.1.0.alpha6]

@mcollovati
Copy link
Collaborator

Hi, I'm sorry but without a setup that can be used to consistently reproduce the issue there's not much we can do.
Especially for the last errors you mentioned, I was never able to reproduce.

@alexanoid
Copy link
Author

alexanoid commented Jun 4, 2023

I'm trying to catch it somehow.. What is the most current version for 24.1 which should I use right now? Is it 24.1.0.rc2 ?

@alexanoid
Copy link
Author

Do we have ping-pong functionality in Vaadin Flow for WEBSOCKET_XHR to detect stale/broken connections? If no, may be there is some example how to implement it?

@mcollovati
Copy link
Collaborator

I'm trying to catch it somehow.. What is the most current version for 24.1 which should I use right now? Is it 24.1.0.rc2 ?
Yes, 24.1.0.rc2 is the latest pre-release.

Do we have ping-pong functionality in Vaadin Flow for WEBSOCKET_XHR to detect stale/broken connections? If no, may be there is some example how to implement it?

IIRC there's no such functionality implemented in Flow.

BTW, I don't remember if you have tried to set the org.atmosphere.cpr.CometSupport.maxInactiveActivity property for atmosphere. The documentation states it is The maximum time, in milliseconds, a connection gets idle or when the WIFI disconnection wasn't detected by the underlying container.
I don't know if it may help with your issues and I also don't have any idea what a sensible value could be, but it may be worth giving it a try.

@alexanoid
Copy link
Author

@mcollovati thank you! I'll try!

One more question - do I need to use your fix with the patched AtmosphereBroadcaster in version 24.1, or was it already incorporated there?

@mcollovati
Copy link
Collaborator

The code I posted has currently not been integrated. It requires more research

@alexanoid
Copy link
Author

@mcollovati Is it possible to catch the 'resync' event/state somehow in the application, in order to attempt a full page refresh instead of trying to recover through an XHR request?

@mcollovati
Copy link
Collaborator

The resynchronization request comes from the client when it does not receive a missing message after waiting for it for a while, so you cannot intercept it on the server side before it happens

@alexanoid
Copy link
Author

Thanks, I mean I'd like to intercept this on the client in order to reload the page from JS call.

@markhammond
Copy link

markhammond commented Dec 8, 2023

Thanks, I mean I'd like to intercept this on the client in order to reload the page from JS call.

As root cause analysis is proving elusive it would be great to prioritise the ability to intercept this condition so the client and backend can effectively reset and recover.

I experienced this issue with v24.2.4 when using the default websocket transport and manual push. The Vaadin debug monitor does detect an error, but the browser just continued to show a stale view state while remaining in an "offline" state.

My environment setup is comparatively simple: running on Windows local host using Chrome browser tools and switching connection throttle profile to “offline” (just for a few seconds) before reverting to “none”. I can confirm calls to update component state and calls to push are guarded by access().

It's worth noting my application code aggressively debounces UI state updates and calls to push, so as to batch updates and limit websocket bandwidth utilisation. Though I apply jitter some batching does occur and I suppose can result in "large" UIDL messages from time to time.

Have included the associated stack trace:

2023-12-08T16:07:11.665+08:00 INFO 678172 --- [nio-8080-exec-2] c.v.f.s.communication.ServerRpcHandler : Ignoring old duplicate message from the client. Expected: 137, got: 136
2023-12-08T16:07:11.824+08:00 ERROR 678172 --- [nio-8080-exec-4] c.v.flow.server.DefaultErrorHandler :

java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected sync id: 137, got 138. more details logged on DEBUG level.
  at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:313) ~[flow-server-24.2.4.jar:24.2.4]
  at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:114) ~[flow-server-24.2.4.jar:24.2.4]
  at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[flow-server-24.2.4.jar:24.2.4]
  at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1522) ~[flow-server-24.2.4.jar:24.2.4]
  at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398) ~[flow-server-24.2.4.jar:24.2.4]
  at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106) ~[vaadin-spring-24.2.4.jar:na]
  at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.15.jar:6.0]
[—8<—]

@netsrotr
Copy link

Any progress here? We do also noticed these kind of Exceptions on our production TomEE application server.
But here it looks like it happened after a session timeout, if any user still have the app open in a browser tab and on server app redeployments - what I have seen here seems to be "normal".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔎 Investigation
Development

No branches or pull requests

6 participants