HKUDS/Vibe-Trading · error · Trading212ConfigError
Trading 212 connector not configured: missing {', '.join(mis
Error message
Trading 212 connector not configured: missing {', '.join(missing)}. What it means
Raised by _request when the supplied Trading212Config is missing required fields (as computed by _missing_fields), meaning the connector has not been fully configured before an API call. Every HTTP helper (_get and everything above it) checks this before touching the network.
Source
Thrown at agent/src/trading/connectors/trading212/sdk.py:408
return _order_refused(cfg, _ORDER_DISABLED_ERROR, order_id=order_id, symbol=symbol)
def _get(config: Trading212Config, path: str, *, params: Mapping[str, Any] | None = None) -> Any:
"""Perform a read-only GET request against the Trading 212 REST API."""
return _request(config, "GET", path, params=params)
def _request(
config: Trading212Config,
method: str,
path: str,
*,
params: Mapping[str, Any] | None = None,
) -> Any:
"""Run an HTTP request and normalize Trading 212 failure modes."""
missing = _missing_fields(config)
if missing:
raise Trading212ConfigError(f"Trading 212 connector not configured: missing {', '.join(missing)}.")
url = urljoin(f"{config.base_url.rstrip('/')}/", path.lstrip("/"))
headers = {"Accept": "application/json"}
auth = None
if config.api_secret:
auth = (config.api_key, config.api_secret)
else:
headers["Authorization"] = config.api_key
try:
response = requests.request(
method.upper(),
url,
headers=headers,
auth=auth,
params=dict(params or {}),
timeout=config.timeout,
)
except requests.RequestException as exc:View on GitHub (pinned to 80ffdda44c)
Solutions
- Run the connector setup (check_status/build_config flow) and provide the required fields (typically api_key and base_url) via save_config
- If a config file exists, verify it isn't being parsed into an empty config (see error 1310)
- In code, check _missing_fields(config) or config completeness before calling API helpers
Example fix
# before
config = load_config()
positions = get_positions(config) # raises if unconfigured
# after
missing = _missing_fields(config)
if missing:
... # run setup / prompt user
positions = get_positions(config) Defensive patterns
Strategy: validation
Validate before calling
from trading.connectors.trading212.sdk import _missing_fields, load_config
config = load_config()
missing = _missing_fields(config)
if missing:
raise SystemExit(f"finish connector setup first; missing: {missing}") Type guard
from typing import Any
from trading.connectors.trading212.sdk import _missing_fields, Trading212Config
def is_configured(config: Trading212Config) -> bool:
return not _missing_fields(config) Try / catch
try:
data = get_positions(config)
except Trading212ConfigError as exc:
if "not configured" in str(exc):
... # route user to setup flow
raise Prevention
- Call check_status() at app startup and surface missing fields to the user
- Gate API calls behind an is_configured check in UI/tests
- Fail fast in CI with a clear message instead of hitting API helpers
When it happens
Trigger: Calling any endpoint helper (e.g. get_positions, get_account_snapshot) with a config where required fields such as api_key/base_url are empty — typically when load_config returned the default empty Trading212Config because no config file exists, or save_config was never called.
Common situations: Fresh install with no configuration step run; config file deleted or never created; test environment asserting on API calls without setting config; CI running integration code paths without credentials.
Related errors
- profile must be 'paper', 'live-readonly' or 'live'
- base_url must start with http:// or https://
- invalid Trading 212 config at {path}: {exc}
- Feishu QR login requires a JSON agent config; use ~/.vibe-tr
- agent config 'channels' must be an object
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/e083b1c0f38dbe45.
Report an issue: GitHub.