Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

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

Open
dawys opened this issue Feb 11, 2019 · 7 comments
Open

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

dawys opened this issue Feb 11, 2019 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@dawys
Copy link

dawys commented Feb 11, 2019

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?

@Anthrino Anthrino added bug Something isn't working help wanted Extra attention is needed labels Feb 11, 2019
@Anthrino
Copy link
Contributor

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.

@dawys
Copy link
Author

dawys commented Feb 12, 2019

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
Copy link
Author

dawys commented Feb 13, 2019

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

@dawys
Copy link
Author

dawys commented Feb 15, 2019

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

@Anthrino
Copy link
Contributor

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.

@tomaszmrugalski
Copy link
Member

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.

@dawys
Copy link
Author

dawys commented Feb 18, 2019

I have created a pull request:

#32

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants