Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Different Bittrex error #659

Closed
brucetus opened this issue Oct 26, 2017 · 11 comments
Closed

Different Bittrex error #659

brucetus opened this issue Oct 26, 2017 · 11 comments
Labels

Comments

@brucetus
Copy link
Contributor

I already used the fix in #457 and it worked for a couple days. However, I got a new error that occured after selling.

/home/b/zenbot/extensions/exchanges/bittrex/exchange.js:85
        Object.keys(data.result).forEach(function (i) {
               ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at /home/b/zenbot/extensions/exchanges/bittrex/exchange.js:85:16
    at Request._callback (/home/b/zenbot/node_modules/node.bittrex.api/node.bittrex.api.js:114:25)
    at Request.self.callback (/home/b/zenbot/node_modules/request/request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/home/b/zenbot/node_modules/request/request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (/home/b/zenbot/node_modules/request/request.js:1091:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1057:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

The sell order already printed too and it said 'sold' for about 10 minutes before I got the error.

@DeviaVir DeviaVir added the bug label Oct 27, 2017
@ether-btc
Copy link

ether-btc commented Oct 27, 2017

I get some similiar error when trading ETH-BTC on bittrex too. It crashes the zenbot sometimes. When I restart zenbot after that, it doesn't lead to reproducable termination of the zenbot though. I can provide the error message and anything else that might be required (just let me know):

bittrex crash.txt

@brucetus
Copy link
Contributor Author

This a different error. My error crashes the bot and only happens after many hours of trading, while your's allows the bot to continue. Your's is the same as #280 I believe.

@luponata
Copy link

luponata commented Nov 9, 2017

got the same error today, already fixed the previous error with fix from #457

@luponata
Copy link

luponata commented Nov 10, 2017

@brucetus As i said, now i have the same error you are complaining in this "issue"

I also wrote that I also had the previous error, that i successfully resolved with the fix found on #457

@brucetus
Copy link
Contributor Author

@luponata My bad. Are you trading with BTC-USDT as well as other coin-BTC pairs? I have a feeling that might be what caused the problem.

@luponata
Copy link

luponata commented Nov 10, 2017

@brucetus i'm only using SNT-BTC, still testing!

@brucetus
Copy link
Contributor Author

Same here. If anybody has mod permissions can you please delete @ether-btc comment because it is addressed in a different issue and is taking up huge amounts of space.

@KryptoNova
Copy link
Contributor

I think I have solved the problem. It appears that every once in a while the Bittrex API will choke and not return a result. I'm not sure how this impacts checking for orders or
I will do a pull request for this to see if everyone agrees with the modification.

if the result from Bittrex is undefined, then do not process any trades. It isn't the best case since no new trades will be pulled in, but it will prevent the bot from crashing till the site is available again.

Since I cannot force Bittrex to fail, I have no way to legitimately test this.
I will put in a pull request with my changes to see if everyone agrees with them. This will be my first time doing this, so wish me luck on getting it right.

KryptoNova added a commit to KryptoNova/zenbot that referenced this issue Nov 15, 2017
This is a proposed fix for "Different Bittrex error DeviaVir#659".
DeviaVir pushed a commit that referenced this issue Nov 15, 2017
This is a proposed fix for "Different Bittrex error #659".
@KryptoNova
Copy link
Contributor

I got another one of these errors with the fix in place. I was worried that since it wasn't able to be duplicated due to a problem at Bittrex, this would happen again.
I have come up with a Plan B and it should have been my Plan A.
New pull request coming soon.

KryptoNova added a commit to KryptoNova/zenbot that referenced this issue Nov 15, 2017
This fix should handle any error that happens and then fire's off a retry.  I tried the Try .. Catch block on fiddle and it worked flawlessly to capture the error in question.

I'm not sure how to exactly test the retry, but I created the statement similar to the one on line 78.  This technically should be recoverable, because Bittrex is just having some sort of hiccup on their API sending data.
@KryptoNova
Copy link
Contributor

Just had a Bittrex hiccup. The code change I just put into the newest pull request handles it and recovers without killing Zenbot. After several retries, it began to read the API again.

Here is proof:
image

@brucetus
Copy link
Contributor Author

Thanks KryptoNova you're a hero.

DeviaVir pushed a commit that referenced this issue Nov 16, 2017
* Different Bittrex error (#659)

This fix should handle any error that happens and then fire's off a retry.  I tried the Try .. Catch block on fiddle and it worked flawlessly to capture the error in question.

I'm not sure how to exactly test the retry, but I created the statement similar to the one on line 78.  This technically should be recoverable, because Bittrex is just having some sort of hiccup on their API sending data.

* Needed to pass an object instead of a string.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants