Config Generator - Getting ValueError: If using all scalar values, you must pass an index
Opened this issue · 3 comments
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
# 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
Steps to reproduce bug
- Clone latest deploy version then setup
bash setup.sh
- Go to Dashboard page
- Go to Config Generator then PMM Dynamic (on this test we used kucoin XCAD-USDT, binance FIRO-USDT) then observe error on setup
- Go to data then download candles for the same market and it would return same error
When testing PR today, found this issue reproduced on grid_strike controller config's default value
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
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