Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ITBIT: pair config format is nil #1462

Open
kunallimaye opened this issue Jan 31, 2024 · 3 comments
Open

Error: ITBIT: pair config format is nil #1462

kunallimaye opened this issue Jan 31, 2024 · 3 comments

Comments

@kunallimaye
Copy link

New Issue

Starting gocryptotrader with default config fails on the second attempt.
First attempt is successful - stop the service using Ctrl+C. And the next attempt to start fails with the following error:

Error: ITBIT: pair config format is nil

Context

OS GoCryptoTrader version
macOS Sonoma Version 14.3 GoCryptoTrader v0.1 arm64 go1.21.6 pre-release

Expected Behavior

Second attempt to start the bot/service should be successful

Current Behavior

What is the current behavior?

Failure Information (for bugs)

❯ gocryptotrader 

   ______        ______                     __        ______                  __
  / ____/____   / ____/_____ __  __ ____   / /_ ____ /_  __/_____ ______ ____/ /___   _____
 / / __ / __ \ / /    / ___// / / // __ \ / __// __ \ / /  / ___// __  // __  // _ \ / ___/
/ /_/ // /_/ // /___ / /   / /_/ // /_/ // /_ / /_/ // /  / /   / /_/ // /_/ //  __// /
\____/ \____/ \____//_/    \__, // .___/ \__/ \____//_/  /_/    \__,_/ \__,_/ \___//_/
                          /____//_/
GoCryptoTrader v0.1 arm64 go1.21.6 pre-release.
This version is pre-release and is not intended to be used as a production ready trading framework or bot - use at your own risk.
Copyright (c) 2014-2024 The GoCryptoTrader Developers.

GitHub: https://github.com/thrasher-corp/gocryptotrader
Trello: https://trello.com/b/ZAhMhpOy/gocryptotrader
Slack:  https://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk
Issues: https://github.com/thrasher-corp/gocryptotrader/issues

2024/01/31 13:41:03 Loading config file /Users/someuser/.gocryptotrader/config.json..
2024/01/31 13:41:03 Unable to initialise bot engine. Error: failed to load config. Err: fatal error checking config values. Error: ITBIT: pair config format is nil

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Start the service first time
    # Copy the config file
    cp config_example.json ~/.gocryptotrader/config.json
    ./gocryptotrader
  2. Stop the service by pressing Ctrl+C
  3. Starting the server second time fails
    # reuse the previously created config file
    ./gocryptotrader
@kunallimaye
Copy link
Author

It seems like requestFormat and configFormat is missing for ITBIT exchange when the config is saved during step (2)?

@kunallimaye
Copy link
Author

Yeah the default currencyPairs config for ITBIT exchange is:

   "currencyPairs": {
    "bypassConfigFormatUpgrades": false,
    "requestFormat": {
     "uppercase": true
    },
    "configFormat": {
     "uppercase": true
    },
    "useGlobalFormat": true,
    "lastUpdated": 1591062026,
    "pairs": {
     "spot": {
      "assetEnabled": null,
      "enabled": "XBTUSD,XBTSGD",
      "available": "XBTUSD,XBTSGD"
     }
    }
   },

And requestFormat and configFormat go missing after the config file is saved during shutdown. Config after shutdown:

   "currencyPairs": {
    "bypassConfigFormatUpgrades": false,
    "lastUpdated": 1591062026,
    "pairs": {
     "spot": {
      "assetEnabled": true,
      "enabled": "XBTUSD,XBTSGD",
      "available": "XBTUSD,XBTSGD"
     }
    }
   },

@thrasher-
Copy link
Collaborator

thrasher- commented Jan 31, 2024

Thanks for reporting this. Will get a proper fix for this shortly but for now you can edit the config for Itbit as follows:

   "currencyPairs": {
    "bypassConfigFormatUpgrades": false,
    "lastUpdated": 1591062026,
    "requestFormat": {
     "uppercase": true
    },
    "configFormat": {
     "uppercase": true,
     "delimiter": "-"
    },
    "useGlobalFormat": true,
    "pairs": {
     "spot": {
      "assetEnabled": true,
      "enabled": "XBT-USD,XBT-SGD",
      "available": "XBT-USD,XBT-SGD"
     }
    }
   },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants