krakenfx / kraken-api-client

Example client libraries for use with the kraken.com API.
MIT License
88 stars 94 forks source link

Fatal error: Uncaught KrakenAPIException: JSON decode error #6

Open daehkcarc opened 6 years ago

daehkcarc commented 6 years ago

I get the JSON decode error pretty consistently with this.

I have a PHP script that does somewhere between 5 and 10 calls to the KrakenAPIClient.php. About half the time the page won't load due to the JSON decode error.

Is this a problem with kraken and not the provided KrakenAPIClient.php?

Thanks for your hard work. Crossing my fingers that 3 years after this was published that there is still someone out there listening!

ekr3peeK commented 6 years ago

Unfortunatly, I don't think anyone is listening. The Kraken system is VERY BAD. I am having the exact same issues as you. To make things worse, when I get a JSON decode error, it is possible that the request I sent to kraken actually WENT through, and Kraken performs my request.

For example, when I try to initiate an exchange from the API, sometimes I get a JSON decode error, just to realize a few minutes later, that the exchange was initialized nonetheless. And no, this is not a problem of this PHP class. If you try with plain and simple CURL requests, sometimes the result is a HTML code from Cloudfare stating that Kraken could not be reached (this is when you get a JSON decode error in the API). So basically, the Kraken API is not reliable at all.

I've managed to get a workaround for my exchange problem, by providing reference ids, and verifying the reference, before trying to reinitialize the exchange after a JSON decode error, but this does not solve the fund withdrawal, where you can set no user defined reference, so when you get a JSON decode, there is no surefire way to realize if the withdrawal was indeed processed, or not.

If anyone is indeed listening, does anyone have some ideas about this?

ghost commented 6 years ago

yes kraken sucks... I was thinking to write my own frontend using their api... reading this made me change my mind. I'll go to an other exchange because I lost a lot of money because of the instability of kraken.

TheBitmap commented 6 years ago

I'm writing something, using the Kraken API as well... I keep getting "PHP Fatal error: Uncaught KrakenAPIException: JSON decode error...." Sometimes 4-5 times in an hour, sometimes none for a few hours.

I'm not getting any other errors, notices, or warnings from my scripts that uses the API... is this purely on Kraken's end? Does anyone have any advice on eliminating these fatal errors?

cleehamilton commented 6 years ago

Yea that's exactly what it was doing before the update. It's like the Kraken server glitches and miscodes the output. Which fails the deciding process of the phone file. Which is why you always see it on the same line of code.