-
Notifications
You must be signed in to change notification settings - Fork 3
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
Vaadin Push fails during session deserialization #111
Comments
In this case, it appears that the Flow client, for some reason (page reload? Navigating away?), is closing the push connection ( |
@mcollovati Unfortunately, I could not find related messages in the logs. |
Unfortunately, I'm unable to reproduce the PUSH 405 failure. For further investigation, it would be good to have the trace of the previous UIDL request (request + response payloads) and, if Spring Security is configured for the application, the server logs with category |
@MichaelPluessErni additional question: is this happening in production or development mode? |
@mcollovati this happens in production mode. I'll have a look whether I can procure a logging trace as described in your previous post. |
Testing locally, I had a confirmation that the POST PUSH request is caused by a page reload, not the opposite. |
I've been unable to replicate the 405 Error Code for some time. Instead I've observed different behaviour, that might be related: When having the website open and restarting the pod, sometimes the website stays at it is (desired) and sometimes it reloads and goes back to the login screen (not desired). In the case where it reloads, I've seen in the last "app/?v-r=uidl&v-uild=1" Request that two Set-Cookie headers were added. In most cases these headers are not present. Might this be related and cause a reload? In cases where there was no reload, an "app/?v-r..." request was not present. I hope this helps / gives a clue. |
It would be good to know the contents of the UIDL request. |
The Contents of the UIDL request: Request headers:
Payload:
Interestingly, the reload seems to be triggered by a click on the website. It does not reload of its own beforehand. |
Could you post also the content of the response? |
Example of the response headers of one of these requests where a reload happened:
(Edit: this is not quite correct) There does not seem to be a response body. Instead the browser debugger shows this message: This seems to be expected Chrome behaviour: https://superuser.com/questions/1788537/why-do-chromes-developer-tools-fail-to-collect-data-consistently |
I was able to retrieve an example where the page was reloaded. Here the issue seemed to have been a session loss. Situation:
UIDL request:
UIDL response:
This triggered a push request: PUSH request headers:
PUSH response headers:
Logs:
I hope this helps. Let me know if you need anything else. |
Thanks, @MichaelPluessErni One thing to notice is that the response to the UIDL request has a I'll have to find a way to reproduce the issues constantly and debug the session expiration handlig. |
This comment on a Flow issue may be related to the session expiration case: vaadin/flow#12640 (comment) |
Currently clusterKey cookie is set only when an HTTP session exists. In addition to the cookie, the key is also set as a session attribute so that SessionSerializer can fetch it later. However, if two or more concurrent requests are sent from the client, all of them create a new cookie, but the session attribute gets the value of the first one. This causes the distributed session to be written with a wrong key and when there a server switch the session cannot be restored. This change sets the clusterKey cookie even if there is not yet an HTTP session, so the key is only defined during first request and remains stable with subsequent calls; once the HTTP session is create, the key is stored as an attribute. Potentially fixes #111 See https://github.com/vaadin/kubernetes-kit/issues/111\#issuecomment-2074909790
Re-opening because it is not confirmed that the referenced fix resolves this issue |
Error:
During session deserialization it can happen, that vaadin pushes fail and trigger a refresh.
Expectation:
Refreshs should not be triggered during session deserialization.
More details:
I suspect that the push process and the deserialization process run in parallel and can interfere.
Versions:
Flow: 24.3.5
Vaadin: 24.3.4
Spring Boot: 3.2.2
Java: Oracle Corporation 17
OS: amd64 Windows 10 10.0
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Live reload: Java unavailable
(JRebel): Front end active
The text was updated successfully, but these errors were encountered: