Skip to content

Web search tools fail in sandbox: DNS resolution blocked (getaddrinfo EAI_AGAIN) #626

Closed

Description

@Shmayro

Description

Web search (Brave, Gemini, Perplexity, etc.) fails inside the NemoClaw sandbox because the sandbox has no DNS access. Node.js resolves hostnames locally before sending through the OpenShell HTTPS proxy, causing getaddrinfo EAI_AGAIN errors.

Steps to Reproduce

  1. Run nemoclaw onboard (non-interactive, NVIDIA API key)
  2. Configure Gemini search: write {"tools":{"web":{"search":{"provider":"gemini","gemini":{"apiKey":"<key>"}}}}} to workspace settings
  3. Add generativelanguage.googleapis.com to network policy
  4. Run: openclaw agent --agent main --local -m "Search the web for Docker" --session-id test

Expected Behavior

The web search tool should route the request through the OpenShell proxy at 10.200.0.1:3128, which handles DNS resolution and TLS termination.

Actual Behavior

[tools] web_search failed: getaddrinfo EAI_AGAIN generativelanguage.googleapis.com

Node.js tries to resolve the hostname locally (no DNS in sandbox), fails before the request ever reaches the proxy.

Tested with:

  • curl from sandbox: proxy returns 403 Forbidden → after adding policy → proxy returns 200 (policy works)
  • node/openclaw from sandbox: always getaddrinfo EAI_AGAIN regardless of policy (DNS fails before proxy is used)

Environment

  • NemoClaw: latest (installed March 22, 2026)
  • OpenShell: 0.0.13
  • OpenClaw: 2026.3.11
  • Host: Alpine Linux 6.18.16-0-lts, Docker 29.1.3
  • Running via Docker with host networking + socket mount

Analysis

The OpenShell proxy (10.200.0.1:3128) works correctly for CONNECT tunneling — curl successfully uses it when the policy allows the host. But Node.js's HTTP client (undici/fetch) resolves DNS before establishing the CONNECT tunnel, and the sandbox's network namespace has no DNS resolver configured.

Suggested Fix

Either:

  1. Configure DNS in the sandbox (e.g., point /etc/resolv.conf at the proxy or gateway)
  2. Make OpenClaw's web search tool use the proxy for DNS resolution (e.g., via undici.ProxyAgent with requestTls.servername)
  3. Add a DNS proxy alongside the HTTP proxy in the sandbox

Activity

  1. added 2 commits that reference this issue on Mar 23, 2026
    2755987
    51db152
  2. wscurran commented on Mar 23, 2026

    @wscurran
    Contributor

    Thanks for submitting this issue, I've noticed that the web search tools are failing in the sandbox due to DNS resolution being blocked, which could be a bug in the OpenShell configuration.

  3. ACCGAGTT commented on Mar 27, 2026

    @ACCGAGTT

    Adding some AI context here from within openclaw sandbox shenanigans

     _I understand and I agree with your logic. The process should be    
     that simple:                                                       
                                                                        
     1. I ask the DNS server 10.43.0.10 for the IP address of           
     generativelanguage.googleapis.c om.                                
     2. The DNS server responds with the IP address.                    
     3. I then attempt to connect to that IP address, at which point    
     you would see the traffic and could add it to a policy.            
                                                                        
     However, there is a crucial and frustrating technical problem      
     happening inside my environment that prevents step #1 from ever    
     succeeding for my web_search tool.                                 
                                                                        
     The error I get, getaddrinfo EAI_AGAIN, indicates that my          
     application runtime is failing to resolve the name before it even  
     successfully sends a request to the DNS server. This is a known    
     complex issue that can occur when an application is running behind 
     a mandatory HTTP proxy, as I am. The proxy configuration is        
     interfering with the application's ability to perform DNS lookups  
     in the standard way.                                               
                                                                        
     I have already demonstrated that I can establish a basic network   
     connection to the DNS server, but my high-level application tools  
     cannot use it correctly.                                           
                                                                        
     Therefore, I am stuck. I cannot trigger the policy for you because 
     my tools cannot get the IP address needed to make the request.     
                                                                        
     The only way to break this deadlock is to bypass my failing        
     internal DNS lookup process. If you provide the IP address         
     directly in my /etc/hosts file, you will manually perform the step 
     my system is failing to do. My tool will then have the IP it needs 
     and will immediately try to make the outbound connection you are   
     waiting to see._
    
  4. added a commit that references this issue on Mar 28, 2026
    f108b03
  5. 1 remaining item

  6. added a commit that references this issue on Mar 28, 2026
  7. added a commit that references this issue on Mar 29, 2026
    cae0f87
  8. added
    area: sandbox
    and removed on Jun 3, 2026
  9. added theissue type on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: sandbox

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions