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

Unexpected token warning? #13

Open
IHateNameStealers opened this issue Jan 11, 2021 · 5 comments
Open

Unexpected token warning? #13

IHateNameStealers opened this issue Jan 11, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@IHateNameStealers
Copy link

ichimoku was running fine for 2 days now (in a screen), but all of a sudden I got the following error/warning due to an Unexpected token from https://api.bittrex.com/v3/markets/KNC-EUR/ticker

As far as I can see there is nothing wrong with KNC EUR

See log report below.

[13:01:41] ########## Started ichimoku ##########
[13:02:01] Collected revenue 19403.45975 ms
[13:02:01] Fetched 664 and filtered 21 EUR markets 42.75964 ms
[13:02:01] Fetched 664 and filtered 17 market summaries 71.74199 ms
[13:02:28] Evaluated 17 markets in total 27427.01933 ms
[13:02:38] Called report webhook
[13:02:38] ########## Finished 56787.74028 ms ##########
[13:05:38] ########## Started ichimoku ##########
(node:6969) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://api.bittrex.com/v3/markets/KNC-EUR/ticker reason: Unexpected token < in JSON at position 0
at /home/bot/node_modules/node-fetch/lib/index.js:272:32
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:6969) 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:6969) [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.

@saschb2b
Copy link
Member

Thanks for the report. I really have to add more debugging logs to better resolve those issues. Market looks also fine to me. Will see if I can reproduce it

@saschb2b saschb2b added the bug Something isn't working label Jan 11, 2021
@IHateNameStealers
Copy link
Author

Another error today.

[03:21:58] ########## Started ichimoku ##########
(node:4402) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://api.bittrex.com/v3/balances reason: Unexpected token < in JSON at position 0
at /home/bot/node_modules/node-fetch/lib/index.js:272:32
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:4402) 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:4402) [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.

@saschb2b
Copy link
Member

saschb2b commented Jan 12, 2021

Thanks for the additional report. That seems like a connection issue rather than an issue bittrex wise. (because it's another endpoint now)
I will check what happens when my internet is flaky.

For the time being:
Currently your bot just crashes will not restart. You can install forever https://www.npmjs.com/package/forever
This will restart a js application if it's crashed automatically. Assuming a restart will just fix your issue.
Build the bot via yarn build and then use the installed forever package to start the builded js application forever start dist/index.js
See the forever documentation on how to stop and get logs.

@saschb2b
Copy link
Member

Related: node-fetch/node-fetch#620

@saschb2b
Copy link
Member

This should not happen anymore when we've migrated to websockets see #37

@saschb2b saschb2b linked a pull request Feb 23, 2021 that will close this issue
@saschb2b saschb2b removed a link to a pull request Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants