ZhuLinsen/daily_stock_analysis · error · GenerationError

unsafe_config

unsafe_config

Error message

unsafe_config at configuration for backend {backend}

What it means

Error "unsafe_config at configuration for backend {backend}" thrown in ZhuLinsen/daily_stock_analysis.

Source

Thrown at src/services/generation_backend_status_service.py:368

    ) -> _SmokeRequest:
        config = self._build_backend_config()
        requested_backend = normalize_backend_id(backend_id, default=resolve_generation_backend_id(config))
        if requested_backend not in SUPPORTED_GENERATION_BACKENDS:
            raise GenerationError(
                error_code=GenerationErrorCode.BACKEND_NOT_CONFIGURED,
                stage="configuration",
                retryable=False,
                fallbackable=False,
                backend=requested_backend,
                details={
                    "field": "backend_id",
                    "requested_backend": requested_backend,
                    "supported_backends": sorted(SUPPORTED_GENERATION_BACKENDS),
                },
            )
        normalized_mode = str(mode or "json").strip().lower() or "json"
        if normalized_mode not in {"text", "json"}:
            raise GenerationError(
                error_code=GenerationErrorCode.UNSAFE_CONFIG,
                stage="configuration",
                retryable=False,
                fallbackable=False,
                backend=requested_backend,
                details={"field": "mode", "requested_mode": mode, "supported_modes": ["text", "json"]},
            )
        timeout = _parse_smoke_timeout(timeout_seconds, backend_id=requested_backend)
        return _SmokeRequest(backend_id=requested_backend, mode=normalized_mode, timeout_seconds=timeout)

    def _run_smoke(self, request: _SmokeRequest) -> None:
        config = self.build_effective_config(
            backend_id=request.backend_id,
            timeout_seconds=request.timeout_seconds,
        )
        preflight_error = self._cheap_check_error(request.backend_id, config)
        if preflight_error is not None:
            raise preflight_error

View on GitHub (pinned to 5159bd72e8)

Solutions

  1. Review the backend configuration for unsafe values (non-loopback hosts, embedded credentials, invalid ports) and correct them.
  2. Point BASE_URL at an allowed loopback address such as http://127.0.0.1:PORT/v1 if this is a local backend.
  3. Remove userinfo, query strings, and fragments from the configured URL.

When it happens

Trigger: Thrown at src/services/generation_backend_status_service.py:368 when the library encounters an invalid state.

Common situations: Reported when a generation backend configuration fails the safety checks (non-loopback URL, embedded credentials, etc.); occurs when an unsafe endpoint is configured for that backend.


AI-assisted analysis of ZhuLinsen/daily_stock_analysis@5159bd72e8 (2026-08-15). Data as JSON: /api/errors/8498e26ea38ba189. Report an issue: GitHub.