openclaw - 💡(How to fix) Fix [Bug]: CLI and WebUI silent failure/hang when calling Gemini via HTTP proxy (v2026.4.21) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70453Fetched 2026-04-24 05:57:55
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
1
Participants
Timeline (top)
labeled ×2

Setting http_proxy environment variables to bypass a local Fake IP SSRF block causes OpenClaw's CLI and WebUI to silently hang and fail without returning any errors when querying Gemini models.

Error Message

2.If the request fails for any reason (e.g., proxy connection refused, timeout, or an upstream API error), OpenClaw should not fail silently. It must surface an explicit, descriptive error message to the CLI and WebUI to inform the user of the exact failure. There is absolutely no response generated from the Gemini model, and the interface simply hangs or terminates without surfacing any explicit error messages (such as network timeouts, HTTP 400/500 codes, or connection refused warnings). In the background logs, the agent appears to quit quietly (sometimes leaving a brief warn agent/embedded embedded run agent end trace), but the user is left completely unaware of the underlying failure.

Root Cause

  • Affected users/systems/channels: Users running OpenClaw on Linux environments with transparent proxies (specifically those utilizing Fake IP/tproxy setups). Affects both CLI and WebUI channels.
  • Severity: Blocks workflow. The core functionality of the agent is completely inaccessible because the request cycle cannot be completed.
  • Frequency: Always. The issue occurs consistently every time the Gemini API is called while the HTTP proxy environment variables are active.
  • Consequence: Total service failure for the affected provider. Users cannot send or receive messages from the AI, rendering the OpenClaw deployment non-functional for its primary purpose.
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Setting http_proxy environment variables to bypass a local Fake IP SSRF block causes OpenClaw's CLI and WebUI to silently hang and fail without returning any errors when querying Gemini models.

Steps to reproduce

  1. Set up a Linux environment (e.g., Ubuntu) running a transparent proxy (like v2rayA in tproxy mode) with "Fake IP" enabled for DNS resolution.

2.Configure OpenClaw (v2026.4.21) with a valid Gemini API key.

3.Attempt to call the Gemini model without explicitly setting proxy variables: openclaw infer "Test" --model google/gemini-3-flash-preview

4.Check the Gateway logs and observe the internal SSRF security block: blocked URL fetch... reason=Blocked: resolves to private/internal/special-use IP address

5.To bypass the Fake IP resolution, explicitly inject the local HTTP proxy variables into the terminal: export http_proxy="http://127.0.0.1:20171" export https_proxy="http://127.0.0.1:20171"

6.Run the inference command again in the same terminal: openclaw infer "Test" --model google/gemini-3-flash-preview

7.Observe the bug: The CLI (and similarly the WebUI) hangs, generates no response, and silently fails without throwing any HTTP errors or timeout warnings to the user interface.

Expected behavior

1.When http_proxy and https_proxy environment variables are provided, the OpenClaw Gateway should respect them and route the outgoing API request through the specified proxy. This should bypass the local Fake IP DNS resolution and successfully complete the inference call to the Gemini model.

2.If the request fails for any reason (e.g., proxy connection refused, timeout, or an upstream API error), OpenClaw should not fail silently. It must surface an explicit, descriptive error message to the CLI and WebUI to inform the user of the exact failure.

Actual behavior

After setting the http_proxy and https_proxy environment variables and initiating the request, the CLI (openclaw infer or openclaw tui) and the WebUI fail silently.

There is absolutely no response generated from the Gemini model, and the interface simply hangs or terminates without surfacing any explicit error messages (such as network timeouts, HTTP 400/500 codes, or connection refused warnings). In the background logs, the agent appears to quit quietly (sometimes leaving a brief warn agent/embedded embedded run agent end trace), but the user is left completely unaware of the underlying failure.

OpenClaw version

2026.4.21

Operating system

Ubuntu 24.0.4 / Windows11 25H2

Install method

No response

Model

google/gemini-3.1-flash-lite-preview

Provider / routing chain

Provider: Google Model: google/gemini-3-flash-preview (also tested with google/gemini-3.1-flash-lite-preview) Routing Chain: OpenClaw Gateway -> Local HTTP/HTTPS Proxy (http://127.0.0.1:20171 provided by v2rayA) -> Official Google API endpoint (generativelanguage.googleapis.com)

Additional provider/model setup details

  • Auth Profile: API key is managed via auth-profiles.json. openclaw models status correctly reflects the Google provider as effective with api_key=1.
  • Environment Context: Environment variables (http_proxy, https_proxy) are injected via terminal export and verified within the shell before running openclaw infer.
  • Config Context: Using default agent settings under ~/.openclaw/agents/main/agent. No custom per-agent routing overrides are currently applied.
  • Network Stack: The system uses v2rayA for transparent proxying, but OpenClaw is specifically directed to the local HTTP port (127.0.0.1:20171) to avoid the SSRF block triggered by Fake IP resolution on the Gateway.

Logs, screenshots, and evidence

Impact and severity

  • Affected users/systems/channels: Users running OpenClaw on Linux environments with transparent proxies (specifically those utilizing Fake IP/tproxy setups). Affects both CLI and WebUI channels.
  • Severity: Blocks workflow. The core functionality of the agent is completely inaccessible because the request cycle cannot be completed.
  • Frequency: Always. The issue occurs consistently every time the Gemini API is called while the HTTP proxy environment variables are active.
  • Consequence: Total service failure for the affected provider. Users cannot send or receive messages from the AI, rendering the OpenClaw deployment non-functional for its primary purpose.

Additional information

No response

extent analysis

TL;DR

Setting the http_proxy and https_proxy environment variables causes OpenClaw's CLI and WebUI to hang and fail silently when querying Gemini models, likely due to a proxy configuration issue.

Guidance

  • Verify that the proxy server at http://127.0.0.1:20171 is correctly configured and functioning as expected.
  • Check the OpenClaw documentation to ensure that the http_proxy and https_proxy environment variables are properly supported and configured.
  • Test the proxy connection using a tool like curl to rule out any issues with the proxy server itself.
  • Consider adding error handling and logging to the OpenClaw configuration to provide more informative error messages in case of failures.

Example

No code snippet is provided as the issue seems to be related to configuration and environment variables rather than code.

Notes

The issue may be specific to the combination of OpenClaw, the transparent proxy setup, and the Gemini model. Further investigation into the proxy configuration and OpenClaw's handling of environment variables may be necessary to resolve the issue.

Recommendation

Apply a workaround by testing an alternative proxy configuration or disabling the Fake IP resolution to see if it resolves the issue, as the root cause is likely related to the proxy setup.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

1.When http_proxy and https_proxy environment variables are provided, the OpenClaw Gateway should respect them and route the outgoing API request through the specified proxy. This should bypass the local Fake IP DNS resolution and successfully complete the inference call to the Gemini model.

2.If the request fails for any reason (e.g., proxy connection refused, timeout, or an upstream API error), OpenClaw should not fail silently. It must surface an explicit, descriptive error message to the CLI and WebUI to inform the user of the exact failure.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING