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

Node crashes when response status !== 200 #335

Closed
paulo-ocean opened this issue Mar 12, 2024 · 2 comments
Closed

Node crashes when response status !== 200 #335

paulo-ocean opened this issue Mar 12, 2024 · 2 comments
Assignees
Labels
Type: Bug Something isn't working

Comments

@paulo-ocean
Copy link
Contributor

paulo-ocean commented Mar 12, 2024

This one was under the wood for a long time :-)
Its on the sink function that reads and streams the commands responses.
The node crashes when the status response is !== 200 (mostly on specific errors, without a stream response, cause that´s where we usually use other status codes).
If its 200 then its fine
It basically tries to write more bytes after closing the stream
ERR_STREAM_WRITE_AFTER_END

@paulo-ocean paulo-ocean added the Type: Bug Something isn't working label Mar 12, 2024
@paulo-ocean paulo-ocean self-assigned this Mar 12, 2024
@jamiehewitt15
Copy link
Member

jamiehewitt15 commented Mar 20, 2024

Yeah, I'm getting the same thing. I'll have a look at your PR.

For example, send a body with an invalid or missing parameter and then the node crashes:

{
  component: 'CORE',
  moduleName: 'CORE',
  level: 'info',
  message: 'Command validation failed: {"valid":false,"status":400,"reason":"Missing one ( \\"expiryTimestamp\\" ) or more required field(s) for command: \\"stopNode\\". Required fields: expiryTimestamp,signature"}',
  timestamp: '2024-03-20 16:41:11'
}

@paulo-ocean
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants