Fosowl/agenticSeek · error · NetworkError

Network error occurred. Check your internet connection.

Error message

Network error occurred. Check your internet connection.

What it means

dsk_deepseek catches dsk's NetworkError and re-raises it with a fixed message telling the developer to check their internet connection. It means a socket/DNS/timeout-level failure occurred while talking to the free DeepSeek endpoint, before any API-level response was received.

Source

Thrown at sources/llm_provider.py:504

        )
        thought = ""
        message = '\n---\n'.join([f"{msg['role']}: {msg['content']}" for msg in history])

        try:
            api = DeepSeekAPI(self.api_key)
            chat_id = api.create_chat_session()
            for chunk in api.chat_completion(chat_id, message):
                if chunk['type'] == 'text':
                    thought += chunk['content']
            return thought
        except AuthenticationError as e:
            raise AuthenticationError("Authentication failed. Please check your token.") from e
        except RateLimitError as e:
            raise RateLimitError("Rate limit exceeded. Please wait before making more requests.") from e
        except CloudflareError as e:
            raise CloudflareError(f"Cloudflare protection encountered: {str(e)}") from e
        except NetworkError as e:
            raise NetworkError("Network error occurred. Check your internet connection.") from e
        except APIError as e:
            raise APIError(f"API error occurred: {str(e)}") from e
        return None

    def litellm_fn(self, history, verbose=False):
        """
        Use LiteLLM AI gateway for completion.
        Routes to 100+ providers (OpenAI, Anthropic, Azure, Bedrock,
        Vertex AI, Groq, Together, Ollama, etc.) based on model prefix.
        See https://docs.litellm.ai/docs/providers
        """
        try:
            import litellm
        except ImportError as e:
            raise ImportError("litellm is not installed. Install with: pip install litellm") from e

        if self.is_local:
            raise Exception("LiteLLM is not available for local use. Change config.ini")

View on GitHub (pinned to ae57a23577)

Solutions

  1. Verify general connectivity (curl https://chat.deepseek.com) and DNS resolution
  2. Check proxy/VPN/firewall settings and required HTTPS_PROXY env vars
  3. Retry with backoff — transient network blips during streaming are common
  4. Fall back to another provider backend (litellm_fn, etc.) in config.ini
Defensive patterns

Strategy: retry

Validate before calling

import socket
try:
    socket.create_connection(('chat.deepseek.com', 443), timeout=5)
except OSError:
    raise RuntimeError('No connectivity to DeepSeek endpoint')

Type guard

def is_network_error(e: BaseException) -> bool:
    return isinstance(e, NetworkError)

Try / catch

import time
for attempt in range(3):
    try:
        thought = provider.dsk_deepseek(history)
        break
    except NetworkError:
        if attempt == 2:
            raise
        time.sleep(2 ** attempt)

Prevention

When it happens

Trigger: Calling LLMProvider.dsk_deepseek(history) when the underlying dsk API raises NetworkError during session creation or streaming chat_completion — DNS failure, connection refused/reset, TLS error, or read timeout.

Common situations: Offline machine or flaky Wi-Fi; corporate proxy/firewall blocking chat.deepseek.com; DNS misconfiguration; long streaming responses exceeding timeouts on unstable connections.

Related errors


AI-assisted analysis of Fosowl/agenticSeek@ae57a23577 (2026-08-30). Data as JSON: /api/errors/3fad350bb10302b1. Report an issue: GitHub.