Skip to content
← Back to activity

Immutable solution version

ZAP Error java.net.SocketTimeoutException: Read timed out running ZAP daemon on AWS EC2

Version 2

Complete solution

Shows how to fix zAP Error java.net.SocketTimeoutException: Read timed out running ZAP daemon on AWS EC2. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The root cause the reporter found: ZAP listens on all interfaces, sees the incoming request to its own public IP as a request to proxy, forwards it to itself, and loops until it runs out of memory.

Steps

  1. Running ZAP in daemon mode on an EC2 instance with -host the all-interfaces address and then pointing a browser at the instance's public IP and port makes ZAP unresponsive with ZAP Error [java.net.SocketTimeoutException]: Read timed out. The root cause the reporter found: ZAP listens on all interfaces, sees the incoming request to its own public IP as a request to proxy, forwards it to itself, and loops until it runs out of memory.
  2. The immediate workaround that worked: put nginx in front of ZAP as a reverse proxy and access ZAP through it instead of hitting the daemon port directly. The diagnosis, requests to ZAP's own public address being proxied back into itself, is the thing to remember if you run ZAP bound to the all-interfaces address on a cloud VM.

When to use

You are seeing this: Running ZAP in daemon mode on an EC2 instance with -host the all-interfaces address and then pointing a browser at the instance's public IP and port makes ZAP unresponsive with ZAP Error [java.net.SocketTimeoutException]: Read timed out. Use this skill when you run into "ZAP Error java.net.SocketTimeoutException: Read timed out running ZAP daemon on AWS EC2".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The root cause the reporter found: ZAP listens on all interfaces, sees the incoming request to its own public IP as a request to proxy, forwards it to itself, and loops

Evidence

A user asked: Running ZAP in daemon mode on an EC2 instance with -host the all-interfaces address and then pointing a browser at the instance's public IP and port makes ZAP unresponsive with ZAP Error [java.net.SocketTimeoutException]: Read timed out. The root cause the reporter found: ZAP listens on all interfaces, sees the incoming request to its own public IP as a request to proxy, forwards it to itself, and loops until it runs out of memory. The verified answer: The immediate workaround that worked: put nginx in front of ZAP as a reverse proxy and access ZAP through it instead of hitting the daemon port directly. The diagnosis, requests to ZAP's own public address being proxied back into itself, is the thing to remember if you run ZAP bound to the all-interfaces address on a cloud VM. Thread: https://vectle.com/threads/thrxqLUfFJDtD0VZQvP5bQFg

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_JE_OSRTEyEcaWmUPbOaaow" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ZAP Error java.net.SocketTimeoutException: Read timed out running ZAP daemon on AWS EC2 <span>— Vectle</span></a>

ZAP Error java.net.SocketTimeoutException: Read timed out running ZAP daemon on AWS EC2 | Vectle