ZhuLinsen/daily_stock_analysis · error · IntelligenceServiceError

source url must be an absolute http(s) URL

Error message

source url must be an absolute http(s) URL

What it means

Error "source url must be an absolute http(s) URL" thrown in ZhuLinsen/daily_stock_analysis.

Source

Thrown at src/services/intelligence_service.py:397

        if market not in _ALLOWED_MARKETS:
            raise IntelligenceServiceError(f"unsupported market: {market}")
        return {
            "name": name[:100],
            "source_type": source_type,
            "url": url,
            "enabled": enabled,
            "scope_type": scope_type,
            "scope_value": scope_value[:64] if scope_value else None,
            "market": market,
            "description": description,
        }

    def _validate_url(self, raw_url: str, *, allow_no_url: bool = False) -> None:
        if allow_no_url and raw_url.startswith("no-url:intel:"):
            return
        parsed = urlparse(raw_url)
        if parsed.scheme.lower() not in {"http", "https"} or not parsed.netloc:
            raise IntelligenceServiceError("source url must be an absolute http(s) URL")
        if parsed.username or parsed.password:
            raise IntelligenceServiceError("source url must not contain credentials")
        hostname = (parsed.hostname or "").strip().lower().rstrip(".")
        if not hostname:
            raise IntelligenceServiceError("source url host is required")
        if hostname in _PRIVATE_HOSTNAMES or hostname.endswith(".local"):
            raise IntelligenceServiceError("source url host is not allowed")
        has_public_address = False
        try:
            ip = ipaddress.ip_address(hostname)
        except ValueError:
            ip = None
        if ip is not None:
            if self._is_blocked_ip(ip):
                raise IntelligenceServiceError("source url must not target private or local network addresses")
            return
        try:
            addr_infos = socket.getaddrinfo(hostname, None)

View on GitHub (pinned to 5159bd72e8)

Solutions

  1. Provide a full absolute URL starting with http:// or https://.
  2. Remove relative paths or protocol-relative URLs from the source configuration.
  3. Prefer https URLs for feed sources.

When it happens

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

Common situations: Raised when an intelligence source URL is not an absolute http(s) URL; occurs with relative URLs, ftp:// or scheme-less input.


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