-
Notifications
You must be signed in to change notification settings - Fork 37.7k
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
"Status and headers already sent" ISE exception from Reactor Netty on WebSocket upgrade #24475
Comments
Yes, we'll need more information: an application that reproduces the issue would definitely help here, as we can't guess the exact code path/use case triggering this behavior. Are you sure this is happening when requesting the websocket endpoint and not some other endpoint? Do you have filters or other pieces of infrastructure trying to write to the response? Starting from a blank app from start.spring.io and adding pieces to it until this is reproducing the problem is I think the best course of action here. |
I forgot to mention we are using Spring Security. I know this kind of problem is pretty hard to solve. I wanted to report it and to get some hint. Eg. this similar one had to do with Chrome requests: It would be nice to have better logging support for these exceptions. |
Are you using Spring Cloud Gateway? If not, the issue is only similar in a wway that gateway had a filter that was trying to modify the headers while the response was already committed. Please let us know if you find additional information. |
No, I am not using Spring Cloud Gateway. I was just googling stacktrace , it might help you to identify the problem as well. |
I think we do have an issue. For WebSocket the request is handled through The WebFlux response should probably be committed prior the upgrade in order to cause commit actions to take place. A call to |
@rstoyanchev Thanks for the analysis. You might be right. I disabled Spring Security for the websocket endpoint and so far I don't see the exception in the log again. |
Even thought Tomcat and Jetty, which commit the response more lazily, were not impacted by this issue, it still makes sense for them to complete the WebFlux response (and pre-commit actions) at the same time as for other servers for consistent behavior. See gh-24475
From the server log I quite often see this nasty exception. We are mixing Weblux + Websockets
My websocket configuration:
DataService is providing text String.
Browser side:
It's difficult to debug - maybe it's related to cookies somehow(last 2 methods in the exception).
Let me know If I can provide more information.
The text was updated successfully, but these errors were encountered: