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

Crash when Trading with kraken #535

Closed
decoye opened this issue Dec 31, 2016 · 13 comments
Closed

Crash when Trading with kraken #535

decoye opened this issue Dec 31, 2016 · 13 comments
Labels

Comments

@decoye
Copy link
Contributor

decoye commented Dec 31, 2016

Good morning,

this error message is almost happening every attempt gekko makes a trade.

/Users/decoye/gekko-develop/exchanges/kraken.js:199
if(!_.isEmpty(data.error))
^

TypeError: Cannot read property 'error' of null
at Trader.set (/Users/decoye/gekko-develop/exchanges/kraken.js:199:23)
at KrakenClient.bound (/Users/decoye/gekko-develop/node_modules/lodash/dist/lodash.js:729:21)
at Request._callback (/Users/decoye/gekko-develop/node_modules/kraken-api/kraken.js:155:23)
at Request.self.callback (/Users/decoye/gekko-develop/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/Users/decoye/gekko-develop/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/Users/decoye/gekko-develop/node_modules/request/request.js:1001:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

@askmike askmike added the bug label Dec 31, 2016
@askmike
Copy link
Owner

askmike commented Dec 31, 2016

Thanks will check it out. Does this happen a lot?

@Tycale
Copy link

Tycale commented Jan 4, 2017

Hello !

Same here,

2017-01-04 01:19:27 (INFO):     BUY order was not (fully) filled, cancelling and creating new order
/home/tycale/gekko/exchanges/kraken.js:139
    if(!_.isEmpty(data.error))
                      ^

TypeError: Cannot read property 'error' of null
    at Trader.set (/home/tycale/gekko/exchanges/kraken.js:139:23)
    at KrakenClient.bound (/home/tycale/gekko/node_modules/lodash/dist/lodash.js:729:21)
    at Request._callback (/home/tycale/gekko/node_modules/kraken-api/kraken.js:135:22)
    at self.callback (/home/tycale/gekko/node_modules/request/request.js:186:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at ClientRequest.<anonymous> (/home/tycale/gekko/node_modules/request/request.js:781:16)
    at ClientRequest.g (events.js:291:16)
    at emitNone (events.js:86:13)
    at ClientRequest.emit (events.js:185:7)

Another case :

2017-01-05 00:42:32 (DEBUG): getting balance & fee from kraken
2017-01-05 00:42:32 (INFO):

/home/tycale/gekko/exchanges/kraken.js:139
    if(!_.isEmpty(data.error))
                      ^

TypeError: Cannot read property 'error' of null
    at Trader.set (/home/tycale/gekko/exchanges/kraken.js:139:23)
    at KrakenClient.bound (/home/tycale/gekko/node_modules/lodash/dist/lodash.js:729:21)
    at Request._callback (/home/tycale/gekko/node_modules/kraken-api/kraken.js:135:22)
    at self.callback (/home/tycale/gekko/node_modules/request/request.js:186:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at ClientRequest.<anonymous> (/home/tycale/gekko/node_modules/request/request.js:781:16)
    at ClientRequest.g (events.js:291:16)
    at emitNone (events.js:86:13)
    at ClientRequest.emit (events.js:185:7)

@kooka42
Copy link

kooka42 commented Jan 5, 2017

Same here, seems to be a problem when trying to sell and you have nothing to sell so value is empty

i may have ofund something in Trader.prototype.addOrder

if(_.isEmpty(data))
{
err = 'no data';
return log.error('unable to', tradeType.toLowerCase(), JSON.stringify(err)); //adding this line seems to do the tric
}

@decoye
Copy link
Contributor Author

decoye commented Jan 30, 2017

Hey Mike,

yes this happens every 2nd - 3rd real time trade..

@darklow
Copy link

darklow commented May 28, 2017

I just experienced exactly the same error after real trading in Kraken for about 5 hours:

2017-05-28 16:10:07 (INFO):     Attempting to BUY 0.2957905250500333 ETH at kraken
/usr/src/app/exchanges/kraken.js:199
    if(!_.isEmpty(data.error))
                      ^

TypeError: Cannot read property 'error' of null
    at set (/usr/src/app/exchanges/kraken.js:199:23)
    at KrakenClient.bound (/usr/src/app/node_modules/lodash/dist/lodash.js:729:21)
    at Request._callback (/usr/src/app/node_modules/kraken-api/kraken.js:135:22)
    at self.callback (/usr/src/app/node_modules/request/request.js:188:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at ClientRequest.<anonymous> (/usr/src/app/node_modules/request/request.js:822:16)
    at ClientRequest.g (events.js:286:16)
    at emitNone (events.js:86:13)
    at ClientRequest.emit (events.js:185:7)

@jebbgrenham
Copy link

Same errors here....

2017-06-03 12:50:24 (INFO):     Attempting to SELL 0.30193115 XBT at kraken
C:\Users\myuser\Downloads\gekko-stable\exchanges\kraken.js:233
    if(!_.isEmpty(data.error))
                      ^

TypeError: Cannot read property 'error' of null
    at Trader.check (C:\Users\myuser\Downloads\gekko-stable\exchanges\kraken.js:
233:23)
    at KrakenClient.bound (C:\Users\myuser\Downloads\gekko-stable\node_modules\l
odash\dist\lodash.js:729:21)
    at Request._callback (C:\Users\myuser\Downloads\gekko-stable\node_modules\kr
aken-api\kraken.js:135:22)
    at self.callback (C:\Users\myuser\Downloads\gekko-stable\node_modules\reques
t\request.js:188:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at ClientRequest.<anonymous> (C:\Users\myuser\Downloads\gekko-stable\node_mo
dules\request\request.js:822:16)
    at ClientRequest.g (events.js:292:16)
    at emitNone (events.js:86:13)
    at ClientRequest.emit (events.js:185:7)

@askmike
Copy link
Owner

askmike commented Jun 3, 2017

@jebbgrenham I am working on a reimplementation of the trader as we speak (that also supports the UI), that will def fix this as well.

Though it's a lot of work, progress can be followed here: #737

@Ali1
Copy link

Ali1 commented Jun 29, 2017

@askmike thanks for the huge amounts of work. I tried the new kraken exchange code as I was getting the exception on every run with kraken. This is the new problem with this new code

2017-06-29 03:59:43 (INFO):	Setting up Gekko in realtime mode
2017-06-29 03:59:43 (INFO):	
2017-06-29 03:59:43 (INFO):	Setting up:
2017-06-29 03:59:43 (INFO):		 Trading Advisor
2017-06-29 03:59:43 (INFO):		 Calculate trading advice
2017-06-29 03:59:43 (INFO):		 Using the strategy: PPO
2017-06-29 03:59:43 (WARN):	Warning, trading method has no name
2017-06-29 03:59:44 (INFO):		The trading method requests 360 minutes of historic data. Checking availablity..
2017-06-29 03:59:44 (INFO):	

2017-06-29 03:59:44 (INFO):		No usable local data available, trying to get as much as possible from the exchange..
2017-06-29 03:59:44 (INFO):		Preventing Gekko from requesting 360 minutes of history.
2017-06-29 03:59:44 (DEBUG):		Fetching exchange data since 240 minutes ago
2017-06-29 03:59:45 (DEBUG):		Available exchange data:
2017-06-29 03:59:45 (DEBUG):			from: 153 minutes ago
2017-06-29 03:59:45 (DEBUG):			to: 0 minutes ago
2017-06-29 03:59:45 (DEBUG):		Unable to stitch datasets.
2017-06-29 03:59:45 (INFO):		Not seeding locally available data to the trading method.
2017-06-29 03:59:45 (INFO):	Setting up:
2017-06-29 03:59:45 (INFO):		 Trader
2017-06-29 03:59:45 (INFO):		 Follows the advice and create real orders.
2017-06-29 03:59:45 (DEBUG):	getting balance & fee from kraken
2017-06-29 03:59:45 (INFO):	

2017-06-29 03:59:46 (DEBUG):	kraken returned an error, retrying.. "no data"
2017-06-29 03:59:56 (DEBUG):	kraken returned an error, retrying.. "no data"

@Ali1
Copy link

Ali1 commented Jun 29, 2017

Sorry ignore previous message - did not have sufficient privileges on API keys

@Ali1
Copy link

Ali1 commented Jul 4, 2017

Actually I'm still having problems with Kraken. Despite full privileges this has happened twice now on the live trader on 2 different days. Have not had any successful trades recently.

image

On holiday currently so will try and give more debug info when I'm back, however because of a lack of exception handling, I would never be notified of such an occurrence which is actually another issue in its own right.

This is the new exchange controller.

@askmike
Copy link
Owner

askmike commented Jul 4, 2017

Hey @Ali1, I have upgraded all kraken integration as part of an updated trader (that works in the UI), details can be found here #737. These upgrades include fixes for these exact issues. I hope to have a new version ready very soon!

ztnark pushed a commit to ztnark/gekko that referenced this issue Jul 19, 2017
@jwijmans
Copy link

Hi,

I've exactly the same issues as described above. Does this mean you cannot trade on Kraken live until the new UI is released? has someone figured out a workaround maybe?

@askmike
Copy link
Owner

askmike commented Jul 21, 2017

@jwijmans this should be fixed in an upcoming release. I just now pushed this fix to the develop branch: https://github.com/askmike/gekko/tree/develop

Can you download that one and try again?

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

8 participants