MarcelBeining/EazeBot

eazebot can't be started if a network error occurs

Closed this issue · 2 comments

I got a new issue with kraken - which is imho critical:

I can't start the bot because kraken returns a cloud flare issue...

******** Welcome to EazeBot (v1.7.14) ********                                                                                                                                 
Free python/telegram bot for easy execution and surveillance of crypto trading plans on multiple exchanges                                                                     
                                                                                                                                                                               
                                                                                                                                                                               
2018-12-26 20:31:15,189 [MainThread  ] [WARNI]  If 'per_message=False', 'CallbackQueryHandler' will not be tracked for every message.                                          
2018-12-26 20:31:15,189 [MainThread  ] [WARNI]  If 'per_message=False', 'CallbackQueryHandler' will not be tracked for every message.                                          
2018-12-26 20:31:15,189 [MainThread  ] [WARNI]  If 'per_message=False', 'CallbackQueryHandler' will not be tracked for every message.                                          
2018-12-26 20:31:15,190 [MainThread  ] [WARNI]  If 'per_message=False', 'CallbackQueryHandler' will not be tracked for every message.                                          
2018-12-26 20:31:15,190 [MainThread  ] [WARNI]  If 'per_message=False', 'CallbackQueryHandler' will not be tracked for every message.                                          
2018-12-26 20:31:15,190 [MainThread  ] [INFO ]  Loading user data                                                                                                              
2018-12-26 20:31:17,207 [MainThread  ] [INFO ]  Found exchanges {'Poloniex', 'Kraken', 'Binance', 'Kucoin'} with keys ['Binance', 'Poloniex', 'Kraken', 'Kucoin'], secrets ['Bi
nance', 'Poloniex', 'Kraken', 'Kucoin'], uids [], password []                                                                                                                  
2018-12-26 20:31:56,210 [MainThread  ] [ERROR]  User 479767609: Network exception occurred 5 times in a row on Kraken                                                          
An error occured:                                                                                                                                                              
kraken <!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>                                                                                                                                                                         
<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>                                                                                                                        
</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">Error</span>                                                                                                                                       
<span class="cf-error-code">520</span>                                                                                                                                         
<small class="heading-ray-id">Ray ID: 48f5f86bcdf359cc &bull; 2018-12-26 19:31:55 UTC</small>                                                                                  
</h1>                                                                                                                                                                          
<h2 class="cf-subheadline">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">You</span>                                                                                                                                        
<h3 class="cf-status-name">Browser</h3>                                                                                                                                        
<span class="cf-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">Vienna</span>                                                                                                                                     
<h3 class="cf-status-name">Cloudflare</h3>                                                                                                                                     
<span class="cf-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">api.kraken.com</span>                                                                                                                             
<h3 class="cf-status-name">Host</h3>                                                                                                                                           
<span class="cf-status-label">Error</span>                                                                                                                                     
</div>                                                                                                                                                                         
</div>                                                                                                                                                                         
</div>                                                                                                                                                                         
</div>                                                                                                                                                                         
<div class="cf-section cf-wrapper">                                                                                                                                            
<div class="cf-columns two">                                                                                                                                                   
<div class="cf-column">                                                                                                                                                        
<h2>What happened?</h2>                                                                                                                                                        
<p>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>What can I do?</h2>                                                                                                                                                        
<h5>If you are a visitor of this website:</h5>                                                                                                                                 
<p>Please try again in a few minutes.</p>                                                                                                                                      
<h5>If you are the owner of this website:</h5>                                                                                                                                 
<p><span>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 suppor
t 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 er
ror page).</span> <a href="https://support.cloudflare.com/hc/en-us/articles/200171936-Error-520">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>48f5f86bcdf359cc</strong></span>                                                                                       
<span class="cf-footer-separator">&bull;</span>                                                                                                                                
<span class="cf-footer-item"><span>Your IP</span>: 80.110.165.137</span>                                                                                                       
<span class="cf-footer-separator">&bull;</span>                                                                                                                                
<span class="cf-footer-item"><span>Performance &amp; security by</span> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="
_blank">Cloudflare</a></span>                                                                                                                                                  
</p>                                                                                                                                                                           
</div>                                                                                                                                                                         
</div>                                                                                                                                                                         
</div>                                                                                                                                                                         
</body>                                                                                                                                                                        
</html>                                                                                                                                                                        
                                                                                                                                                                               
                                                                                                                                                                               
Press Enter to abort        

If I disable the api key for kraken I can't start the bot

2018-12-26 20:35:51,156 [MainThread  ] [INFO ]  Loading user data
2018-12-26 20:35:53,173 [MainThread  ] [INFO ]  Found exchanges {'Poloniex', 'Kucoin', 'Binance'} with keys ['Binance', 'Poloniex', 'Kucoin'], secrets ['Binance', 'Poloniex', 'Kucoin'], uids [], password []
An error occured:
'Kraken'

Press Enter to abort

Hi offtopic,
it seems the kraken exchange was down yesterday until late evening.
So far the idea was that if the bot cannot access an exchange on the start (because of wrong API keys or similar) that it should not start to make sure that the user has everything correctly set.
Of course this is problematic if you already initialized a trade and only restarted the bot and then it does not start. I will review that in the near future.
Also it is really bad that these Cloudflare errors are not correctly recognized as exchange errors by ccxt but responsibility is with ccxt there.

The error should be fixed since 9b1bd6b, hence I close the issue. If you still have problems with it, do not hesitate to reopen with details on the error.