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

Kraken updateproducts.sh does not work #427

Closed
smartbrain opened this issue Aug 1, 2017 · 12 comments
Closed

Kraken updateproducts.sh does not work #427

smartbrain opened this issue Aug 1, 2017 · 12 comments

Comments

@smartbrain
Copy link

smartbrain commented Aug 1, 2017

Hi,

The Kraken products list is dated with many pairs that no longer exist (all the ones with the old names that do not begin with x or z).

The updateproducts.sh script does not work properly. Here's the error message I get.

Running Ubuntu 16.04 LTS.

I am otherwise able to trade on Kraken (and bittrex's updateproducts works. Incidentally the permissions on bittrex's updateproducts.sh is incorrect and lacks execute (chmod +x) - or should I open a separate ticket for that)

Thanks and keep up the good work.

> don@naked:~/zenbot/extensions/exchanges/kraken$ ./update-products.sh 
Error: Could not understand response from server: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<meta http-equiv="set-cookie" content="cf_use_ob=0; expires=Tue, 01-Aug-17 20:38:56 GMT; path=/">
<title>api.kraken.com | 520: Web server is returning an unknown error</title>
<meta charset="UTF-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
<meta name="robots" content="noindex, nofollow"/>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/>
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection"/>
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>
</head>
<body>
<div id="cf-wrapper">
<div id="cf-error-details" class="cf-error-details-wrapper">
<div class="cf-wrapper cf-error-overview">
<h1>
<span class="cf-error-type" data-translate="error">Error</span>
<span class="cf-error-code">520</span>
<small class="heading-ray-id">Ray ID: 387b99c0cac73542 &bull; 2017-08-01 20:38:26 UTC</small>
</h1>
<h2 class="cf-subheadline" data-translate="error_desc">Web server is returning an unknown error</h2>
</div> 
<div class="cf-section cf-highlight cf-status-display">
<div class="cf-wrapper">
<div class="cf-columns cols-3">
<div id="cf-browser-status" class="cf-column cf-status-item cf-browser-status ">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-browser"></i>
<i class="cf-icon-status cf-icon-ok"></i>
</div>
<span class="cf-status-desc" data-translate="browser_desc">You</span>
<h3 class="cf-status-name" data-translate="browser_label">Browser</h3>
<span class="cf-status-label" data-translate="browser_status_label">Working</span>
</div>
<div id="cf-cloudflare-status" class="cf-column cf-status-item cf-cloudflare-status ">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-cloud"></i>
<i class="cf-icon-status cf-icon-ok"></i>
</div>
<span class="cf-status-desc" data-translate="cloud_desc">London</span>
<h3 class="cf-status-name" data-translate="cloud_label">Cloudflare</h3>
<span class="cf-status-label" data-translate="cloud_status_label">Working</span>
</div>
<div id="cf-host-status" class="cf-column cf-status-item cf-host-status cf-error-source">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-server"></i>
<i class="cf-icon-status cf-icon-error"></i>
</div>
<span class="cf-status-desc" data-translate="server_desc">api.kraken.com</span>
<h3 class="cf-status-name" data-translate="server_label">Host</h3>
<span class="cf-status-label" data-translate="server_status_label">Error</span>
</div>
</div>
</div>
</div> 
<div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2 data-translate="what_happened">What happened?</h2>
<p data-translate="unknown_error_desc">There is an unknown connection issue between Cloudflare and the origin web server. As a result, the web page can not be displayed.</p>
</div>
<div class="cf-column">
<h2 data-translate="what_can_i_do">What can I do?</h2>
<h5 data-translate="if_website_visitor">If you are a visitor of this website:</h5>
<p data-translate="try_again_in_a_few">Please try again in a few minutes.</p>
<h5 data-translate="if_website_owner">If you are the owner of this website:</h5>
<p><span data-translate="520_owner_desc">There is an issue between Cloudflare's cache and your origin web server. Cloudflare monitors for these errors and automatically investigates the cause. To help support the investigation, you can pull the corresponding error log from your web server and submit it our support team. Please include the Ray ID (which is at the bottom of this error page).</span> <a href="https://support.cloudflare.com/hc/en-us/articles/200171936-Error-520" data-translate="addtl_troubleshooting">Additional troubleshooting resources</a>.</p>
</div>
</div>
</div> 
<div class="cf-error-footer cf-wrapper">
<p>
<span class="cf-footer-item">Cloudflare Ray ID: <strong>387b99c0cac73542</strong></span>
<span class="cf-footer-separator">&bull;</span>
<span class="cf-footer-item"><span data-translate="your_ip">Your IP</span>: 86.21.113.84</span>
<span class="cf-footer-separator">&bull;</span>
<span class="cf-footer-item"><span data-translate="performance_security_by">Performance &amp; security by</span> <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">Cloudflare</a></span>
</p>
</div> 
</div> 
</div> 

    at Request._callback (/home/don/zenbot/node_modules/kraken-api/kraken.js:142:33)
    at Request.self.callback (/home/don/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/don/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/don/zenbot/node_modules/request/request.js:1091:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)
don@naked:~/zenbot/extensions/exchanges/kraken$
@timstoop
Copy link

timstoop commented Aug 2, 2017

It works for me... You seem to be getting the CloudFlare page, Kraken has had some connection issues.

That said, I still seem unable to get the kraken.BCH-ZEUR to work, it keeps telling me Error: Kraken API returned error: Query:Unknown asset pair. I checked the products.js and it is in there...

@ghost
Copy link

ghost commented Aug 3, 2017

@timstoop I've had some success after changing it to BCH-EUR in products.js. Though I'm puzzled why this is needed.

@timstoop
Copy link

timstoop commented Aug 3, 2017

That seems to work indeed, but I'm now getting pretty regular:

kraken.BCH-EUR saved 1000 trades 1 days left
....
Trades error:
Error: Kraken API returned error: Service:Unavailable

Wish the script would just retry on this error :(

@smartbrain
Copy link
Author

Sorry, seems to be an intermittent problem with Kraken yes. Tried again today after trying a few times in succession that day and it works now.

Ditto on BCH pairs, can't get them to work either.

@timstoop
Copy link

timstoop commented Aug 3, 2017

So, manually changing the trading pair in products.js (removing the Z from ZEUR, for instance) makes Zenbot see the asset, however, when you try to get the balance, it does not recognise the currency (and displays it as 0). I'm not sure what's going on here :/

@timstoop
Copy link

I ran updateproduct.sh again and now the result is a bit different (ignore the ./zen.sh invocation, it's the way I run zenbot.sh in a docker container):

tim@idefisk ~/code/upstream/zenbot $ ./zen.sh list-selectors | grep kraken | grep BCH
  kraken.BCH-XXBT   (BCH/XBT)
  kraken.BCH-ZEUR   (BCH/EUR)
  kraken.BCH-ZUSD   (BCH/USD)
tim@idefisk ~/code/upstream/zenbot $ ./zen.sh balance kraken.BCH-ZEUR

getQuote error:
Error: Kraken API returned error: Query:Unknown asset pair
    at Request._callback (/app/node_modules/kraken-api/kraken.js:155:34)
    at Request.self.callback (/app/node_modules/request/request.js:188:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/app/node_modules/request/request.js:1171:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1091:12)
    at IncomingMessage.g (events.js:292: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:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
/app/commands/balance.js:38
              if (err) throw err
                       ^

Error: Kraken API returned error: Query:Unknown asset pair
    at Request._callback (/app/node_modules/kraken-api/kraken.js:155:34)
    at Request.self.callback (/app/node_modules/request/request.js:188:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/app/node_modules/request/request.js:1171:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1091:12)
    at IncomingMessage.g (events.js:292: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:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

So Kraken seemed to have fixed the actual pairs, but Zenbot is using something else to determine what the pairs are? I'm confused.

@typicalaimster
Copy link

typicalaimster commented Aug 11, 2017

I had the same confusion. It took a minute to figure it out for USD...
kraken.BCH-USD

I'm guessing it'd be BCH-EUR for you? Looks like the X and Y was dropped from BCH to USD. I also had to do a new git clone on the current version to get things to work. For some reason something was messed up on the copy I had. A standard git pull wasn't fixing it.

@timstoop
Copy link

Nope, that gives me:

$ ./zen.sh balance kraken.BCH-EUR
error: could not find product "BCH-EUR"

@cmroche
Copy link
Contributor

cmroche commented Aug 13, 2017

#469

@cmroche
Copy link
Contributor

cmroche commented Aug 14, 2017

FYI, it only seems to impact DASH, EOS, GNO and BCH. We could hard code a check for those tokens and drop the X/Z naming convention. As far as I can tell there is no way to procedurally distinguish this change from the API output for their currency pairs.

@cmroche
Copy link
Contributor

cmroche commented Aug 17, 2017

A fix for the update script is in #483

@DeviaVir
Copy link
Owner

Closing as this should stay fixed now thanks to @cmroche

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

5 participants