[GH-ISSUE #7752] SearXNG #1640

Closed
opened 2026-02-26 12:49:43 +03:00 by kerem · 6 comments
Owner

Originally created by @gangov on GitHub (Sep 19, 2025).
Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/7752

📌 Task summary

Image proxy broken – _AsyncGeneratorContextManager has no attribute status_code

📋 Task details

whenever we enable image proxy - Proxy image results through SearXNG the images and videos aren't shown and 500 error is thrown on the server.

AttributeError: '_AsyncGeneratorContextManager' object has no attribute 'status_code'
2025-09-19 23:47:00,852 ERROR:webapp: Exception on /image_proxy [GET]
Traceback (most recent call last):
 File "/usr/local/searxng/searx-pyenv/lib/python3.11/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()

This seems to happen because network.http_stream() / network.stream() now returns an _AsyncGeneratorContextManager instead of a proper httpx.Response. The Flask app is expecting a synchronous Response and tries to access .status_code.

Steps to reproduce:

  • Enable image proxy

  • Search for any image

  • Proxy request crashes with the above error

Environment:

  • Python 3.11

  • Latest master as of 19th September 2025

  • Flask app

Possible reason:

Looks like an API mismatch between webapp.py and network.py to me. async with await network.stream(...) gives back a context manager, not a response. Upstream likely fixed in newer commits — but current master still shows the issue.

Originally created by @gangov on GitHub (Sep 19, 2025). Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/7752 ### 📌 Task summary Image proxy broken – _AsyncGeneratorContextManager has no attribute status_code ### 📋 Task details whenever we enable `image proxy - Proxy image results through SearXNG` the images and videos aren't shown and 500 error is thrown on the server. ``` AttributeError: '_AsyncGeneratorContextManager' object has no attribute 'status_code' 2025-09-19 23:47:00,852 ERROR:webapp: Exception on /image_proxy [GET] Traceback (most recent call last): File "/usr/local/searxng/searx-pyenv/lib/python3.11/site-packages/flask/app.py", line 1511, in wsgi_app response = self.full_dispatch_request() ``` This seems to happen because network.http_stream() / network.stream() now returns an _AsyncGeneratorContextManager instead of a proper httpx.Response. The Flask app is expecting a synchronous Response and tries to access .status_code. ## Steps to reproduce: - Enable image proxy - Search for any image - Proxy request crashes with the above error ## Environment: - Python 3.11 - Latest master as of 19th September 2025 - Flask app ## Possible reason: > Looks like an API mismatch between webapp.py and network.py to me. `async with await network.stream(...)` gives back a context manager, not a response. Upstream likely fixed in newer commits — but current master still shows the issue.
kerem 2026-02-26 12:49:43 +03:00
Author
Owner

@MickLesk commented on GitHub (Sep 19, 2025):

Why Here and Not in searxng Repo?

Whats the Task Here?

Where made the Changes for this?

Is this Linked and defined in there repo?
Is there an how to or any Feedback from there maintainers?

<!-- gh-comment-id:3313794131 --> @MickLesk commented on GitHub (Sep 19, 2025): Why Here and Not in searxng Repo? Whats the Task Here? Where made the Changes for this? Is this Linked and defined in there repo? Is there an how to or any Feedback from there maintainers?
Author
Owner

@gangov commented on GitHub (Sep 19, 2025):

Why Here and Not in searxng Repo?
cuz I've installed it via your script

Whats the Task Here?
if it's anything in your power to fix it

Where made the Changes for this?
I don't understand this

Is this Linked and defined in there repo? Is there an how to or any Feedback from there maintainers?
not that I know of.

In general feel free to close the issue if it ain't your responsibility to fix :)

<!-- gh-comment-id:3313806929 --> @gangov commented on GitHub (Sep 19, 2025): > Why Here and Not in searxng Repo? cuz I've installed it via your script > Whats the Task Here? > if it's anything in your power to fix it > Where made the Changes for this? I don't understand this > Is this Linked and defined in there repo? Is there an how to or any Feedback from there maintainers? not that I know of. In general feel free to close the issue if it ain't your responsibility to fix :)
Author
Owner

@MickLesk commented on GitHub (Sep 19, 2025):

Without useful Input and dont knowledge of the App, how can i fix it? Did you think we are wizards and know all Proxy Settings of every random App? These AI Task say nothing.

<!-- gh-comment-id:3313831360 --> @MickLesk commented on GitHub (Sep 19, 2025): Without useful Input and dont knowledge of the App, how can i fix it? Did you think we are wizards and know all Proxy Settings of every random App? These AI Task say nothing.
Author
Owner

@MickLesk commented on GitHub (Sep 19, 2025):

the error is not caused by the install script but by an API mismatch in SearXNG’s current master, Not in the Script, its just an Git pull

network.stream() now returns an _AsyncGeneratorContextManager (like httpx.AsyncClient.stream()), but webapp.py still expects a plain httpx.Response object and calls .status_code.

this breaks the image proxy and causes

AttributeError: '_AsyncGeneratorContextManager' object has no attribute 'status_code'

the bug should be reported in upstream searxng repo

<!-- gh-comment-id:3313852082 --> @MickLesk commented on GitHub (Sep 19, 2025): the error is not caused by the install script but by an API mismatch in SearXNG’s current master, Not in the Script, its just an Git pull network.stream() now returns an _AsyncGeneratorContextManager (like httpx.AsyncClient.stream()), but webapp.py still expects a plain httpx.Response object and calls .status_code. this breaks the image proxy and causes AttributeError: '_AsyncGeneratorContextManager' object has no attribute 'status_code' the bug should be reported in upstream searxng repo
Author
Owner

@gangov commented on GitHub (Sep 19, 2025):

Did you think we are wizards

yes, yes, I do

<!-- gh-comment-id:3313875070 --> @gangov commented on GitHub (Sep 19, 2025): > Did you think we are wizards yes, yes, I do
Author
Owner

@gangov commented on GitHub (Sep 19, 2025):

thanks @MickLesk

<!-- gh-comment-id:3313875702 --> @gangov commented on GitHub (Sep 19, 2025): thanks @MickLesk
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#1640
No description provided.