chrisleekr / binance-trading-bot

Automated Binance trading bot - Trade multiple cryptocurrencies. Buy low/sell high with Grid Trading. Integrated with TradingView technical analysis
MIT License
5k stars 1.09k forks source link

After update .77 -> .78 No UI at all #297

Closed VSofter closed 3 years ago

VSofter commented 3 years ago

After common update routines (git pull, docker-compose pull, docker-compose up -d) from version .77 to .78 UI says "connected to the bot", but no bot interface is shown further.

What do I do/how do I diagnose problems?

starush commented 3 years ago

The same issue here. Bot is running in docker container under Linux at Hetzner cloud VPS with 2 VCPU, 2GB RAM and 20GB of disk space.

The problem appeared after upgrading to version 0.0.78: Web dashboard is not showing in browser.

The bot itself is running and performing trades. However, it shows empty page in the browser right after logging into web dashboard. it also shows the notifications bun nothing excepting that. I tried to roll back to previous working version (0.0.77) but bot was not even running on it. Then I pulled back the latest version (0.0.78), so bot is running but dashboard is still not accessible.

I have tried different browsers from desktop and mobile, I tried to hard-refresh the browser, nothing helped.

Please see the screenshots from the browser console below. There are two errors before entering the password: image

And the rest errors after logging in: image

VSofter commented 3 years ago

Same thing in Chrome console.

chrisleekr commented 3 years ago

Can you check the following things?

  1. In Chrome, open the Developer console and go to Network -> WS -> click first thing in the Name. And then you will see Messages. Refer screenshot. Copy the JSON and paste it here as a snippet.

    image

  2. Access to MongoDB and get configuration and paste it here as a snippet.

    $ docker exec -it binance-mongo /bin/bash
    $ mongo
    > use binance-bot
    > db['trailing-trade-common'].find();
  3. Access to Redis and get configuration and paste it here as a snippet.

    $ docker exec -it binance-redis /bin/bash
    $ redis-cli
    > AUTH <redis password>
    > HGET trailing-trade-configurations global
VSofter commented 3 years ago

@chrisleekr , where is redis password is set and what is default one? I see no related var in .env.dist.

ilbuonmarcio commented 3 years ago

It should be right in the docker-compose.yml file

VSofter commented 3 years ago

@chrisleekr, here you go. 1. {"command":"latest","authToken":"AUTHTOKENHERE","data":{}}

