ZhuLinsen/daily_stock_analysis · error · IntelligenceServiceError
source url host DNS resolution failed: {hostname}
Error message
source url host DNS resolution failed: {hostname} What it means
Error "source url host DNS resolution failed: {hostname}" thrown in ZhuLinsen/daily_stock_analysis.
Source
Thrown at src/services/intelligence_service.py:417
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)
except OSError as exc:
raise IntelligenceServiceError(f"source url host DNS resolution failed: {hostname}") from exc
if not addr_infos:
raise IntelligenceServiceError(f"source url host DNS resolution failed: {hostname}")
for info in addr_infos:
try:
ip = ipaddress.ip_address(info[4][0])
except (IndexError, ValueError):
continue
if self._is_blocked_ip(ip):
raise IntelligenceServiceError("source url must not target private or local network addresses")
has_public_address = True
if not has_public_address:
raise IntelligenceServiceError(f"source url host DNS resolution failed: {hostname}")
@staticmethod
def _is_blocked_ip(ip: ipaddress._BaseAddress) -> bool:
return (
not ip.is_global
or ip.is_privateView on GitHub (pinned to 5159bd72e8)
Solutions
- Check the hostname for typos and that DNS resolution works from the host.
- Verify network/DNS configuration on the machine running the service.
- Retry later if the upstream DNS is temporarily failing; otherwise replace the source.
When it happens
Trigger: Thrown at src/services/intelligence_service.py:417 when the library encounters an invalid state.
Common situations: Raised when DNS resolution of the intelligence source host fails; occurs with non-existent domains or DNS outages during source validation.
Understand the failure class
- DNS resolution errors: ENOTFOUND and getaddrinfo failures — how hostname lookups fail and how to debug them.
AI-assisted analysis of ZhuLinsen/daily_stock_analysis@5159bd72e8 (2026-08-15).
Data as JSON: /api/errors/38f36a79382e8b91.
Report an issue: GitHub.