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

kraken returned an error, retrying.. unable to buy: {} #931

Closed
Tr4sK opened this issue Aug 8, 2017 · 11 comments
Closed

kraken returned an error, retrying.. unable to buy: {} #931

Tr4sK opened this issue Aug 8, 2017 · 11 comments

Comments

@Tr4sK
Copy link

Tr4sK commented Aug 8, 2017

Hi,
I’m having an issue with the Kraken API.
After the first attempt to buy, gekko loop over that error.
If I let gekko continue trading, he will get stuck with that error, then continue to trade as normal. Unfortunatly I don’t have old log of that behavior.
Here is an output of a test I run few minutes ago.

2017-08-08 01:23:06 (DEBUG):	Requested XBT/EUR trade data from Kraken ...
2017-08-08 01:23:08 (DEBUG):	Processing 18 new trades. From 2017-08-07 23:23:06 UTC to 2017-08-07 23:23:23 UTC. (a few seconds)
2017-08-08 01:23:08 (DEBUG):	calculated StochRSI properties for candle:
2017-08-08 01:23:08 (DEBUG):		 rsi: 99.95228831
2017-08-08 01:23:08 (DEBUG):	StochRSI min:		99.95219072
2017-08-08 01:23:08 (DEBUG):	StochRSI max:		100.00000000
2017-08-08 01:23:08 (DEBUG):	StochRSI Value:		0.20
2017-08-08 01:23:08 (DEBUG):	In low since 3 candle(s)
2017-08-08 01:23:08 (INFO):	Trader Received advice to go long. Buying  XBT
2017-08-08 01:23:09 (INFO):	Attempting to BUY 0.49050458492532134 XBT at kraken price: 2879
2017-08-08 01:23:09 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:23:14 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:23:24 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:23:26 (DEBUG):	Requested XBT/EUR trade data from Kraken ...
2017-08-08 01:23:26 (DEBUG):	Processing 7 new trades. From 2017-08-07 23:23:39 UTC to 2017-08-07 23:23:39 UTC. (a few seconds)
2017-08-08 01:23:29 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:23:39 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:23:44 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:23:46 (DEBUG):	Requested XBT/EUR trade data from Kraken ...
2017-08-08 01:23:46 (DEBUG):	Processing 12 new trades. From 2017-08-07 23:23:44 UTC to 2017-08-07 23:23:55 UTC. (a few seconds)
2017-08-08 01:23:54 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:23:59 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:24:06 (DEBUG):	Requested XBT/EUR trade data from Kraken ...
2017-08-08 01:24:06 (DEBUG):	Processing 5 new trades. From 2017-08-07 23:24:05 UTC to 2017-08-07 23:24:15 UTC. (a few seconds)
2017-08-08 01:24:09 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:24:14 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:24:24 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:24:26 (DEBUG):	Requested XBT/EUR trade data from Kraken ...
2017-08-08 01:24:26 (DEBUG):	Processing 14 new trades. From 2017-08-07 23:24:26 UTC to 2017-08-07 23:24:42 UTC. (a few seconds)
2017-08-08 01:24:29 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:24:39 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:24:44 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:24:46 (DEBUG):	Requested XBT/EUR trade data from Kraken ...
2017-08-08 01:24:46 (DEBUG):	Processing 4 new trades. From 2017-08-07 23:24:47 UTC to 2017-08-07 23:24:59 UTC. (a few seconds)
2017-08-08 01:24:54 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:24:59 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:25:06 (DEBUG):	Requested XBT/EUR trade data from Kraken ...
2017-08-08 01:25:06 (DEBUG):	Processing 4 new trades. From 2017-08-07 23:25:03 UTC to 2017-08-07 23:25:03 UTC. (a few seconds)
2017-08-08 01:25:09 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:25:14 (DEBUG):	kraken returned an error, retrying.. unable to buy: {}
2017-08-08 01:25:24 (DEBUG):	BUY 0.49050458 XBT @ 2879 EUR
2017-08-08 01:25:26 (DEBUG):	Requested XBT/EUR trade data from Kraken ...
2017-08-08 01:25:26 (DEBUG):	kraken returned an error, retrying.. Error: Kraken API returned error: Service:Unavailable
    at Request._callback (/home/tr4sk/gekko/node_modules/kraken-api/kraken.js:155:34)
    at Request.self.callback (/home/tr4sk/gekko/node_modules/request/request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/home/tr4sk/gekko/node_modules/request/request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (/home/tr4sk/gekko/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:1045:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

On Kraken, the order have been succesfull:

OFSAUQ buy/limit XBT/EUR €2,879.000 0.49050458 €1,412.162 Closed	08-08-17 01:24:41 +0200

ps: I created another issue for the "Error: Kraken API returned error" part #930

@askmike
Copy link
Owner

askmike commented Aug 8, 2017

Will look into this asap!

@askmike
Copy link
Owner

askmike commented Aug 17, 2017

Quick question: after that error, did Gekko crash or continue?

@decoye
Copy link
Contributor

decoye commented Aug 21, 2017

Hey,

having the same issue here.
Found it in the test i did with the current developement state, while trading on kraken.

Gekko constalntly creats buy or sell orders, dependend on the advice it has.

Gekko does not crash, it just gives a error.

@decoye
Copy link
Contributor

decoye commented Aug 21, 2017

onds)
2017-08-21 17:03:47 (DEBUG): BUY XXXXXXX ETH @ 279.5 EUR
2017-08-21 17:03:52 (DEBUG): kraken returned an error, retrying.. unable to buy: {}
2017-08-21 17:04:02 (DEBUG): BUY XXXXXXXX ETH @ 279.5 EUR
2017-08-21 17:04:04 (DEBUG): Requested ETH/EUR trade data from Kraken ...
2017-08-21 17:04:05 (DEBUG): Processing 8 new trades. From 2017-08-21 15:03:59 UTC to 2017-08-21 15:04:07 UTC. (a few seconds)
2017-08-21 17:04:07 (DEBUG): kraken returned an error, retrying.. unable to buy: {}
2017-08-21 17:04:17 (DEBUG): BUY XXXXXXXX ETH @ 279.5 EUR
2017-08-21 17:04:23 (DEBUG): kraken returned an error, retrying.. unable to buy: {}
2017-08-21 17:04:24 (DEBUG): Requested ETH/EUR trade data from Kraken ...
2017-08-21 17:04:25 (DEBUG): No new trades.
2017-08-21 17:04:33 (DEBUG): BUY XXXXXXXX ETH @ 279.5 EUR
2017-08-21 17:04:38 (DEBUG): kraken returned an error, retrying.. unable to buy: {}

@Tr4sK
Copy link
Author

Tr4sK commented Aug 22, 2017

Sorry for late reply.
Yes, the bot continue and the error continue to rise. The portfolio is updated and new order are made.

@decoye
Copy link
Contributor

decoye commented Aug 22, 2017

Not only that, after a short advise, the bot sells correctly, but keeps sending buy attempts to kraken with the value of the former long.

@askmike
Copy link
Owner

askmike commented Aug 22, 2017

but keeps sending buy attempts to kraken with the value of the former long.

Ah yes, that's because an order is normally created very fast, so we don't track portfolio state between doing these calls (but in this case it never ends).

I have deposited some money into kraken, hope to troubleshoot it in a few hours!

@askmike
Copy link
Owner

askmike commented Aug 22, 2017

I cleaned the logging up, you now get to see the errors, but it seems right now as if Kraken's API is not really responding well:

2017-08-22 22:53:05 (INFO): Trader Received advice to go long. Buying  XBT
2017-08-22 22:53:07 (INFO): Attempting to BUY 0.02817014137512576 XBT at kraken price: 3501.132
2017-08-22 22:53:07 (DEBUG):  BUY 0.02817014 XBT @ 3501.132 EUR
2017-08-22 22:53:12 (ERROR):  unable to buy Error: Error in server response: {"code":"ESOCKETTIMEDOUT","connect":false}
    at Request._callback (/Users/pear/projects/gekko/node_modules/kraken-api/kraken.js:135:33)
    at self.callback (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:188:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at ClientRequest.<anonymous> (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:822:16)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:105:13)
    at ClientRequest.emit (events.js:207:7)
    at TLSSocket.emitTimeout (_http_client.js:720:34)
    at Object.onceWrapper (events.js:312:19)
2017-08-22 22:53:12 (DEBUG):  kraken returned an error, retrying..
2017-08-22 22:53:22 (DEBUG):  BUY 0.02817014 XBT @ 3501.132 EUR
2017-08-22 22:53:23 (DEBUG):  Requested XBT/EUR trade data from Kraken ...
2017-08-22 22:53:24 (DEBUG):  Processing 18 new trades. From 2017-08-22 21:53:16 UTC to 2017-08-22 21:53:33 UTC. (a few seconds)
2017-08-22 22:53:27 (ERROR):  unable to buy Error: Error in server response: {"code":"ESOCKETTIMEDOUT","connect":false}
    at Request._callback (/Users/pear/projects/gekko/node_modules/kraken-api/kraken.js:135:33)
    at self.callback (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:188:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at ClientRequest.<anonymous> (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:822:16)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:105:13)
    at ClientRequest.emit (events.js:207:7)
    at TLSSocket.emitTimeout (_http_client.js:720:34)
    at Object.onceWrapper (events.js:312:19)
2017-08-22 22:53:27 (DEBUG):  kraken returned an error, retrying..
2017-08-22 22:53:37 (DEBUG):  BUY 0.02817014 XBT @ 3501.132 EUR
2017-08-22 22:53:42 (ERROR):  unable to buy Error: Error in server response: {"code":"ESOCKETTIMEDOUT","connect":false}
    at Request._callback (/Users/pear/projects/gekko/node_modules/kraken-api/kraken.js:135:33)
    at self.callback (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:188:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at ClientRequest.<anonymous> (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:822:16)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:105:13)
    at ClientRequest.emit (events.js:207:7)
    at TLSSocket.emitTimeout (_http_client.js:720:34)
    at Object.onceWrapper (events.js:312:19)
2017-08-22 22:53:42 (DEBUG):  kraken returned an error, retrying..
2017-08-22 22:53:43 (DEBUG):  Requested XBT/EUR trade data from Kraken ...
2017-08-22 22:53:43 (DEBUG):  Processing 14 new trades. From 2017-08-22 21:53:45 UTC to 2017-08-22 21:53:52 UTC. (a few seconds)
2017-08-22 22:53:52 (DEBUG):  BUY 0.02817014 XBT @ 3501.132 EUR
2017-08-22 22:53:58 (ERROR):  unable to buy Error: Error in server response: {"code":"ESOCKETTIMEDOUT","connect":false}
    at Request._callback (/Users/pear/projects/gekko/node_modules/kraken-api/kraken.js:135:33)
    at self.callback (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:188:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at ClientRequest.<anonymous> (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:822:16)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:105:13)
    at ClientRequest.emit (events.js:207:7)
    at TLSSocket.emitTimeout (_http_client.js:720:34)
    at Object.onceWrapper (events.js:312:19)
2017-08-22 22:53:58 (DEBUG):  kraken returned an error, retrying..
2017-08-22 22:54:03 (DEBUG):  Requested XBT/EUR trade data from Kraken ...
2017-08-22 22:54:04 (DEBUG):  Processing 1 new trades. From 2017-08-22 21:54:03 UTC to 2017-08-22 21:54:03 UTC. (a few seconds)
2017-08-22 22:54:04 (INFO): iteration: 1
2017-08-22 22:54:08 (DEBUG):  BUY 0.02817014 XBT @ 3501.132 EUR
2017-08-22 22:54:13 (ERROR):  unable to buy Error: Error in server response: {"code":"ESOCKETTIMEDOUT","connect":false}
    at Request._callback (/Users/pear/projects/gekko/node_modules/kraken-api/kraken.js:135:33)
    at self.callback (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:188:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at ClientRequest.<anonymous> (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:822:16)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:105:13)
    at ClientRequest.emit (events.js:207:7)
    at TLSSocket.emitTimeout (_http_client.js:720:34)
    at Object.onceWrapper (events.js:312:19)
2017-08-22 22:54:13 (DEBUG):  kraken returned an error, retrying..
2017-08-22 22:54:23 (DEBUG):  BUY 0.02817014 XBT @ 3501.132 EUR
2017-08-22 22:54:23 (DEBUG):  Requested XBT/EUR trade data from Kraken ...
2017-08-22 22:54:24 (DEBUG):  Processing 10 new trades. From 2017-08-22 21:54:19 UTC to 2017-08-22 21:54:35 UTC. (a few seconds)
2017-08-22 22:54:28 (ERROR):  unable to buy Error: Error in server response: {"code":"ESOCKETTIMEDOUT","connect":false}
    at Request._callback (/Users/pear/projects/gekko/node_modules/kraken-api/kraken.js:135:33)
    at self.callback (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:188:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at ClientRequest.<anonymous> (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:822:16)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:105:13)
    at ClientRequest.emit (events.js:207:7)
    at TLSSocket.emitTimeout (_http_client.js:720:34)
    at Object.onceWrapper (events.js:312:19)
2017-08-22 22:54:28 (DEBUG):  kraken returned an error, retrying..
2017-08-22 22:54:38 (DEBUG):  BUY 0.02817014 XBT @ 3501.132 EUR
2017-08-22 22:54:43 (ERROR):  unable to buy Error: Error in server response: {"code":"ESOCKETTIMEDOUT","connect":false}
    at Request._callback (/Users/pear/projects/gekko/node_modules/kraken-api/kraken.js:135:33)
    at self.callback (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:188:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at ClientRequest.<anonymous> (/Users/pear/projects/gekko/node_modules/kraken-api/node_modules/request/request.js:822:16)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:105:13)
    at ClientRequest.emit (events.js:207:7)
    at TLSSocket.emitTimeout (_http_client.js:720:34)
    at Object.onceWrapper (events.js:312:19)
2017-08-22 22:54:43 (DEBUG):  kraken returned an error, retrying..
[... repeats]

@askmike
Copy link
Owner

askmike commented Aug 22, 2017

Can you guys try the new version of Gekko?

Note that it requires reinstalling the kraken dependency (run npm install). I got this result now:

2017-08-23 00:34:26 (INFO): Trader Received advice to go short. Selling  XBT
2017-08-23 00:34:27 (INFO): Attempting to SELL 0.02817014 XBT at kraken price: 3475.84500
2017-08-23 00:34:27 (DEBUG):  SELL 0.02817014 XBT @ 3475.84500 EUR
2017-08-23 00:34:37 (DEBUG):  added order with txid: OQNJXL-WJNFM-DW6Z57
2017-08-23 00:34:45 (DEBUG):  Requested XBT/EUR trade data from Kraken ...
2017-08-23 00:34:46 (DEBUG):  Processing 8 new trades. From 2017-08-22 23:34:42 UTC to 2017-08-22 23:34:54 UTC. (a few seconds)
2017-08-23 00:34:50 (INFO): SELL was successfull
2017-08-23 00:34:53 (INFO): (PROFIT REPORT) original simulated balance:  97.83646630 EUR
2017-08-23 00:34:53 (INFO): (PROFIT REPORT) current simulated balance:   97.74550000 EUR
2017-08-23 00:34:53 (INFO): (PROFIT REPORT) simulated profit:    -0.09096630 EUR (-0.09297791%)

@decoye
Copy link
Contributor

decoye commented Aug 23, 2017 via email

@decoye
Copy link
Contributor

decoye commented Aug 23, 2017

i cant test it, when i start gekko with kraken as a exchange it tells me it knows nothing with the name kraken.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants