Gekko: Permission denied error when running live

Created on 25 May 2017  Â·  12Comments  Â·  Source: askmike/gekko

Hey,

I'm getting a 'permission denied' error when trying to run gekko in live mode with my poloniex account. I'm on Ubuntu Gnome 17.04. Any idea how to solve this?
See output below:

````
Gekko v0.4.10
I'm gonna make you rich, Bud Fox.

2017-05-25 15:21:06 (INFO): Setting up Gekko in realtime mode
2017-05-25 15:21:06 (INFO):
2017-05-25 15:21:06 (INFO): Setting up:
2017-05-25 15:21:06 (INFO): Candle writer
2017-05-25 15:21:06 (INFO): Store candles in a database
2017-05-25 15:21:06 (INFO):

2017-05-25 15:21:06 (INFO): Setting up:
2017-05-25 15:21:06 (INFO): Trading Advisor
2017-05-25 15:21:06 (INFO): Calculate trading advice
2017-05-25 15:21:06 (INFO): Using the strategy: MACD
2017-05-25 15:21:06 (WARN): Warning, trading method has no name
2017-05-25 15:21:06 (INFO): The trading method requests 900 minutes of historic data. Checking availablity..
2017-05-25 15:21:06 (INFO):

2017-05-25 15:21:06 (INFO): Usable local data available, trying to match with exchange data..
2017-05-25 15:21:07 (INFO): Full history locally available. Seeding the trading method with all required historical candles.
2017-05-25 15:21:07 (INFO): Setting up:
2017-05-25 15:21:07 (INFO): Trader
2017-05-25 15:21:07 (INFO): Follows the advice and create real orders.
2017-05-25 15:21:07 (INFO):

Gekko encountered an error and can't continue

Error:

Permission denied.

Meta debug info:

Gekko version: v0.4.10
Nodejs version: v6.10.3
````

Most helpful comment

I had the same issue, turns out Poloniex has some bug in the UI.
By default "IP Access Restriction" is set to "Restrict acces.. " and below in "Trusted IPs" you see your IP, but in fact that is not the case.
Only after you click on Edit and manually copy paste the same IP that is already written there, then it actually works.

All 12 comments

Woa very strange! Can you double check whether the API key has the following permissions:

  • read balance/portfolio
  • read fees
  • create (limit) orders

This is my API key from poloniex, it doesn't give much more information. It seems OK? Should I be adding code in my config.js to connect to the poloniex API? It is handled by Gekko when you add your api key and secret right?

image

Link to the API: https://poloniex.com/support/api/

You don't need withdrawels enabled. Are you running Gekko from a trusted IP?

On Fri, May 26, 2017 at 10:28 AM, juliahofs notifications@github.com
wrote:

This is my API key from poloniex, it doesn't give much more information.
It seems OK? Should I be adding code in my config.js to connect to the
poloniex API? It is handled by Gekko when you add your api key and secret
right?

[image: image]
https://cloud.githubusercontent.com/assets/18557718/26489041/0e68272c-4206-11e7-9cdf-3f627d2dc6f9.png

Link to the API: https://poloniex.com/support/api/

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/askmike/gekko/issues/756#issuecomment-304236143, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7MD_vieyow17-qLwYH9e7sHsiPeb4Kks5r9psygaJpZM4NmYMo
.

--
PGP key at keybase.io/mikevanrossum
https://keybase.io/mikevanrossum/key.asc

Yes I am. The same under 'current IP'.

Very strange, I am currently running Gekko on poloniex without problems. Could you try to delete this API key and create a new one? If that doesn't work I'll do some more logging so we can figure out exactly where we get this error from.

