question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"endRequest called when no request is active"

See original GitHub issue

Seems to happen when you redeploy a @Push enabled application. Browser console says

Push connection re-established using websocket
21:34:09.738 client-52731741FE58EF8056D7E6EA323C8436.cache.js:185 JSON parsing took 0ms
21:34:09.738 client-52731741FE58EF8056D7E6EA323C8436.cache.js:185 Received push (websocket) message: for(;;);[{"meta":{"sessionExpired":true}}]
21:34:09.738 client-52731741FE58EF8056D7E6EA323C8436.cache.js:1049 Response didn't contain a server id. Please verify that the server is up-to-date and that the response data has not been modified in transmission.
Eq @ client-52731741FE58EF8056D7E6EA323C8436.cache.js:1049
21:34:09.738 client-52731741FE58EF8056D7E6EA323C8436.cache.js:1065 Handling message from server
21:34:09.738 client-52731741FE58EF8056D7E6EA323C8436.cache.js:1006 Handling dependencies
21:34:09.739 client-52731741FE58EF8056D7E6EA323C8436.cache.js:185 handleUIDLMessage: 0 ms
21:34:09.739 client-52731741FE58EF8056D7E6EA323C8436.cache.js:185 Setting heartbeat interval to -1sec.
21:34:09.739 client-52731741FE58EF8056D7E6EA323C8436.cache.js:1001 Closing push connection
21:34:09.739 client-52731741FE58EF8056D7E6EA323C8436.cache.js:185  Processing time was 1ms
client-52731741FE58EF8056D7E6EA323C8436.cache.js:210 endRequest called when no request is active
HB @ client-52731741FE58EF8056D7E6EA323C8436.cache.js:210
21:35:09.763 vaadinPush.js?v=1.0.0.beta9:3259 Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). - wasClean: false
log @ vaadinPush.js?v=1.0.0.beta9:3259
warn @ vaadinPush.js?v=1.0.0.beta9:3265
_websocket.onclose @ vaadinPush.js?v=1.0.0.beta9:1517
21:35:09.764 client-52731741FE58EF8056D7E6EA323C8436.cache.js:1068 Push connection closed
21:35:09.764 client-52731741FE58EF8056D7E6EA323C8436.cache.js:782 Reopening push connection
21:35:15.788 client-52731741FE58EF8056D7E6EA323C8436.cache.js:185 Push connection re-established using websocket
21:35:15.790 client-52731741FE58EF8056D7E6EA323C8436.cache.js:185 JSON parsing took 0.1ms
21:35:15.790 client-52731741FE58EF8056D7E6EA323C8436.cache.js:185 Received push (websocket) message: for(;;);[{"meta":{"sessionExpired":true}}]
21:35:15.790 client-52731741FE58EF8056D7E6EA323C8436.cache.js:1049 Response didn't contain a server id. Please verify that the server is up-to-date and that the response data has not been modified in transmission.
Eq @ client-52731741FE58EF8056D7E6EA323C8436.cache.js:1049
Qo @ client-52731741FE58EF8056D7E6EA323C8436.cache.js:1068
(anonymous) @ client-52731741FE58EF8056D7E6EA323C8436.cache.js:1037
ob @ client-52731741FE58EF8056D7E6EA323C8436.cache.js:439
rb @ client-52731741FE58EF8056D7E6EA323C8436.cache.js:931
(anonymous) @ client-52731741FE58EF8056D7E6EA323C8436.cache.js:638
_f @ vaadinPush.js?v=1.0.0.beta9:2765
_invokeFunction @ vaadinPush.js?v=1.0.0.beta9:2754
_invokeCallback @ vaadinPush.js?v=1.0.0.beta9:2884
_websocket.onmessage @ vaadinPush.js?v=1.0.0.beta9:1457
21:35:15.791 client-52731741FE58EF8056D7E6EA323C8436.cache.js:1049 Ignored received message because application has already been stopped

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mobileWMScommented, Sep 18, 2019

Flow version ‘2.0.12’, platform version ‘14.0.5’, vaadin7 version ‘7.7.17’ ( so I am using MPR ) Coding on Windows 10, using Eclipse 2019-06 (4.12.0) Problem occurs in logout code, like @mpilone.

  • Testing in Chrome 77.0.3865.75 - very quick appearance of the endRequest error that users can see. Did not look at console because of error message.
  • Testing in Firefox 69.0 - same as Chrome, obvious to users. Did not look at console because of error message.
  • Testing in IE 11.356.18362.0 - no obvious problems, BUT if I open the console I see the same problem there. Farther up in console I see an error about response not containing a valid server id, and this all happens before “Navigation occurred” log message in Console.
  • Testing in Edge 44.18362.329.0 - no obvious problem, but console showed much the same things as IE.

I can say that, in my tests, if I call currentUi.getPage().executeJs("window.location.href=''"); and do NOT call VaadinSession.getCurrent().getSession().invalidate();, I do not get the error. So the problem seems to be related to invalidating the session, maybe?

Tell me if you need more information, but my basic goal is the same as @mpilone.

I tried a lot of things, using Chrome as my browser most of the time. See below:

  1. Out of curiosity, I decided to try using VaadinSession.getCurrent().close(); instead of VaadinSession.getCurrent().getSession().invalidate();. This did not fix the issue. It actually causes another issue entirely, in addition to this one, because things are not properly cleaned up. Yes, this is not valid, was just experimenting.
  2. Then I tried doing VaadinSession.getCurrent().close(); before VaadinSession.getCurrent().getSession().invalidate();, but that did not help either. It did not cause other problems, just did not fix my endRequest problem.
  3. Same thing happens whether I do currentUi.navigate(""); or currentPage.reload();. Also, same thing happens if I move currentUi.navigate(""); to before I call VaadinSession.getCurrent().getSession().invalidate(); ( with or without calling VaadinSession.getCurrent().close(); ).
  4. I changed currentUi.navigate(""); to currentUi.getPage().executeJs("window.location.href=''");, and still get the same problem if I call VaadinSession.getCurrent().getSession().invalidate();.
  5. Now, what is really interesting is that if I do NOT call VaadinSession.getCurrent().getSession().invalidate();, I don’t get the error. Obviously, currentUi.navigate(""); does nothing if I don’t call invalidate, but currentUi.getPage().executeJs("window.location.href=''"); works without error.
  6. Commenting out @Push and any references to UI.access of course removes the problem. If I just comment out all references to UI.access, but keep @Push, we still have the problem. This makes sense considering the comments of others.
  7. For the sake of completeness, I also tried programmatic UI.getCurrent().getPushConfiguration().setPushMode(PushMode.MANUAL);UI.getCurrent().getPushConfiguration().setTransport(Transport.WEBSOCKET); and declarative @Push(value = PushMode.MANUAL, transport = Transport.WEBSOCKET). I get this error, even though I am not actively using push, it is simply enabled.
0reactions
bogdanudrescucommented, Nov 11, 2019

Someone else may continue the fix in https://github.com/vaadin/flow/pull/6798

It requires to make the UI test read the browser log and make sure there is no error. Otherwise the fix itself works. Also UI tests with websocket and websocket_xhr may be added.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error "endRequest called when no request is active" | Vaadin
I am using MPR + Vaadin 7 with push enabled ( using just `@Push` ). ... Error "endRequest called when no request is...
Read more >
HttpModule EndRequest handler called twice - Stack Overflow
Does Init method of the Module called once while the EndRequest is called twice for a single request? because EndRequest can not be...
Read more >
HttpApplication.EndRequest Event (System.Web)
Occurs as the last event in the HTTP pipeline chain of execution when ASP.NET responds to a request.
Read more >
Ensuring Application Continuity - Oracle Help Center
Application Continuity does not resubmit work following call failures due to ... If you want to disable the end request test, then use...
Read more >
Transactional messaging approaches - IBM
Configure the server with the Transactional property enabled. ... The first transaction carries the message from the front-end request queue to the back-end...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found