Skip to content

Internal errors since upgrading to 24.7.0 #21204

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

Open
oliveryasuna opened this issue Mar 31, 2025 · 15 comments
Open

Internal errors since upgrading to 24.7.0 #21204

oliveryasuna opened this issue Mar 31, 2025 · 15 comments

Comments

@oliveryasuna
Copy link
Contributor

oliveryasuna commented Mar 31, 2025

Description of the bug

We periodically see "Unexpected message id from the client" errors in the logs. See more about those in this issue: #12640.

On 24.6.5, they didn't cause an internal error. After upgrading to 24.7.0, it seems they now trigger a internal error and make the UI unresponsive.

Image

In our case, we may see these errors more than most because ours users typically have very poor internet. On 24.6.5, it was fine for us because they didn't trigger an internal error.

I should also mention that, since upgrading to 24.7.0, we see these errors more often, but that is a secondary concern to us.

Nothing has changed besides the Vaadin version.

Thank you!

Expected behavior

Upgrading from 24.6.5 to 24.7.0 is a minor release bump. If changes in fact caused the internal errors, it should be fixed, as it breaks existing behavior.

Minimal reproducible example

I am unable to reproduce consistently.

Versions

  • Vaadin / Flow version: 24.7.0
  • Java version: 21
  • OS version: N/A
  • Browser version (if applicable):
  • Application Server (if applicable):
  • IDE (if applicable):
@mshabarov
Copy link
Contributor

mshabarov commented Apr 1, 2025

Thanks for the issue! Could you please provide server logs and possibly the browser console logs once these happens again?
Do you use Push ? Which transport if yes, does server push updates frequently ?

@oliveryasuna
Copy link
Contributor Author

oliveryasuna commented Apr 1, 2025

@mshabarov Thank you for your speedy response!

Thanks for the issue! Could you please provide server logs and possibly the browser console logs once these happens again? Do you use Push ? Which transport if yes, does server pushes frequently ?

Here is the exception on the server:

java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected client id: 7, got 5. more details logged on DEBUG level.
	at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:365)
	at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:138)
	at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:63)
	at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1664)
	at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1621)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:89)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1593)
	at org.eclipse.jetty.ee10.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:195)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1593)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1554)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:819)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:436)
	at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:469)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575)
	at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:717)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1064)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:181)
	at org.eclipse.jetty.server.Server.handle(Server.java:182)
	at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662)
	at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:416)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:480)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:443)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Nothing in the browser logs related to this that I can find.

We use Push, yes, with the default mode of AUTOMATIC and default transport of WEBSOCKET_XHR.

Note that today we downgraded to 24.6.5, isolated without any other changes, and no longer see the internal server error banner. Ideally, we'd love to upgrade again :)

@mshabarov mshabarov moved this from 🪵Product backlog to 🟢Ready to Go in Vaadin Flow ongoing work (Vaadin 10+) Apr 2, 2025
@urkl
Copy link

urkl commented Apr 2, 2025

I have the same problems after upgrading.

@caalador
Copy link
Contributor

caalador commented Apr 4, 2025

Any idea what type of view or usage this happens with?
I tried with big latency, huge packetloss (i did loose some text field changes) and packet reordering, but at least for the skeleton I couldn't get any internal errors to happen.

@urkl
Copy link

urkl commented Apr 4, 2025

@caalador thanks for response. We have a really big app. This happens after uploading sam json files to server. I assume somewhere in afterUpload listener. But I am not completely sure.

@caalador
Copy link
Contributor

caalador commented Apr 7, 2025

After trying with all the things I could come up with I could not replicate the issue to get any insight on what would be happening.
If there is a sample view with some fucntionality and content that makes this happen it would help. Even something resembling what usually fails for users.

@oliveryasuna
Copy link
Contributor Author

@caalador We also have a really big app. I think the bottom line is, something changed between 24.6.5 and 24.7.0 to how Flow handles unexpected message ID errors. Perhaps related to this change?

Image

@oliveryasuna
Copy link
Contributor Author

oliveryasuna commented Apr 7, 2025

The issue is probably related to https://github.com/vaadin/flow/pull/20547/files or https://github.com/vaadin/flow/pull/20749/files.

Most likely the former. In 24.6.5, Flow would log and ignore unexpected message IDs, but it looks like it now throws ClientResentPayloadException.

Here is an example flow that could cause an "Unexpected message id" error:

  1. User performs an action (like clicking a button) that triggers a client-side request to the server.
  2. The client assigns ID 6 to this request and sends it to the server.
  3. Due to a network issue, browser behavior, or application logic, the client doesn't receive a response in time.
  4. Meanwhile, the client continues operating and sends more requests with IDs 7, 8, 9.
  5. The server processes these requests and updates its expected next ID to 10.
  6. The original request with ID 6 finally arrives at the server (delayed or resent).
  7. The server sees ID 6 but expects ID 10, triggering the error.

In 24.6.5, when this happened, the server would just ignore the out-of-sequence message and continue.
In 24.7.0, the server tries to resynchronize by sending the last known response.

@urkl
Copy link

urkl commented Apr 7, 2025

This is in my logs. It happens when uploading multiple files:

