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

portal server crash related to /exchange/asset_list endpoint #9

Open
jfabric opened this issue Apr 23, 2022 · 0 comments
Open

portal server crash related to /exchange/asset_list endpoint #9

jfabric opened this issue Apr 23, 2022 · 0 comments
Assignees

Comments

@jfabric
Copy link

jfabric commented Apr 23, 2022

at the start of execution, the server autotest code hits the /exchange/asset_list endpoint one time (only) in order to extract an array of available symbols for subsequent use in the query parameters of other endpoints, e.g. /exchange/ticker.
this endpoint responds normally – it returns status 200 and an array of symbols is extracted from its response body.
after this the code enters a loop where it hits random endpoints using random (but valid) query parameter values (for those endpoints that have query parameters).
at variable times after the start of this loop (usually a few seconds) and after a variable number of endpoints have been hit (usually 2-10) the node server crashes with the error message below.
independent of which particular endpoint is being hit at the time, the server always crashes at line 167 of the exchange.controller.js file which is inside the function handling the /exchange/asset_list endpoint (note that this endpoint already successfully responded at the very beginning of the run).
the error is always “cannot set headers after they are sent to the client”.
it appears there is some asynchronous activity happening here.

events.js:291
throw er; // Unhandled 'error' event
^

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:543:11)
at ServerResponse.header (/home/jmills/portal/code/CryptoMarketAPI/node_modules/express/lib/response.js:776:10)
at ServerResponse.send (/home/jmills/portal/code/CryptoMarketAPI/node_modules/express/lib/response.js:170:12)
at ServerResponse.json (/home/jmills/portal/code/CryptoMarketAPI/node_modules/express/lib/response.js:267:15)
at /home/jmills/portal/code/CryptoMarketAPI/controllers/exchange.controller.js:167:37
at /home/jmills/portal/code/CryptoMarketAPI/node_modules/mongoose/lib/model.js:5004:18
at processTicksAndRejections (internal/process/task_queues.js:75:11)
Emitted 'error' event on Function instance at:
at /home/jmills/portal/code/CryptoMarketAPI/node_modules/mongoose/lib/model.js:5006:15
at processTicksAndRejections (internal/process/task_queues.js:75:11) {
code: 'ERR_HTTP_HEADERS_SENT'
}

@jfabric jfabric transferred this issue from another repository May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants