[GH-ISSUE #504] [BUG] <Internal Server Error> #323

Closed
opened 2026-02-25 20:35:27 +03:00 by kerem · 8 comments
Owner

Originally created by @drugal on GitHub (Oct 28, 2021).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/504

Describe the bug
search for "my ip" returns error 500

To Reproduce
Steps to reproduce the behavior:

  1. Go to whoogle search
  2. Search 'my ip'
  3. See Internal Server 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):
all

Smartphone (please complete the following information):
all

Additional context
errorw
errorw2
errorw3

Originally created by @drugal on GitHub (Oct 28, 2021). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/504 **Describe the bug** search for "my ip" returns error 500 **To Reproduce** Steps to reproduce the behavior: 1. Go to whoogle search 2. Search 'my ip' 3. See Internal Server 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):** all **Smartphone (please complete the following information):** all **Additional context** <img width="783" alt="errorw" src="https://user-images.githubusercontent.com/81636567/139212203-1b329af9-de02-406b-af8c-7bb364fc52d5.PNG"> <img width="777" alt="errorw2" src="https://user-images.githubusercontent.com/81636567/139212206-6d4d2f4e-3fab-4e15-87f7-891ca3ad7a6d.PNG"> <img width="752" alt="errorw3" src="https://user-images.githubusercontent.com/81636567/139212207-1c8731be-aec5-476e-8bbc-cf5156ec651b.PNG">
kerem 2026-02-25 20:35:27 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@benbusby commented on GitHub (Oct 28, 2021):

You run whooglesearch.net right? If so, are you logging application errors somewhere? Seeing a traceback would be helpful, as I can't replicate on my end (both locally and with deployed instances).

<!-- gh-comment-id:954117420 --> @benbusby commented on GitHub (Oct 28, 2021): You run whooglesearch.net right? If so, are you logging application errors somewhere? Seeing a traceback would be helpful, as I can't replicate on my end (both locally and with deployed instances).
Author
Owner

@benbusby commented on GitHub (Oct 28, 2021):

@vacom13 FYI, looks like this is related to the "my ip" feature. Let me know if you have an idea of what could cause the error, otherwise I don't mind investigating further.

<!-- gh-comment-id:954118065 --> @benbusby commented on GitHub (Oct 28, 2021): @vacom13 FYI, looks like this is related to the "my ip" feature. Let me know if you have an idea of what could cause the error, otherwise I don't mind investigating further.
Author
Owner

@drugal commented on GitHub (Oct 28, 2021):

hi @benbusby! this is what I get from the logs

ERROR:app:Exception on /search [POST]
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 42, in decorated
    return f(*args, **kwargs)
  File "/whoogle/app/routes.py", line 258, in search
    html_soup = bsoup(response, "html.parser")
  File "/usr/local/lib/python3.8/site-packages/bs4/__init__.py", line 311, in __init__
    markup = markup.read()
TypeError: 'NoneType' object is not callable
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.
<!-- gh-comment-id:954178793 --> @drugal commented on GitHub (Oct 28, 2021): hi @benbusby! this is what I get from the logs ``` ERROR:app:Exception on /search [POST] 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 42, in decorated return f(*args, **kwargs) File "/whoogle/app/routes.py", line 258, in search html_soup = bsoup(response, "html.parser") File "/usr/local/lib/python3.8/site-packages/bs4/__init__.py", line 311, in __init__ markup = markup.read() TypeError: 'NoneType' object is not callable 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. ```
Author
Owner

@vacom13 commented on GitHub (Oct 28, 2021):

@benbusby this has been closed? Should I investigate more or not?

<!-- gh-comment-id:954218351 --> @vacom13 commented on GitHub (Oct 28, 2021): @benbusby this has been closed? Should I investigate more or not?
Author
Owner

@drugal commented on GitHub (Oct 28, 2021):

I didn't want to do it. Sorry

<!-- gh-comment-id:954251197 --> @drugal commented on GitHub (Oct 28, 2021): I didn't want to do it. Sorry
Author
Owner

@benbusby commented on GitHub (Oct 29, 2021):

@vacom13 looks like @drugal closed it by mistake. That error actually is kinda confusing -- the error from the log should only be shown if BeautifulSoup is passed a file object, which shouldn't be the case here. The response body should only ever get passed as a string.

<!-- gh-comment-id:954397855 --> @benbusby commented on GitHub (Oct 29, 2021): @vacom13 looks like @drugal closed it by mistake. That error actually is kinda confusing -- the error from the log should only be shown if BeautifulSoup is passed a file object, which shouldn't be the case here. The `response` body should only ever get passed as a string.
Author
Owner

@benbusby commented on GitHub (Oct 29, 2021):

I realized the problem. In the new feature where search terms are now made bold, the response was being reformed into a new bsoup object, which was causing this error. Converting the response to a string before creating the "my ip" card fixed the issue.

<!-- gh-comment-id:954399987 --> @benbusby commented on GitHub (Oct 29, 2021): I realized the problem. In the new feature where search terms are now made bold, the response was being reformed into a new bsoup object, which was causing this error. Converting the response to a string before creating the "my ip" card fixed the issue.
Author
Owner

@vacom13 commented on GitHub (Oct 29, 2021):

Oh okay. Great!

<!-- gh-comment-id:954467207 --> @vacom13 commented on GitHub (Oct 29, 2021): Oh okay. Great!
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#323
No description provided.