7c4710cf46a2 [email protected] [email protected] c=n.u.a.c.s.UiService .processErrorEvent(1008) t=http-nio-8090-exec-56 | Unexpected message id from the client. Expected client id: 12, got 11. more details logged on DEBUG level. java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected client id: 12, got 11. more details logged on DEBUG level. kronos-manager | at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:365) kronos-manager | at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:138) kronos-manager | at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:63) kronos-manager | at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1664) kronos-manager | at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398) kronos-manager | at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106) kronos-manager | at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) kronos-manager | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195) kronos-manager | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) kronos-manager | at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:633) kronos-manager | at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:409) kronos-manager | at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:304) kronos-manager | at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:268) kronos-manager | at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:142) kronos-manager | at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:178) kronos-manager | at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51) kronos-manager | at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089) kronos-manager | at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) kronos-manager | at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) kronos-manager | at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) kronos-manager | at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) kronos-manager | at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) kronos-manager | at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) kronos-manager | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195) kronos-manager | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) kronos-manager | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) kronos-manager | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) kronos-manager | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) kronos-manager | at net.urosk.aion.core.configurations.MdcFilter.doFilter(MdcFilter.java:50) kronos-manager | at jakarta.servlet.http.HttpFilter.doFilter(HttpFilter.java:53) kronos-manager | at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) kronos-manager | at java.base/java.lang.reflect.Method.invoke(Method.java:580) kronos-manager | at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:359) kronos-manager | at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) kronos-manager | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) kronos-manager | at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) kronos-manager | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) kronos-manager | at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:727) kronos-manager | at net.urosk.aion.core.configurations.MdcFilter$$SpringCGLIB$$0.doFilter(<generated>) kronos-manager | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

@mcollovati
Copy link
Collaborator

Can you give it a try with Flow 24.7.2?
There's not yet a 24.7.2 Vaadin platform, but you can add flow-bom in the dependency management section before vaadin-bom. Please also make sure a production bundle is built by setting forceProductionBuild=true.

For a Maven project

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>flow-bom</artifactId>
                <version>24.7.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <version>${vaadin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>            
        </dependencies>
    </dependencyManagement>

   ....
                    <plugin>
                        <groupId>com.vaadin</groupId>
                        <artifactId>vaadin-maven-plugin</artifactId>
                        <version>${vaadin.version}</version>
                        <configuration>
                            <forceProductionBuild>true</forceProductionBuild>
                        </configuration>
                        ....
                     </plugin>

@guttormvik2
Copy link

@mcollovati, when I tried to build my prod.bundle with 24.7.2 flow-bom, the build failed:

[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:24.7.0:build-frontend (default) on project ptsmc-widgetset: null: MojoFailureException: InvocationTargetException: 'void com.vaadin.flow.server.frontend.TaskCleanFrontendFiles.<init>(java.io.File, java.io.File, com.vaadin.flow.server.frontend.scanner.ClassFinder)' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.vaadin:vaadin-maven-plugin:24.7.0:build-frontend (default) on project ptsmc-widgetset: null
...
Caused by: java.lang.NoSuchMethodError: 'void com.vaadin.flow.server.frontend.TaskCleanFrontendFiles.<init>(java.io.File, java.io.File, com.vaadin.flow.server.frontend.scanner.ClassFinder)'
    at com.vaadin.flow.plugin.maven.BuildFrontendMojo.executeInternal (BuildFrontendMojo.java:141)
    at com.vaadin.hilla.maven.BuildFrontendMojo.executeInternal (BuildFrontendMojo.java:65)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at com.vaadin.flow.plugin.maven.FlowModeAbstractMojo.execute (FlowModeAbstractMojo.java:306)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)

@mcollovati
Copy link
Collaborator

I see. Can you update Vaadin to 24.7.1? That platform version should be compatible with Flow 24.7.2

@guttormvik2
Copy link

I ended up with error eventually:

12:35:45,013 ERROR [com.ptsmc.vaadin.CustomErrorHandler] (default task-1) Logged error: java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected client id: 17, got 16. more details logged on DEBUG level.
	at deployment.ptsmc.ear//com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:365)
	at deployment.ptsmc.ear//com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:138)
	at deployment.ptsmc.ear//com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:63)
	at deployment.ptsmc.ear//com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1664)
	at deployment.ptsmc.ear//com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398)
	at [email protected]//jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at [email protected]//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)

The behavior before that seemed different and it is possible it ran longer before giving the error.

My case is that I run a really long background job and try to update progress in a dialog.

Now, when the job has run for quite some time, the dialog is "reopened"? That is new.
Visually, it does a small zoom, like when it is opened, and the outside becomes one step darker. This happens 2-3 times in quick succession and then it goes back to the initial darker step.
I assume you replace the entire GUI with a fresh copy from the server when you go out of sync?

But, eventually I get "Unexpected message id from the client"

The background job is a bit special: It is a custom test routine that opens up all our screens, and "runs" them (performs default search, selects first row which opens any detail, goes through all tabs, opens all context menus, selects all entries...)

This is a bit funky; It is supposed to run in the background, but some elements do end up on screen.
I have not bothered with this before, since it ran to completion and I got the result I wanted.
Now that it crashes I will have to check. Maybe I have some code that is not threadsafe

@guttormvik2
Copy link

@mcollovati, looks like my issue was caused by this: #20917
When I changed my dialog to non-modal, I got no errors

@mcollovati
Copy link
Collaborator

@guttormvik2 Thank you for testing the new version and for the feedback.
Also, thanks for sharing more details about the problems and your application.
A long-running background thread interacting with dialogs and context menus is probably something we did not yet try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 High Priority (P1)
Status: 🟢Ready to Go
Development

No branches or pull requests

6 participants