UnhandedPromiseRejection
rchen9012 opened this issue · 1 comments
restart "node api.js" after empty request response of "https://host:port/api/account/accounts_by_user_id?id=13fae23b-8722-45e9-bd86-5d6925088a7c
(node:4720) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:4720) UnhandledPromiseRejectionWarning: StatusCodeError: 429 - "Too many requests, please try again later."
at new StatusCodeError (/data/shadowsocks-hub-api/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/data/shadowsocks-hub-api/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/data/shadowsocks-hub-api/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/data/shadowsocks-hub-api/node_modules/request/request.js:185:22)
at Request.emit (events.js:182:13)
at Request. (/data/shadowsocks-hub-api/node_modules/request/request.js:1157:10)
at Request.emit (events.js:182:13)
at IncomingMessage. (/data/shadowsocks-hub-api/node_modules/request/request.js:1079:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:4720) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
edit:
I've found problem caused by sudden database table accounts, ss_account and traffic all emptied for unknown reason.
Did you mean that account
, ss_account
, traffic
tables were emptied? Were that possible that the accounts existed just expired or the amount of traffic used had exceeded the threshold? If so, it would be normal operation that the system automatically delete those accounts and the traffic data.
Can you reproduce the bug you reported? It is possible that the bug was caused by shadowsocks-restful-api
throwing 429 http status code - meaning shadowsocks-hub-api
making too many requests within 15 minutes.