Made a new key, but still not working unfortunately :(

Can you download this branch of Gekko and try again: https://github.com/askmike/gekko/tree/debug/polo-auth-logging

When you run that it should print out debug information related to poloniex API calls.

This is the output:

2017-05-26 12:21:04 (INFO): Setting up Gekko in realtime mode
2017-05-26 12:21:04 (INFO): 
2017-05-26 12:21:04 (INFO): Setting up:
2017-05-26 12:21:04 (INFO):      Trading Advisor
2017-05-26 12:21:04 (INFO):      Calculate trading advice
2017-05-26 12:21:04 (INFO):      Using the strategy: RSI
2017-05-26 12:21:04 (INFO):     The trading method requests 900 minutes of historic data. Checking availablity..
2017-05-26 12:21:04 (INFO): 

2017-05-26 12:21:04 (DEBUG):        Available local data:
2017-05-26 12:21:04 (DEBUG):            from: 900 minutes ago
2017-05-26 12:21:04 (DEBUG):            to: 143 minutes ago
2017-05-26 12:21:04 (INFO):     Usable local data available, trying to match with exchange data..
2017-05-26 12:21:04 (DEBUG):        Fetching exchange data since 158 minutes ago
2017-05-26 12:21:05 (DEBUG):        Available exchange data:
2017-05-26 12:21:05 (DEBUG):            from: 157 minutes ago
2017-05-26 12:21:05 (DEBUG):            to: 0 minutes ago
2017-05-26 12:21:05 (DEBUG):        Stitching datasets
2017-05-26 12:21:05 (INFO):     Full history locally available. Seeding the trading method with all required historical candles.
2017-05-26 12:21:05 (DEBUG):        Seeding with:
2017-05-26 12:21:05 (DEBUG):            from: 900 minutes ago
2017-05-26 12:21:05 (DEBUG):            to: 159 minutes ago
2017-05-26 12:21:05 (INFO): Setting up:
2017-05-26 12:21:05 (INFO):      Trader
2017-05-26 12:21:05 (INFO):      Follows the advice and create real orders.
2017-05-26 12:21:05 (DEBUG):    getting balance & fee from Poloniex
2017-05-26 12:21:05 (INFO): 

setPortfolio { '0': null,
  '1': [ { name: 'BTC', amount: NaN }, { name: 'USDT', amount: NaN } ] }
setFee { '0': 'Permission denied.' }


Gekko encountered an error and can't continue

Error:

Permission denied. 



Meta debug info:

Gekko version: v0.4.10
Nodejs version: v6.10.3

This error is poloniex telling Gekko that it is unable to fetch data from your account. Judging by this link, it appears this exact error is caused by a call from a non whitelisted IP.

Can you double check that the IP on the pc / server you are running Gekko from is whitelisted (and you are not using a proxy / vpn / etc). You can also try creating a new key (WITHOUT withdrawal access) and not limiting it to specific IPs to see if that solves the error.

Yes it's working now! :+1: However, I did verify my IP address really was trusted (and I'm not using VPN or something). Can I safely do this without limiting the IP addresses?

Can I safely do this without limiting the IP addresses?

So an API key is kind of like a limited password to your account (that can only do things you stated were allowed with that API key). Limiting it to an IP is a safety measure that makes it so that if someone steals your API key they still cannot do anything with it (unless they also access to that IP as well). If someone now gets access to your API key they can control trades but NOT steal the money directly. This is definitely less safe, so if you rather use IP restriction you'd have to contact support of Poloniex to figure out why you are getting that error (it has nothing to do with Gekko).


If you need to know anything else, feel free to keep commenting :)

I had the same issue, turns out Poloniex has some bug in the UI.
By default "IP Access Restriction" is set to "Restrict acces.. " and below in "Trusted IPs" you see your IP, but in fact that is not the case.
Only after you click on Edit and manually copy paste the same IP that is already written there, then it actually works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thegamecat picture thegamecat  Â·  4Comments

patjk picture patjk  Â·  3Comments

yacindou picture yacindou  Â·  3Comments

rcoenen picture rcoenen  Â·  3Comments

Oowii picture Oowii  Â·  4Comments