{"result":true,"type":"latest","isAuthenticated":true,"botOptions":{"authentication":{"lockList":true,"lockAfter":600},"autoTriggerBuy":{"enabled":false,"triggerAfter":20}},"configuration":{"_id":"60b2c729981080ba1b777e45","key":"configuration","enabled":true,"cronTime":" ","symbols":["ETHUSDT","XRPUSDT","EOSUSDT","DOTUSDT","LINKUSDT","ETCUSDT","LTCUSDT","ZECUSDT","BAKEUSDT","UNIUSDT","THETAUSDT","BCHUSDT","FILUSDT","XLMUSDT","SOLUSDT","XMRUSDT","AAVEUSDT","DASHUSDT","SUSHIUSDT","ATOMUSDT","RUNEUSDT","TRXUSDT","VETUSDT","ADAUSDT","ONTUSDT","NEOUSDT","BNBUSDT","ALGOUSDT","TROYUSDT","WRXUSDT","FIROUSDT","PUNDIXUSDT","WAVESUSDT","LUNAUSDT","KSMUSDT","REEFUSDT","PNTUSDT","BLZUSDT","LITUSDT","CFXUSDT","BELUSDT","UNFIUSDT","EPSUSDT","RENUSDT","BADGERUSDT","KAVAUSDT","PERPUSDT","KNCUSDT","GXSUSDT","TKOUSDT","NANOUSDT","1INCHUSDT","XTZUSDT","ZILUSDT","CAKEUSDT","TFUELUSDT","CTSIUSDT","FORTHUSDT","CHZUSDT","SANDUSDT","COMPUSDT","ENJUSDT","YFIUSDT","MATICUSDT","BTTUSDT","MINAUSDT","AUDIOUSDT","SUPERUSDT","AVAXUSDT","DOGEUSDT"],"candles":{"interval":"4h","limit":50},"buy":{"enabled":true,"lastBuyPriceRemoveThreshold":-1,"lastBuyPriceRemoveThresholds":{"USDT":10},"athRestriction":{"enabled":true,"candles":{"interval":"1d","limit":50},"restrictionPercentage":0.8},"gridTrade":[{"triggerPercentage":1,"stopPercentage":1.01,"limitPercentage":1.02,"maxPurchaseAmount":-1,"maxPurchaseAmounts":{"USDT":100,"BTC":0.001}},{"triggerPercentage":0.9,"stopPercentage":1.01,"limitPercentage":1.02,"maxPurchaseAmount":-1,"maxPurchaseAmounts":{"USDT":120,"BTC":0.001}}],"maxPurchaseAmount":-1},"sell":{"enabled":true,"stopLoss":{"enabled":true,"maxLossPercentage":0.7495,"disableBuyMinutes":120,"orderType":"market"},"gridTrade":[{"triggerPercentage":1.1,"stopPercentage":0.99,"limitPercentage":0.98,"quantityPercentage":-1,"quantityPercentages":{"USDT":1}}]},"system":{"temporaryDisableActionAfterConfirmingOrder":20,"checkManualBuyOrderPeriod":5,"refreshAccountInfoPeriod":1,"placeManualOrderInterval":5,"checkOrderExecutePeriod":10,"checkManualOrderPeriod":5},"botOptions":{"authentication":{"lockList":true,"lockAfter":600},"autoTriggerBuy":{"enabled":false,"triggerAfter":20}}},"common":{"version":"0.0.78","gitHash":"60a464a","accountInfo":{"makerCommission":10,"takerCommission":10,"buyerCommission":0,"sellerCommission":0,"canTrade":true,"canWithdraw":true,"canDeposit":true,"updateTime":1630820383119,"accountType":"SPOT","balances": <..>

2.

db['trailing-trade-common'].find(); { "_id" : ObjectId("60b2c729981080ba1b777e45"), "key" : "configuration", "enabled" : true, "cronTime" : " ", "symbols" : [ "ETHUSDT", "XRPUSDT", "EOSUSDT", "DOTUSDT", "LINKUSDT", "ETCUSDT", "LTCUSDT", "ZECUSDT", "BAKEUSDT", "UNIUSDT", "THETAUSDT", "BCHUSDT", "FILUSDT", "XLMUSDT", "SOLUSDT", "XMRUSDT", "AAVEUSDT", "DASHUSDT", "SUSHIUSDT", "ATOMUSDT", "RUNEUSDT", "TRXUSDT", "VETUSDT", "ADAUSDT", "ONTUSDT", "NEOUSDT", "BNBUSDT", "ALGOUSDT", "TROYUSDT", "WRXUSDT", "FIROUSDT", "PUNDIXUSDT", "WAVESUSDT", "LUNAUSDT", "KSMUSDT", "REEFUSDT", "PNTUSDT", "BLZUSDT", "LITUSDT", "CFXUSDT", "BELUSDT", "UNFIUSDT", "EPSUSDT", "RENUSDT", "BADGERUSDT", "KAVAUSDT", "PERPUSDT", "KNCUSDT", "GXSUSDT", "TKOUSDT", "NANOUSDT", "1INCHUSDT", "XTZUSDT", "ZILUSDT", "CAKEUSDT", "TFUELUSDT", "CTSIUSDT", "FORTHUSDT", "CHZUSDT", "SANDUSDT", "COMPUSDT", "ENJUSDT", "YFIUSDT", "MATICUSDT", "BTTUSDT", "MINAUSDT", "AUDIOUSDT", "SUPERUSDT", "AVAXUSDT", "DOGEUSDT" ], "candles" : { "interval" : "4h", "limit" : 50 }, "buy" : { "enabled" : true, "lastBuyPriceRemoveThreshold" : -1, "lastBuyPriceRemoveThresholds" : { "USDT" : 10 }, "athRestriction" : { "enabled" : true, "candles" : { "interval" : "1d", "limit" : 50 }, "restrictionPercentage" : 0.8 }, "gridTrade" : [ { "triggerPercentage" : 1, "stopPercentage" : 1.01, "limitPercentage" : 1.02, "maxPurchaseAmount" : -1, "maxPurchaseAmounts" : { "USDT" : 100, "BTC" : 0.001 } }, { "triggerPercentage" : 0.9, "stopPercentage" : 1.01, "limitPercentage" : 1.02, "maxPurchaseAmount" : -1, "maxPurchaseAmounts" : { "USDT" : 120, "BTC" : 0.001 } } ], "maxPurchaseAmount" : -1 }, "sell" : { "enabled" : true, "stopLoss" : { "enabled" : true, "maxLossPercentage" : 0.7495, "disableBuyMinutes" : 120, "orderType" : "market" }, "gridTrade" : [ { "triggerPercentage" : 1.1, "stopPercentage" : 0.99, "limitPercentage" : 0.98, "quantityPercentage" : -1, "quantityPercentages" : { "USDT" : 1 } } ] }, "system" : { "temporaryDisableActionAfterConfirmingOrder" : 20, "checkManualBuyOrderPeriod" : 5, "refreshAccountInfoPeriod" : 1, "placeManualOrderInterval" : 5, "checkOrderExecutePeriod" : 10, "checkManualOrderPeriod" : 5 }, "botOptions" : { "authentication" : { "lockList" : true, "lockAfter" : 600 }, "autoTriggerBuy" : { "enabled" : false, "triggerAfter" : 20 } } }

  1. 127.0.0.1:6379> HGET trailing-trade-configurations global "{\"_id\":\"60b2c729981080ba1b777e45\",\"key\":\"configuration\",\"enabled\":true,\"cronTime\":\" \",\"symbols\":[\"ETHUSDT\",\"XRPUSDT\",\"EOSUSDT\",\"DOTUSDT\",\"LINKUSDT\",\"ETCUSDT\",\"LTCUSDT\",\"ZECUSDT\",\"BAKEUSDT\",\"UNIUSDT\",\"THETAUSDT\",\"BCHUSDT\",\"FILUSDT\",\"XLMUSDT\",\"SOLUSDT\",\"XMRUSDT\",\"AAVEUSDT\",\"DASHUSDT\",\"SUSHIUSDT\",\"ATOMUSDT\",\"RUNEUSDT\",\"TRXUSDT\",\"VETUSDT\",\"ADAUSDT\",\"ONTUSDT\",\"NEOUSDT\",\"BNBUSDT\",\"ALGOUSDT\",\"TROYUSDT\",\"WRXUSDT\",\"FIROUSDT\",\"PUNDIXUSDT\",\"WAVESUSDT\",\"LUNAUSDT\",\"KSMUSDT\",\"REEFUSDT\",\"PNTUSDT\",\"BLZUSDT\",\"LITUSDT\",\"CFXUSDT\",\"BELUSDT\",\"UNFIUSDT\",\"EPSUSDT\",\"RENUSDT\",\"BADGERUSDT\",\"KAVAUSDT\",\"PERPUSDT\",\"KNCUSDT\",\"GXSUSDT\",\"TKOUSDT\",\"NANOUSDT\",\"1INCHUSDT\",\"XTZUSDT\",\"ZILUSDT\",\"CAKEUSDT\",\"TFUELUSDT\",\"CTSIUSDT\",\"FORTHUSDT\",\"CHZUSDT\",\"SANDUSDT\",\"COMPUSDT\",\"ENJUSDT\",\"YFIUSDT\",\"MATICUSDT\",\"BTTUSDT\",\"MINAUSDT\",\"AUDIOUSDT\",\"SUPERUSDT\",\"AVAXUSDT\",\"DOGEUSDT\"],\"candles\":{\"interval\":\"4h\",\"limit\":50},\"buy\":{\"enabled\":true,\"lastBuyPriceRemoveThreshold\":-1,\"lastBuyPriceRemoveThresholds\":{\"USDT\":10},\"athRestriction\":{\"enabled\":true,\"candles\":{\"interval\":\"1d\",\"limit\":50},\"restrictionPercentage\":0.8},\"gridTrade\":[{\"triggerPercentage\":1,\"stopPercentage\":1.01,\"limitPercentage\":1.02,\"maxPurchaseAmount\":-1,\"maxPurchaseAmounts\":{\"USDT\":100,\"BTC\":0.001}},{\"triggerPercentage\":0.9,\"stopPercentage\":1.01,\"limitPercentage\":1.02,\"maxPurchaseAmount\":-1,\"maxPurchaseAmounts\":{\"USDT\":120,\"BTC\":0.001}}],\"maxPurchaseAmount\":-1},\"sell\":{\"enabled\":true,\"stopLoss\":{\"enabled\":true,\"maxLossPercentage\":0.7495,\"disableBuyMinutes\":120,\"orderType\":\"market\"},\"gridTrade\":[{\"triggerPercentage\":1.1,\"stopPercentage\":0.99,\"limitPercentage\":0.98,\"quantityPercentage\":-1,\"quantityPercentages\":{\"USDT\":1}}]},\"system\":{\"temporaryDisableActionAfterConfirmingOrder\":20,\"checkManualBuyOrderPeriod\":5,\"refreshAccountInfoPeriod\":1,\"placeManualOrderInterval\":5,\"checkOrderExecutePeriod\":10,\"checkManualOrderPeriod\":5},\"botOptions\":{\"authentication\":{\"lockList\":true,\"lockAfter\":600},\"autoTriggerBuy\":{\"enabled\":false,\"triggerAfter\":20}}}"

chrisleekr commented 3 years ago

@VSofter Global configuration looks ok.

Can I see symbol information in the WebSocket?

Your first snippet does not include stats -> symbols. Please paste the whole JSON.

image

VSofter commented 3 years ago

@VSofter Global configuration looks ok.

Can I see symbol information in the WebSocket?

Your first snippet does not include stats -> symbols. Please paste the whole JSON.

image

Whole JSON is too large and it doesn't fit into github limitations :-)

First symbol (of 50+):

0: {symbol: "REEFUSDT", isLocked: false,…} accountInfo: {makerCommission: 10, takerCommission: 10, buyerCommission: 0, sellerCommission: 0, canTrade: true,…} action: "not-determined" baseAssetBalance: {asset: "REEF", free: 0, locked: 0, total: 0, estimatedValue: 0,…} buy: {currentPrice: 0.0284, limitPrice: 0.028968, highestPrice: 0.0295, lowestPrice: 0.02262,…} featureToggle: {notifyOrderConfirm: true, notifyDebug: false, notifyOrderExecute: true} indicators: {highestPrice: 0.0295, lowestPrice: 0.02262, athPrice: 0.0295} isActionDisabled: {isDisabled: false, ttl: -2} isLocked: false lastCandle: {eventType: "kline", eventTime: 1630877020771, symbol: "REEFUSDT", startTime: 1630876980000,…} openOrders: [] order: {} quoteAssetBalance: {asset: "USDT", free: "299.15971203", locked: "0.00000000"} saveToCache: true sell: {currentPrice: 0.0284, limitPrice: null, lastBuyPrice: null, triggerPrice: null, difference: null,…} symbol: "REEFUSDT" symbolConfiguration: {_id: "60b2c729981080ba1b777e45", key: "configuration", enabled: true, cronTime: " ",…} symbolInfo: {symbol: "REEFUSDT", status: "TRADING", baseAsset: "REEF", baseAssetPrecision: 8, quoteAsset: "USDT",…}

Is that enough?

chrisleekr commented 3 years ago

@VSofter No, I will need to see the whole JSON. Try to use https://gist.github.com/ you can remove it later.

VSofter commented 3 years ago

@chrisleekr , alright, here you go: https://gist.github.com/VSofter/3613fe04274c88542fec9fcd07b2cf98

chrisleekr commented 3 years ago

@VSofter Ok, in your case, the issue is SHIBUSDT did not return the data properly. I assume this is happening because it is not included in the global configuration symbol list.

The below is the symbol configuration of SHIBUSDT from your snippet, which has the wrong format.

"symbolConfiguration": {
         ...
          "buy": {
            "enabled": true,
            "maxPurchaseAmount": 40,
            "triggerPercentage": 1.05,
            "stopPercentage": 1.02,
            "limitPercentage": 1.025,
            "lastBuyPriceRemoveThreshold": 10,
            "athRestriction": {
              "enabled": true,
              "candles": { "interval": "1d", "limit": 50 },
              "restrictionPercentage": 0.75
            }
          },
          "sell": {
            "enabled": true,
            "triggerPercentage": 1.1,
            "stopPercentage": 0.985,
            "limitPercentage": 0.975,
            "stopLoss": { "enabled": false, "maxLossPercentage": 0.7, "disableBuyMinutes": 120, "orderType": "market" }
          },
          "system": {
            "temporaryDisableActionAfterConfirmingOrder": 20,
            "checkManualBuyOrderPeriod": 5,
            "refreshAccountInfoPeriod": 1,
            "placeManualOrderInterval": 5
          }
        },

Can you try to flush the Redis cache?

 $ docker exec -it binance-redis /bin/bash
# redis-cli
127.0.0.1:6379> AUTH <redis password>
OK
127.0.0.1:6379> FLUSHALL
OK
127.0.0.1:6379> 
VSofter commented 3 years ago

@VSofter Ok, in your case, the issue is SHIBUSDT did not return the data properly. I assume this is happening because it is not included in the global configuration symbol list.

The below is the symbol configuration of SHIBUSDT from your snippet, which has the wrong format.

"symbolConfiguration": {
         ...
          "buy": {
            "enabled": true,
            "maxPurchaseAmount": 40,
            "triggerPercentage": 1.05,
            "stopPercentage": 1.02,
            "limitPercentage": 1.025,
            "lastBuyPriceRemoveThreshold": 10,
            "athRestriction": {
              "enabled": true,
              "candles": { "interval": "1d", "limit": 50 },
              "restrictionPercentage": 0.75
            }
          },
          "sell": {
            "enabled": true,
            "triggerPercentage": 1.1,
            "stopPercentage": 0.985,
            "limitPercentage": 0.975,
            "stopLoss": { "enabled": false, "maxLossPercentage": 0.7, "disableBuyMinutes": 120, "orderType": "market" }
          },
          "system": {
            "temporaryDisableActionAfterConfirmingOrder": 20,
            "checkManualBuyOrderPeriod": 5,
            "refreshAccountInfoPeriod": 1,
            "placeManualOrderInterval": 5
          }
        },

Can you try to flush the Redis cache?

 $ docker exec -it binance-redis /bin/bash
# redis-cli
127.0.0.1:6379> AUTH <redis password>
OK
127.0.0.1:6379> FLUSHALL
OK
127.0.0.1:6379> 

@chrisleekr , tried to flush cache and then restarting docker-compose container. No go. This exact configuration worked flawlessly with .77. How can I include SHIBUSDT to global configuration manually (or any other workaround)?

starush commented 3 years ago

With great help of user clearin at Discord, I have managed to solve this issue. My mistake was that I always upgraded just by using docker-compose -f docker-compose.server.yml pull and never used git pull firstly, so my docker-composer.server.yml (and other .yml files as well) file became too old.

I am not sure that it was the only real reason but when I did git pull firstly, then docker pull, the problem was eliminated.

vuongductuanktmt commented 3 years ago

I also got stuck and couldn't access the dashboard but after resetting rpi4 everything is solved.

VSofter commented 3 years ago

Nothing helped me yet: neither reboot, nor git pull. My running configuration is Ubuntu 20.04 LTS/8 cores/16 GB. There is enough free disk space available.

@chrisleekr , so I will be waiting for a solution, thanks.

VSofter commented 3 years ago

@chrisleekr, just to inform you, I've added SHIBUSDT to 'trailing-trade-common' collection manually and got back my dashboard afterwards.

Still not sure though, how had it happened to my installation after update (it never happened before). Probably, really a bug between .77 --> .78.

It could be useful if future versions were able to check global configuration automatically :-)

chrisleekr commented 3 years ago

@VSofter

Technically, it shouldn't work previously with your case because the data was not in the correct format. The code you having an error was changed a month ago.

And if you flush Redis completely, it should've worked, because SHIBUSDT-data shouldn't be returning to the frontend.

Not sure what happened in there as well. Anyhow, good to hear your issue is resolved. :)

Please close the issue.