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

Invalid JSON Structure in bots/data/account_state_history.json (e.g "End of file expected.json") #76

Open
sultanmyrza opened this issue Dec 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sultanmyrza
Copy link

Describe the bug

Description

The account_state_history.json file generated in the bots/data directory lacks a parent key to wrap the data, resulting in an invalid JSON structure. This issue might prevent seamless parsing and usage of the file in downstream processes that expect valid JSON formatting.

While this issue doesn't affect core functionality, fixing it might improve the file's compatibility with other tools and future integrations.

Below is an example of the current output:

{"timestamp": "2024-12-28T07:01:24.573523", "state": {"master_account": {"binance": [...omitted for brevity...]}}}
{"timestamp": "2024-12-28T07:01:24.574862", "state": {"master_account": {"binance": [...omitted for brevity...]}}}
{"timestamp": "2024-12-28T07:01:24.575405", "state": {"master_account": {"binance": [...omitted for brevity...]}}}

Expected Behavior

The JSON file could follow standard formatting by wrapping the data in a parent key (e.g., account_history, snapshots, or data):

{
  "account_history": [
    {"timestamp": "2024-12-28T07:01:24.573523", "state": {"master_account": {"binance": [...omitted for brevity...]}}},
    {"timestamp": "2024-12-28T07:01:24.574862", "state": {"master_account": {"binance": [...omitted for brevity...]}}},
    {"timestamp": "2024-12-28T07:01:24.575405", "state": {"master_account": {"binance": [...omitted for brevity...]}}},
  ]
}

Environment

  • Hummingbot Dashboard Version: [v2.1.0]
  • Operating System: [macOS 15.1]

Additional Notes

While the data content in account_state_history.json is correct, the JSON structure itself is not valid JSON. This issue could be addressed to ensure better interoperability with other tools and systems that expect standard JSON formatting. This is not a critical bug and does not impact core functionality.

Steps to reproduce bug

Steps to Reproduce

  1. Configure Binance credentials by entering API key and secret at http://localhost:8501/Credentials
  2. Wait for the system to generate the account_state_history.json file in the bots/data directory
  3. Open the generated file
  4. Notice that each JSON object is written as a separate line without a parent key or array structure, resulting in invalid JSON formatting
Screenshot 2024-12-28 at 3 47 59 PM
@sultanmyrza sultanmyrza added the bug Something isn't working label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant