client-proxy: WARN "invalid host" spam from unroutable bare-IP Host requests (external probes)
Maintainer thường phản hồi trong vòng 2 ngày
@AdaAibaby đang làm issue này rồi.
Từ ngày 2/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Thay đổi nằm trong nhánh ErrInvalidHost của handler() trong packages/shared/pkg/proxy/handler.go, nhánh này dùng isLocalRequestHost từ host.go và kiểm tra header định tuyến. Hãy đọc các hàm hỗ trợ đó trước, sau đó thêm unit test cho trường hợp Host chỉ là một IP, không có header E2b-Sandbox-Id/E2b-Sandbox-Port. Hoàn thành khi trường hợp này ghi log ở mức Debug, host tên miền sai định dạng vẫn ghi log ở mức Warn, và phản hồi 400 không thay đổi. Hãy xác nhận hướng tiếp cận với maintainer trước khi mở PR.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
client-proxy logs WARN "invalid host" for every inbound request whose Host is a bare IP address with no sandbox routing headers. On any proxy with a public endpoint these arrive continuously from external scanners, health probes, and stale clients still pointed at an old node IP, producing ~1 line/second of WARN noise that drowns real warnings.
Observed (client-proxy):
WARN invalid host {"service":"client-proxy","host":"118.196.30.209"}
WARN invalid host {"service":"client-proxy","host":"118.196.30.209"}
... (repeats every ~1s)
Why these are expected, not warnings
packages/shared/pkg/proxy/handler.go rejects the request with ErrInvalidHost and returns 400, which is correct. But a bare-IP Host cannot encode sandbox routing ({port}-{sandboxID}.{domain}) — as isLocalRequestHost in host.go documents, header-based routing is the only mechanism that can work for an IP host. So an IP Host that also carries no routing headers (E2b-Sandbox-Id / E2b-Sandbox-Port) is, by construction, unroutable. Rejecting it is the designed behavior; logging it at WARN on every hit just turns routine external traffic into log spam.
(Header-based routing for IP hosts — #2581 — is unaffected: an IP host with routing headers routes fine and never reaches this branch.)
Proposal
In the ErrInvalidHost branch of handler(), log at Debug when the host is a raw IP / localhost and no routing headers are present (isLocalRequestHost(r.Host) && !hasRoutingHeaders(r.Header)), and keep Warn for a genuinely suspect invalid host (a malformed domain host), which is rare and worth visibility. Status code stays 400 in both cases — this only changes log level, not behavior.
Environment
Reproduced on client-proxy main; the proxy sits behind a public ingress, so any internet host hitting the raw IP triggers it. Same code path in api (OpenAPI validator logs the same raw-IP / requests as 404 no matching operation), but the client-proxy WARN is the loudest.
Happy to send the PR (small, with a unit test) if the direction is acceptable.
- Ngôn ngữ chính
- Go
- Star
- 1.8k
- Fork
- 503
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của e2b-dev/runtime
-
orchestrator: NFS-cache "cache path is not set" WARN logged on every build/launch instead of onceCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
api: autoPause default is declared in the spec and in a Go constant with no test keeping them in syncCó thể đã có người làm @AdaAibaby đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: flock() on a mounted volume hangs forever (mount is missing `nolock`)Có thể đã có người làm @AdaAibaby đã nhận 57 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày
-
sandbox cache: StartRemoving state transition not broadcast, all allocations see stale Running stateCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của e2b-dev/runtime
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
rishikanthc/Scriberr#506 ·
-
[Bug] rollingUpdatePartition panics when live StatefulSet replicas sit far below the desired countĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sgl-project/rbg#547 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: frontend priority: normal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/validator
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
TestAutonomousStop_ReportsObservedState fails under host load: 1s wall-clock ceiling vs 250ms cycleĐang mởtype:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
nightgauge/nightgauge#2909 ·
Maintainer thường phản hồi trong vòng 1 ngày