whittlem / pycryptobot

Python Crypto Bot (PyCryptoBot)
Apache License 2.0
1.97k stars 738 forks source link

Docker image v 2.24.0 returns error in some cases #306

Closed dbobak closed 3 years ago

dbobak commented 3 years ago

I'm running 4 instances of pycryptobot as a docker containers, trading on Binance. After upgrade to version 2.24.0, two of the four containers return errors:

Creating dotusdt ... done
Creating soleur  ... done
Creating btceur  ... done
Creating etheur  ... done
Attaching to soleur, dotusdt, etheur, btceur
soleur     | Traceback (most recent call last):
soleur     |   File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
soleur     | KeyError: 'fees'
soleur     |
soleur     | The above exception was the direct cause of the following exception:
soleur     |
soleur     | Traceback (most recent call last):
soleur     |   File "/usr/local/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc
soleur     |     raise KeyError(key) from err
soleur     | KeyError: 'fees'
btceur     | Traceback (most recent call last):
btceur     |   File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
btceur     | KeyError: 'fees'
btceur     |
btceur     | The above exception was the direct cause of the following exception:
btceur     |
btceur     | Traceback (most recent call last):
btceur     |   File "/usr/local/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc
btceur     |     raise KeyError(key) from err
btceur     | KeyError: 'fees'
dotusdt    | --------------------------------------------------------------------------------
dotusdt    | |                             Python Crypto Bot                                |
dotusdt    | --------------------------------------------------------------------------------
dotusdt    | |                Release : v2.24.0                                             |
dotusdt    | -----------------------------------------------------------------------------
dotusdt    | |               Bot Mode : LIVE - live trades using your funds!                |
dotusdt    | |            Bot Started : 2021-06-05 20:06:03.337644                          |
dotusdt    | ================================================================================
dotusdt    | |           Sell At Loss : True  --sellatloss True                             |
dotusdt    | |     Sell At Resistance : False  --sellatresistance                           |
dotusdt    | |        Trade Bull Only : False  --disablebullonly                            |
dotusdt    | |          Buy Near High : True  --disablebuynearhigh                          |
dotusdt    | |           Use Buy MACD : True  --disablebuymacd                              |
dotusdt    | |            Use Buy OBV : True  --disablebuyobv                               |
dotusdt    | |      Use Buy Elder-Ray : True  --disablebuyelderray                          |
dotusdt    | |     Sell Fibonacci Low : True  --disablefailsafefibonaccilow                 |
dotusdt    | |   Candlestick Reversal : True  --disableprofitbankreversal                   |
dotusdt    | |               Telegram : True  --disabletelegram                             |
dotusdt    | |                    Log : True  --disablelog                                  |
dotusdt    | |                Tracker : True  --disabletracker                              |
dotusdt    | |       Auto restart Bot : False  --autorestart                                |
dotusdt    | ================================================================================
etheur     | --------------------------------------------------------------------------------
etheur     | |                             Python Crypto Bot                                |
etheur     | --------------------------------------------------------------------------------
etheur     | |                Release : v2.24.0                                             |
etheur     | -----------------------------------------------------------------------------
etheur     | |               Bot Mode : LIVE - live trades using your funds!                |
etheur     | |            Bot Started : 2021-06-05 20:06:03.587894                          |
etheur     | ================================================================================
etheur     | |           Sell At Loss : True  --sellatloss True                             |
etheur     | |     Sell At Resistance : False  --sellatresistance                           |
etheur     | |        Trade Bull Only : False  --disablebullonly                            |
etheur     | |          Buy Near High : True  --disablebuynearhigh                          |
etheur     | |           Use Buy MACD : True  --disablebuymacd                              |
etheur     | |            Use Buy OBV : True  --disablebuyobv                               |
etheur     | |      Use Buy Elder-Ray : True  --disablebuyelderray                          |
etheur     | |     Sell Fibonacci Low : True  --disablefailsafefibonaccilow                 |
etheur     | |   Candlestick Reversal : True  --disableprofitbankreversal                   |
etheur     | |               Telegram : True  --disabletelegram                             |
etheur     | |                    Log : True  --disablelog                                  |
etheur     | |                Tracker : True  --disabletracker                              |
etheur     | |       Auto restart Bot : False  --autorestart                                |
etheur     | ================================================================================

Downgrading to 2.23.3 works fine again.

Below are configuration files:

docker-commpose.yaml:

version: '3.9'

services:
  etheur:
    image: ghcr.io/whittlem/pycryptobot/pycryptobot:latest
    build:
      context: .
    container_name: etheur
    volumes:
      - ${PWD}/market/ETHEUR/config.json:/app/config.json
      - ${PWD}/market/ETHEUR/pycryptobot.log:/app/pycryptobot.log
      - ${PWD}/market/ETHEUR/graphs:/app/graphs
      - /etc/localtime:/etc/localtime:ro
    environment:
      - PYTHONUNBUFFERED=1
    deploy:
      restart_policy:
        condition: on-failure

  dotusdt:
    image: ghcr.io/whittlem/pycryptobot/pycryptobot:latest
    build:
      context: .
    container_name: dotusdt
    volumes:
      - ${PWD}/market/DOTUSDT/config.json:/app/config.json
      - ${PWD}/market/DOTUSDT/pycryptobot.log:/app/pycryptobot.log
      - ${PWD}/market/DOTUSDT/graphs:/app/graphs
      - /etc/localtime:/etc/localtime:ro
    environment:
      - PYTHONUNBUFFERED=1
    deploy:
      restart_policy:
        condition: on-failure

  btceur:
    image: ghcr.io/whittlem/pycryptobot/pycryptobot:latest
    build:
      context: .
    container_name: btceur
    volumes:
      - ${PWD}/market/BTCEUR/config.json:/app/config.json
      - ${PWD}/market/BTCEUR/pycryptobot.log:/app/pycryptobot.log
      - ${PWD}/market/BTCEUR/graphs:/app/graphs
      - /etc/localtime:/etc/localtime:ro
    environment:
      - PYTHONUNBUFFERED=1
    deploy:
      restart_policy:
        condition: on-failure

  soleur:
    image: ghcr.io/whittlem/pycryptobot/pycryptobot:latest
    build:
      context: .
    container_name: soleur
    volumes:
      - ${PWD}/market/SOLEUR/config.json:/app/config.json
      - ${PWD}/market/SOLEUR/pycryptobot.log:/app/pycryptobot.log
      - ${PWD}/market/SOLEUR/graphs:/app/graphs
      - /etc/localtime:/etc/localtime:ro
    environment:
      - PYTHONUNBUFFERED=1
    deploy:
      restart_policy:
        condition: on-failure

config.json for BTC-EUR

{ "binance" : {
        "api_url" : "https://api.binance.com",
        "api_key" : "xxxx",
        "api_secret" : "xxx",
        "config" : {
            "base_currency" : "BTC",
            "quote_currency" : "EUR",
            "live" : 1,
            "graphs" : 1,
            "buypercent" : 50,
            "disablebullonly" : 1,
            "verbose" : 0
        }
    },
    "telegram" : {
        "token" : "xxx",
        "client_id" : "xxx"
    }
}

config.json for DOT-USDT

{ "binance" : { 
        "api_url" : "https://api.binance.com",
         "api_key" :  "xxx",
         "api_secret" : "xxx",
         "config" : {
            "base_currency" : "DOT",
            "quote_currency" : "USDT",
            "granularity" : "1m",
            "disablebullonly" : 1,
            "live" : 1,
            "graphs" : 1,
            "verbose" : 0
        }
    },
    "telegram" : {
        "token" : "xxx",
        "client_id" : "xxx"
    }
}

config.json for ETH-EUR

{
    "binance" : {
        "api_url" : "https://api.binance.com",
        "api_key" : "xxx",
        "api_secret" : "xxx",
        "config" : {
            "base_currency" : "ETH",
            "quote_currency" : "EUR",
            "disablebullonly" : 1,
            "live" : 1,
            "graphs" : 1,
            "buypercent" : 50,
            "verbose" : 0
        }
    },
    "telegram" : {
        "token" : "xxx",
        "client_id" : "xxx"
    }
}

config.json for SOL-EUR

{
    "binance" : {
        "api_url" : "https://api.binance.com",
        "api_key" : "xxx",
        "api_secret" : "xxx",
        "config" : {
            "base_currency" : "SOL",
            "quote_currency" : "EUR",
            "live" : 1,
            "disablebullonly" : 1,
            "graphs" : 1,
            "granularity": "15m",
            "buypercent" : 50,
            "verbose" : 0
        }
    },
    "telegram" : {
        "token" : "xxx",
        "client_id" : "xxx"
    }
}
dbobak commented 3 years ago

The same error occurs in 2.24.2

whittlem commented 3 years ago

@letsautom8, as you are our Docker expert do you mind helping with this one?

whittlem commented 3 years ago

@dbobak, you are quite a few versions behind at the moment. Can you please upgrade to the latest and confirm that you still have this issue?

dbobak commented 3 years ago

After ugrade, error is fixed. Thanks!