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

Invalid JSON from server #21102

Open
F-Kamp opened this issue Mar 7, 2025 · 8 comments
Open

Invalid JSON from server #21102

F-Kamp opened this issue Mar 7, 2025 · 8 comments

Comments

@F-Kamp
Copy link

F-Kamp commented Mar 7, 2025

Description of the bug

Two different customers have reported seeing an "Invalid JSON from server [...}" error in the browser when running our application.

Image
Image

Unfortunately I have very little information about the circumstances when the bugs were observed.

One customer left the view of our application opened in the browser and returned 10-15 minutes later and saw the error. They can't tell me where they navigated to before they left the PC.

The other customer had a view open that is updated after receiving events with new data from the backend. That view uses the async manager under the hood and a dedicated thread that groups multiple concurrent update requests and enforces a single refresh (it's enough to load the data once even if we receive 10 change notifications for that view).

We are using WildFly 32 to deploy our application and we use the @Push and @PreserveOnRefresh annotations with their default values.

I know the information is very limited so my first question would be if there is any kind of debug logging that I can activate at the customer's site to help investigate the issue?

Expected behavior

The UI of our application should be displayed.

Minimal reproducible example

Unfortunately I can't reproduce the errors I only have the attached screenshots.

Versions

  • Vaadin / Flow version: 24.5.3
  • Java version: 21
  • OS version: Windows 10 / Windows Server 2016
  • Browser version (if applicable): Chrome (unknown version), Edge 133.0.3065.92
  • Application Server (if applicable): WildFly 32
  • IDE (if applicable):
@Artur-
Copy link
Member

Artur- commented Mar 7, 2025

It sounds like #6289. The "invalid JSON" from the server contains an extra 112162| which is supposed to be removed earlier on by Atmosphere

@F-Kamp
Copy link
Author

F-Kamp commented Mar 7, 2025

Oh wow, I didn't expect anyone to identify the problem so easily!

#6289 seems to be unresolved since 2019. Is there any hope that it will be fixed soon?

@Artur-
Copy link
Member

Artur- commented Mar 7, 2025

Maybe you can try the reproduction case with your app and see if it actually is that issue

@F-Kamp
Copy link
Author

F-Kamp commented Mar 7, 2025

I've tried to adapt the steps that you've described in #6289 but I'm having troubles following them. As far as I can tell I'm supposed to:

  1. Launch my application
  2. Create an SSH tunnel from my own machine to itself in a command window
  3. Use that command window to access my application
  4. Kill the SSH tunnel
  5. Re-establish the SSH tunnel
  6. The error should appear (in the command window?)

I can follow steps 1 & 2 (after starting the SSH server on my machine) but I don't know how I can access my application through a command window. There's no "open" command on my machine (Windows 11).

@Artur-
Copy link
Member

Artur- commented Mar 7, 2025

the tunnel forwards port 1234 to port 8080 on localhost, so open the app in the browser using http://localhost:1234 instead of http://localhost:8080 and you will be using it through the tunnel

@F-Kamp
Copy link
Author

F-Kamp commented Mar 7, 2025

Thank you for the clarification. However I still wasn't able to get it to work. When accessing http://localhost:1234/ after creating the tunnel I see the following result:

Image

Which doesn't really surprise me because my application is reachable under http://localhost:8080/SynapticaOS/ - the root path (http://localhost:8080/) is reserved for WildFly.

Accessing http://localhost:1234/SynapticaOS doesn't work:

Image

And trying to add /SynapticaOS in the ssh command ssh localhost -L 1234:localhost:8080/SynapticaOS doesn't work either:
Bad local forwarding specification '1234:localhost:8080/SynapticaOS'

@Artur-
Copy link
Member

Artur- commented Mar 8, 2025

The ssh tunnel forwards ports, not urls. Looks like your server is refusing connections from anything but localhost, maybe it needs a "bind to 0.0.0.0 instead of 127.0.0.1" parameter, something like "-b 0.0.0.0" maybe.

You should be able to access http://localhost:1234/SynapticaOS/ without any changes to the ssh command

@F-Kamp
Copy link
Author

F-Kamp commented Mar 10, 2025

Thank you for bearing with me. Indeed, the bind parameter was the culprit. After changing it to 0.0.0.0 I was able to follow the steps you've described.

However, I didn't receive any error after reconnecting the ssh tunnel.

But the "Invalid JSON from server" error somehow occurred at two of our clients. How can we proceed to investigate this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 Normal Priority (P2)
Status: 🅿️Parking lot
Development

No branches or pull requests

3 participants