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

Config Generator - Getting ValueError: If using all scalar values, you must pass an index #51

Open
rapcmia opened this issue Jun 26, 2024 · 3 comments
Labels
bug Something isn't working config generator

Comments

@rapcmia
Copy link
Contributor

rapcmia commented Jun 26, 2024

Describe the bug

When testing a PR and compare with the latest deploy version, found this error when setting up a market on kucoin and binance

image

# dashboard logs
2024-06-26 12:36:04.033 Uncaught app exception
Traceback (most recent call last):
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 584, in _run_script
    exec(code, module.__dict__)
  File "/home/dashboard/frontend/pages/config/pmm_dynamic/app.py", line 40, in <module>
    candles = get_candles(connector_name=inputs["candles_connector"], trading_pair=inputs["candles_trading_pair"], interval=inputs["interval"], days=days_to_visualize)
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 168, in wrapper
    return cached_func(*args, **kwargs)
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 197, in __call__
    return self._get_or_create_cached_value(args, kwargs)
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 224, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 280, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
  File "/home/dashboard/frontend/pages/config/utils.py", line 23, in get_candles
    df = pd.DataFrame(backend_client.get_historical_candles(connector_name, trading_pair, interval,
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/pandas/core/frame.py", line 778, in __init__
    mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/pandas/core/internals/construction.py", line 503, in dict_to_mgr
    return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy)
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/pandas/core/internals/construction.py", line 114, in arrays_to_mgr
    index = _extract_index(arrays)
  File "/opt/conda/envs/dashboard/lib/python3.10/site-packages/pandas/core/internals/construction.py", line 667, in _extract_index
    raise ValueError("If using all scalar values, you must pass an index")
ValueError: If using all scalar values, you must pass an index
# backend logs
INFO:     192.168.0.3:33054 - "GET /is-docker-running HTTP/1.1" 200 OK
INFO:     192.168.0.3:33056 - "GET /all-controller-configs HTTP/1.1" 200 OK
2024-06-26 12:36:04,025 - asyncio - ERROR - Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0xffff7c352590>
2024-06-26 12:36:04,026 - asyncio - ERROR - Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0xffff7c358760>, 6730.242969143)]']
connector: <aiohttp.connector.TCPConnector object at 0xffff7c353d90>
INFO:     192.168.0.3:33062 - "POST /historical-candles HTTP/1.1" 200 OK

Check traceback seems to be pointing to historical candles. Tried to check if we can reproduce using data and MACD_BB V1
image

Steps to reproduce bug

  1. Clone latest deploy version then setup bash setup.sh
  2. Go to Dashboard page
  3. Go to Config Generator then PMM Dynamic (on this test we used kucoin XCAD-USDT, binance FIRO-USDT) then observe error on setup
  4. Go to data then download candles for the same market and it would return same error
@rapcmia rapcmia added bug Something isn't working config generator labels Jun 26, 2024
@Christopher-Reilly
Copy link

Yes I am getting this error as well anytime I try to load candlestick charts both on hummingbot deploy and dashboard/backend-api/hummingbot repos. Following.
Screenshot 2024-07-01 at 1 54 31 PM

@rapcmia
Copy link
Contributor Author

rapcmia commented Nov 11, 2024

When testing PR today, found this issue reproduced on grid_strike controller config's default value
image

Dashboard logs:

2024-11-11 13:41:47.477 Uncaught app exception
Traceback (most recent call last):
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 584, in _run_script
    exec(code, module.__dict__)
  File "/home/rapcmia/github/hummingbot/dashboard/190/frontend/pages/config/grid_strike/app.py", line 63, in <module>
    candles = get_candles(
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 168, in wrapper
    return cached_func(*args, **kwargs)
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 197, in __call__
    return self._get_or_create_cached_value(args, kwargs)
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 224, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 280, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
  File "/home/rapcmia/github/hummingbot/dashboard/190/frontend/pages/config/utils.py", line 22, in get_candles
    df = pd.DataFrame(backend_client.get_historical_candles(connector_name, trading_pair, interval,
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/pandas/core/frame.py", line 778, in __init__
    mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/pandas/core/internals/construction.py", line 503, in dict_to_mgr
    return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy)
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/pandas/core/internals/construction.py", line 114, in arrays_to_mgr
    index = _extract_index(arrays)
  File "/home/rapcmia/miniconda3/envs/dashboard/lib/python3.10/site-packages/pandas/core/internals/construction.py", line 667, in _extract_index
    raise ValueError("If using all scalar values, you must pass an index")
ValueError: If using all scalar values, you must pass an index

Note: When changed connector like OKX or Kucoin, seems to fix itself. Only happens on binance for grid-strike co

Steps to reproduce:

  • Setup dashboard/backendapi source or docker build
  • Also you can run setup deploy and load dashboard
  • Go to Config Generator -> Grid Strike

@rapcmia rapcmia changed the title PMM Dynamic - Getting ValueError: If using all scalar values, you must pass an index Config Generator - Getting ValueError: If using all scalar values, you must pass an index Nov 11, 2024
@rapcmia
Copy link
Contributor Author

rapcmia commented Dec 6, 2024

As per discussed with dev team, this error commonly happens when it takes time to load or fetch historical candles from the selected exchange. Observed this happened Hyperliquid's HYPEUSDC using GS controller, we let dashboard (config generator) to load the candles of the selected market by waiting for couple of minutes and able to create controller successfully.

Ticket will remain open until we found a fix for this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working config generator
Projects
None yet
Development

No branches or pull requests

2 participants