kea-anterius icon indicating copy to clipboard operation
kea-anterius copied to clipboard

Error 1: Error: Status Code : 408 after a few minutes

Open dawys opened this issue 6 years ago • 7 comments

I start the application normally with "npm start" on the server.

Then I load the main page in the browser (x.x.x.x: 3000) After I pushed the browser window into the background and waited a few minutes I always get the following error on the server:

[WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (1) [WS] STATUS: Socket clients (0) [WS] STATUS: Socket clients (0) [WS] STATUS: Socket clients (0) [WS] STATUS: Socket clients (0) [WS] STATUS: Socket clients (0) [WS] STATUS: Socket clients (0) Error 1: Error: Status Code : 408 at ClientRequest. (/usr/local/src/kea-dhcp-admin/lib/api_service.js:46:35) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) at HTTPParser.parserOnIncomingClient (_http_client.js:551:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:115:23) at Socket.socketOnData (_http_client.js:440:20) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) [WS] STATUS: Socket clients (0)

After that I can not reload the page on the browser and I have to restart the application server side.

What can I do to work around this problem?

dawys avatar Feb 11 '19 05:02 dawys

Hi @dawys, thank you for raising this concern. Yes, there is a stability issue with the nodejs server and the application crashes when the server is idle for extended periods of time. Still working on identifying and fixing the cause for the same, will post as soon as I have an update.

Anthrino avatar Feb 11 '19 08:02 Anthrino

Hi Anthrino, i think the problem could be that http does not support promise

https://www.valentinog.com/blog/http-requests-node-js-async-await/

dawys avatar Feb 12 '19 13:02 dawys

My thought was wrong. I replaced the http libary with the axios libary but the error 408 was thrown in the same way.

dawys avatar Feb 13 '19 06:02 dawys

After 2 days of testing, I found out what was convenient. I have revised the WebSocket handling. How can I send you the changes?

dawys avatar Feb 15 '19 11:02 dawys

Hi @dawys, that's great you can push your code into a branch and create a pull request, I can test it out and apply the patch if the bug is resolved, appreciate your efforts. 👍 @tomaszmrugalski kindly grant @dawys write access to the repository to submit the changes, thanks.

Anthrino avatar Feb 16 '19 11:02 Anthrino

How can I send you the changes?

Usually, the best way is to send PR. See https://help.github.com/articles/creating-a-pull-request/

This is much better than simply commiting to a branch in this repo. PR can be reviewed, commented on and updated if nedeed before they're merged.

tomaszmrugalski avatar Feb 18 '19 07:02 tomaszmrugalski

I have created a pull request:

https://github.com/isc-projects/kea-anterius/pull/32

dawys avatar Feb 18 '19 13:02 dawys