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

UnhandledPromiseRejectionWarning #313

Open
Staubgeborener opened this issue Sep 6, 2022 · 0 comments
Open

UnhandledPromiseRejectionWarning #313

Staubgeborener opened this issue Sep 6, 2022 · 0 comments

Comments

@Staubgeborener
Copy link

Staubgeborener commented Sep 6, 2022

Running latest version of crypto-trading-bot in docker container leads to this error:

[email protected] start /usr/src/app
node index.js trade

Webserver listening on: 0.0.0.0:8080
Trade module: warmup done; starting ticks
(node:19) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stop' of undefined
    at RiskRewardRatioCalculator.syncRatioRewardOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:44:32)
    at RiskRewardRatioCalculator.createRiskRewardOrdersOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:102:36)
    at ExchangeOrderWatchdogListener.riskRewardRatioWatchdog (/usr/src/app/src/modules/listener/exchange_order_watchdog_listener.js:181:63)
(node:19) 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)
(node:19) [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:19) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stop' of undefined
    at RiskRewardRatioCalculator.syncRatioRewardOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:44:32)
    at RiskRewardRatioCalculator.createRiskRewardOrdersOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:102:36)
    at ExchangeOrderWatchdogListener.riskRewardRatioWatchdog (/usr/src/app/src/modules/listener/exchange_order_watchdog_listener.js:181:63)
(node:19) 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: 4)
(node:19) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stop' of undefined
    at RiskRewardRatioCalculator.syncRatioRewardOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:44:32)
    at RiskRewardRatioCalculator.createRiskRewardOrdersOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:102:36)
    at ExchangeOrderWatchdogListener.riskRewardRatioWatchdog (/usr/src/app/src/modules/listener/exchange_order_watchdog_listener.js:181:63)
(node:19) 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: 6)
(node:19) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stop' of undefined
    at RiskRewardRatioCalculator.syncRatioRewardOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:44:32)
    at RiskRewardRatioCalculator.createRiskRewardOrdersOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:102:36)
    at ExchangeOrderWatchdogListener.riskRewardRatioWatchdog (/usr/src/app/src/modules/listener/exchange_order_watchdog_listener.js:181:63)
(node:19) 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: 8)
(node:19) UnhandledPromiseRejectionWarning: ReferenceError: step is not defined
    at PARABOL.getOptions (/usr/src/app/src/modules/strategy/strategies/parabolicsar.js:83:19)
    at strategyManager.getStrategies.map.strategy (/usr/src/app/src/modules/backtest.js:42:72)
    at Array.map (<anonymous>)
    at Backtest.getBacktestStrategies (/usr/src/app/src/modules/backtest.js:39:49)
    at app.get (/usr/src/app/src/modules/http.js:127:35)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/usr/src/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:198:13)
    at SendStream.error (/usr/src/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/usr/src/app/node_modules/send/index.js:421:12)
    at next (/usr/src/app/node_modules/send/index.js:735:16)
    at onstat (/usr/src/app/node_modules/send/index.js:724:14)
    at FSReqWrap.oncomplete (fs.js:153:21)
(node:19) 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: 9)
(node:19) UnhandledPromiseRejectionWarning: ReferenceError: step is not defined
    at PARABOL.getOptions (/usr/src/app/src/modules/strategy/strategies/parabolicsar.js:83:19)
    at strategyManager.getStrategies.map.strategy (/usr/src/app/src/modules/backtest.js:42:72)
    at Array.map (<anonymous>)
    at Backtest.getBacktestStrategies (/usr/src/app/src/modules/backtest.js:39:49)
    at app.get (/usr/src/app/src/modules/http.js:127:35)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/usr/src/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:198:13)
    at SendStream.error (/usr/src/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/usr/src/app/node_modules/send/index.js:421:12)
    at next (/usr/src/app/node_modules/send/index.js:735:16)
    at onstat (/usr/src/app/node_modules/send/index.js:724:14)
    at FSReqWrap.oncomplete (fs.js:153:21)
(node:19) 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: 10)
(node:19) UnhandledPromiseRejectionWarning: ReferenceError: step is not defined
    at PARABOL.getOptions (/usr/src/app/src/modules/strategy/strategies/parabolicsar.js:83:19)
    at strategyManager.getStrategies.map.strategy (/usr/src/app/src/modules/backtest.js:42:72)
    at Array.map (<anonymous>)
    at Backtest.getBacktestStrategies (/usr/src/app/src/modules/backtest.js:39:49)
    at app.get (/usr/src/app/src/modules/http.js:127:35)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/usr/src/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:198:13)
    at SendStream.error (/usr/src/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/usr/src/app/node_modules/send/index.js:421:12)
    at next (/usr/src/app/node_modules/send/index.js:735:16)
    at onstat (/usr/src/app/node_modules/send/index.js:724:14)
    at FSReqWrap.oncomplete (fs.js:153:21)
(node:19) 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: 11)
(node:19) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stop' of undefined
    at RiskRewardRatioCalculator.syncRatioRewardOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:44:32)
    at RiskRewardRatioCalculator.createRiskRewardOrdersOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:102:36)
    at ExchangeOrderWatchdogListener.riskRewardRatioWatchdog (/usr/src/app/src/modules/listener/exchange_order_watchdog_listener.js:181:63)
(node:19) 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: 13)
(node:19) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stop' of undefined
    at RiskRewardRatioCalculator.syncRatioRewardOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:44:32)
    at RiskRewardRatioCalculator.createRiskRewardOrdersOrders (/usr/src/app/src/modules/order/risk_reward_ratio_calculator.js:102:36)
    at ExchangeOrderWatchdogListener.riskRewardRatioWatchdog (/usr/src/app/src/modules/listener/exchange_order_watchdog_listener.js:181:63)
(node:19) 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: 15)
(node:19) UnhandledPromiseRejectionWarning: ReferenceError: step is not defined
    at PARABOL.getOptions (/usr/src/app/src/modules/strategy/strategies/parabolicsar.js:83:19)
    at strategyManager.getStrategies.map.strategy (/usr/src/app/src/modules/backtest.js:42:72)
    at Array.map (<anonymous>)
    at Backtest.getBacktestStrategies (/usr/src/app/src/modules/backtest.js:39:49)
    at app.get (/usr/src/app/src/modules/http.js:127:35)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/usr/src/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:198:13)
    at SendStream.error (/usr/src/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/usr/src/app/node_modules/send/index.js:421:12)
    at next (/usr/src/app/node_modules/send/index.js:735:16)
    at onstat (/usr/src/app/node_modules/send/index.js:724:14)
    at FSReqWrap.oncomplete (fs.js:153:21)
(node:19) 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: 16)
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stop' of undefined

I am using the default instance.js.dist which i renamed to instance.js (no changes at all) which includes the dip_catcher strategy by default.

Edit: Also there is another error while the dip_catcher strategy recognize a long trade:

$ {"message":"Pair execution timeout cancel: [{\"time\":\"2022-09-06T14:15:07.611Z\",\"exchange\":\"binance\",\"symbol\":\"ETHUSDT\",\"state\":\"long\",\"options\":{},\"retries\":0,\"adjustedPrice\":true,\"cleared\":false,\"capital\":{\"type\":\"currency\",\"currency\":10}}]","level":"error","timestamp":"2022-09-06T14:40:08.873Z"}
(node:19) UnhandledPromiseRejectionWarning: ReferenceError: step is not defined
    at PARABOL.getOptions (/usr/src/app/src/modules/strategy/strategies/parabolicsar.js:83:19)
    at strategyManager.getStrategies.map.strategy (/usr/src/app/src/modules/backtest.js:42:72)
    at Array.map (<anonymous>)
    at Backtest.getBacktestStrategies (/usr/src/app/src/modules/backtest.js:39:49)
    at app.get (/usr/src/app/src/modules/http.js:127:35)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/usr/src/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:198:13)
    at SendStream.error (/usr/src/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/usr/src/app/node_modules/send/index.js:421:12)
    at next (/usr/src/app/node_modules/send/index.js:735:16)
    at onstat (/usr/src/app/node_modules/send/index.js:724:14)
    at FSReqWrap.oncomplete (fs.js:153:21)
(node:19) 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: 17)
UnhandledPromiseRejectionWarning: ReferenceError: step is not defined
Webserver listening on: 0.0.0.0:8083
Trade module: warmup done; starting ticks
(node:19) UnhandledPromiseRejectionWarning: ReferenceError: step is not defined
    at PARABOL.getOptions (/usr/src/app/src/modules/strategy/strategies/parabolicsar.js:83:19)
    at strategyManager.getStrategies.map.strategy (/usr/src/app/src/modules/backtest.js:42:72)
    at Array.map (<anonymous>)
    at Backtest.getBacktestStrategies (/usr/src/app/src/modules/backtest.js:39:49)
    at app.get (/usr/src/app/src/modules/http.js:127:35)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/usr/src/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:198:13)
    at SendStream.error (/usr/src/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/usr/src/app/node_modules/send/index.js:421:12)
    at next (/usr/src/app/node_modules/send/index.js:735:16)
    at onstat (/usr/src/app/node_modules/send/index.js:724:14)
    at FSReqWrap.oncomplete (fs.js:153:21)
(node:19) 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: 1)
(node:19) [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.
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

1 participant