[Bug] Proxy + IPv6 [::] binding prevents GUI dynamic fields from appearing
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đá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
- 78/100
Hướng nghiên cứu
Bắt đầu từ đường dẫn khởi chạy GUI legacy 1.x và tìm định nghĩa bind_addresses được nêu trong báo cáo. Tái hiện lỗi startup-events với HTTP_PROXY, HTTPS_PROXY, ALL_PROXY và NO_PROXY được bật, sau đó xác minh rằng GUI sử dụng loopback IPv4 an toàn với proxy trước tiên và các trường phụ thuộc vào dịch vụ xuất hiện. Xác nhận rằng luồng dịch tương tác hiện có vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Scope note: this report is specifically about the legacy 1.x GUI implementation in
PDFMathTranslate/PDFMathTranslate. I did not reproduce it against PDFMathTranslate-next because its GUI/configuration implementation has been rewritten. I am reporting it here so other 1.x users behind a proxy can find the cause and workaround.
Environment
- OS: Windows 11
- Python: 3.12.14
- pdf2zh: 1.9.12
- Gradio: 5.35.0
- Commit:
f4522dd - Installation: source
HTTP_PROXY,HTTPS_PROXY, andALL_PROXYare enabledNO_PROXY=localhost,127.0.0.1,::1
Description
The Web UI opens, but dynamic GUI callbacks do not work. For example, selecting DeepSeek in the Service dropdown does not reveal the DEEPSEEK_API_KEY and DEEPSEEK_MODEL fields.
The legacy GUI tries to bind to [::] before IPv4 addresses. Gradio then checks:
http://[::]:7860/gradio_api/startup-events
With the proxy environment described above, that request is routed through the proxy and returns HTTP 502. A browser page may still be served, but Gradio startup events do not complete, leaving dropdown-dependent components stuck or invisible.
This is consistent with the failure mode described in gradio-app/gradio#10729.
Steps to reproduce
-
On Windows, enable an HTTP proxy through
HTTP_PROXY,HTTPS_PROXY, and/orALL_PROXY. -
Keep the common local bypass value
NO_PROXY=localhost,127.0.0.1,::1. -
Start the GUI:
pdf2zh --interactive --serverport 7860 -
Open the generated Web UI.
-
Select DeepSeek from Service.
-
Observe that the API key/model fields do not appear and the event remains pending.
A minimal Gradio launch using server_name="[::]" reproduces the startup check failure with:
Couldn't start the app because 'http://[::]:7860/gradio_api/startup-events' failed (code 502)
Expected behavior
The local GUI should bind to a proxy-safe loopback address, and selecting a service should immediately update its configuration fields.
Root cause
The current 1.x binding order prefers the IPv6 wildcard:
bind_addresses = []
if _has_ipv6():
bind_addresses.append("[::]")
bind_addresses.append("0.0.0.0")
bind_addresses.append("127.0.0.1")
Many proxy configurations bypass 127.0.0.1 but do not correctly bypass wildcard/bracketed IPv6 URLs.
Confirmed local fix
Prefer IPv4 loopback for the local interactive GUI:
bind_addresses = ["127.0.0.1", "0.0.0.0"]
if _has_ipv6():
bind_addresses.append("[::]")
After this change the GUI launches at http://127.0.0.1:7860, the DeepSeek fields appear, and a 14-page translation completes successfully through the configured DeepSeek service.
References
- Project FAQ already notes that global proxy mode can prevent Gradio from starting: https://github.com/PDFMathTranslate/PDFMathTranslate/wiki/FAQ---%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98
- Related Gradio startup-events behavior: https://github.com/gradio-app/gradio/issues/10729
- Ngôn ngữ chính
- Python
- Star
- 37.3k
- Fork
- 3.3k
- Merge trung bình
- 11 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không 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 PDFMathTranslate/PDFMathTranslate
-
TencentTranslator sends chunks larger than the API limit for single lines longer than 5000 charsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
PDFMathTranslate/PDFMathTranslate#1205 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
PDFMathTranslate/PDFMathTranslate#1199 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
PDFMathTranslate/PDFMathTranslate#1194 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
PDFMathTranslate/PDFMathTranslate#1167 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Ali Qwen-Translation 配置错误Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
PDFMathTranslate/PDFMathTranslate#1108 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PDFMathTranslate/PDFMathTranslate
Issue tương tự
-
#bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
apache/superset#44923 · 1 bình luận ·
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 84/100
lawndoc/stack-back#123 ·
-
Add: EntuneĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AbdelStark/awesome-typesafe-jev#187 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
repowise-dev/repowise#2966 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ 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