[GH-ISSUE #356] [BUG] When selecting images tab it crashes #237

Closed
opened 2026-02-25 20:35:14 +03:00 by kerem · 1 comment
Owner

Originally created by @bruvv on GitHub (Jun 13, 2021).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/356

Describe the bug

ERROR:app:Exception on / [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1947, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2241, in preprocess_request
    rv = func()
  File "/whoogle/app/routes.py", line 77, in before_request_func
    g.user_request = Request(
  File "/whoogle/app/request.py", line 160, in __init__
    self.mobile = 'Android' in normal_ua or 'iPhone' in normal_ua
TypeError: argument of type 'NoneType' is not iterable

ERROR:app:Exception on / [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1947, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2241, in preprocess_request
    rv = func()
  File "/whoogle/app/routes.py", line 77, in before_request_func
    g.user_request = Request(
  File "/whoogle/app/request.py", line 160, in __init__
    self.mobile = 'Android' in normal_ua or 'iPhone' in normal_ua
TypeError: argument of type 'NoneType' is not iterable

ERROR:app:Exception on /search [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/whoogle/app/routes.py", line 38, in decorated
    return f(*args, **kwargs)
  File "/whoogle/app/routes.py", line 222, in search
    response = search_util.generate_response()
  File "/whoogle/app/utils/search.py", line 139, in generate_response
    html_soup = content_filter.view_image(html_soup)
  File "/whoogle/app/filter.py", line 316, in view_image
    webpage = urlparse.unquote(urls[1].split('&')[0])
IndexError: list index out of range

WARNING:app:404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

To Reproduce
Steps to reproduce the behavior:

  1. Search for something
  2. Click on 'images`
  3. See the error

Deployment Method

  • Heroku (one-click deploy)
  • Docker
  • run executable
  • pip/pipx
  • Other: [describe setup]

Version of Whoogle Search

  • Latest build from [source] (i.e. GitHub, Docker Hub, pip, etc)
  • Version [version number]
  • Not sure

Desktop (please complete the following information):

  • OS: Windows 10/android
  • Browser: Firefox
  • Version: 89
Originally created by @bruvv on GitHub (Jun 13, 2021). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/356 **Describe the bug** ``` ERROR:app:Exception on / [GET] Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1947, in full_dispatch_request rv = self.preprocess_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2241, in preprocess_request rv = func() File "/whoogle/app/routes.py", line 77, in before_request_func g.user_request = Request( File "/whoogle/app/request.py", line 160, in __init__ self.mobile = 'Android' in normal_ua or 'iPhone' in normal_ua TypeError: argument of type 'NoneType' is not iterable ERROR:app:Exception on / [GET] Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1947, in full_dispatch_request rv = self.preprocess_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2241, in preprocess_request rv = func() File "/whoogle/app/routes.py", line 77, in before_request_func g.user_request = Request( File "/whoogle/app/request.py", line 160, in __init__ self.mobile = 'Android' in normal_ua or 'iPhone' in normal_ua TypeError: argument of type 'NoneType' is not iterable ERROR:app:Exception on /search [GET] Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/whoogle/app/routes.py", line 38, in decorated return f(*args, **kwargs) File "/whoogle/app/routes.py", line 222, in search response = search_util.generate_response() File "/whoogle/app/utils/search.py", line 139, in generate_response html_soup = content_filter.view_image(html_soup) File "/whoogle/app/filter.py", line 316, in view_image webpage = urlparse.unquote(urls[1].split('&')[0]) IndexError: list index out of range WARNING:app:404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. ``` **To Reproduce** Steps to reproduce the behavior: 1. Search for something 2. Click on 'images` 3. See the error **Deployment Method** - [ ] Heroku (one-click deploy) - [x] Docker - [ ] `run` executable - [ ] pip/pipx - [ ] Other: [describe setup] **Version of Whoogle Search** - [x] Latest build from [source] (i.e. GitHub, Docker Hub, pip, etc) - [ ] Version [version number] - [ ] Not sure **Desktop (please complete the following information):** - OS: Windows 10/android - Browser: Firefox - Version: 89
kerem 2026-02-25 20:35:14 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@benbusby commented on GitHub (Jun 16, 2021):

So there's a couple errors here, but they should both be handled by b21b4f4f57 and d894bd347d (Docker images will be updated shortly). That being said, I wasn't able to replicate the errors myself, so there could be something else going on that I'm overlooking. If you're still having the issue after updating your Docker instance, feel free to comment again or reopen.

<!-- gh-comment-id:862443880 --> @benbusby commented on GitHub (Jun 16, 2021): So there's a couple errors here, but they should both be handled by b21b4f4f572f69cf3b5fb742113514a1f0a3a614 and d894bd347d7976db8459ad1177342376476eca38 (Docker images will be updated shortly). That being said, I wasn't able to replicate the errors myself, so there could be something else going on that I'm overlooking. If you're still having the issue after updating your Docker instance, feel free to comment again or reopen.
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/whoogle-search#237
No description provided.