[GH-ISSUE #642] [BUG] search for bitcoin gives Internal Server Error #407

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

Originally created by @eddik1970 on GitHub (Feb 4, 2022).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/642

Describe the bug

Whenever my search includes the phrase bitcoin I get:

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

To Reproduce
Steps to reproduce the behavior:

  1. Go to search page
  2. Search for a phrase including bitcoin
  3. See error

Deployment Method

  • Docker on Centos 8

Version of Whoogle Search

  • Version v0.7.1

Desktop (please complete the following information):

Smartphone (please complete the following information):

  • Device: Samsung S8
  • OS: Android
  • Browser Opera
  • Version

Additional context
I use the following docker-compose:

whoogle-search:
image: benbusby/whoogle-search
container_name: whoogle-search
restart: unless-stopped
pids_limit: 50
mem_limit: 256mb
memswap_limit: 256mb
# user debian-tor from tor package

user: '1500'

security_opt:
  - no-new-privileges
cap_drop:
  - ALL

tmpfs:

- /config/:size=10M,uid=102,gid=102,mode=1700

- /var/lib/tor/:size=10M,uid=102,gid=102,mode=1700

- /run/tor/:size=1M,uid=102,gid=102,mode=1700

environment: # Uncomment to configure environment variables
  # Basic auth configuration, uncomment to enable
  #- WHOOGLE_USER=<auth username>
  #- WHOOGLE_PASS=<auth password>
  # Proxy configuration, uncomment to enable
  #- WHOOGLE_PROXY_USER=<proxy username>
  #- WHOOGLE_PROXY_PASS=<proxy password>
  #- WHOOGLE_PROXY_TYPE=<proxy type (http|https|socks4|socks5)
  #- WHOOGLE_PROXY_LOC=<proxy host/ip>
  # Site alternative configurations, uncomment to enable
  # Note: If not set, the feature will still be available
  # with default values.
  # - WHOOGLE_CONFIG_TOR=1
  - WHOOGLE_ALT_TW=farside.link/nitter
  - WHOOGLE_ALT_YT=farside.link/invidious
  - WHOOGLE_ALT_IG=farside.link/bibliogram/u
  - WHOOGLE_ALT_RD=farside.link/libreddit
  - WHOOGLE_ALT_MD=farside.link/scribe
  - WHOOGLE_ALT_TL=lingva.ml
  - WHOOGLE_ALT_IMG=imgin.voidnet.tech
  - WHOOGLE_ALT_WIKI=wikiless.org
#env_file: # Alternatively, load variables from whoogle.env
  #- whoogle.env
ports:
  - 5000:5000
Originally created by @eddik1970 on GitHub (Feb 4, 2022). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/642 **Describe the bug** Whenever my search includes the phrase bitcoin I get: Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. **To Reproduce** Steps to reproduce the behavior: 1. Go to search page 2. Search for a phrase including bitcoin 3. See error **Deployment Method** - [X] Docker on Centos 8 **Version of Whoogle Search** - [ ] Version v0.7.1 **Desktop (please complete the following information):** - OS: Windows 10 - Browser Brave - Version [Version 1.34.81 Chromium: 97.0.4692.99 (Official Build) (64-bit)](https://brave.com/latest/) **Smartphone (please complete the following information):** - Device: Samsung S8 - OS: Android - Browser Opera - Version **Additional context** I use the following docker-compose: whoogle-search: image: benbusby/whoogle-search container_name: whoogle-search restart: unless-stopped pids_limit: 50 mem_limit: 256mb memswap_limit: 256mb # user debian-tor from tor package # user: '1500' security_opt: - no-new-privileges cap_drop: - ALL # tmpfs: # - /config/:size=10M,uid=102,gid=102,mode=1700 # - /var/lib/tor/:size=10M,uid=102,gid=102,mode=1700 # - /run/tor/:size=1M,uid=102,gid=102,mode=1700 environment: # Uncomment to configure environment variables # Basic auth configuration, uncomment to enable #- WHOOGLE_USER=<auth username> #- WHOOGLE_PASS=<auth password> # Proxy configuration, uncomment to enable #- WHOOGLE_PROXY_USER=<proxy username> #- WHOOGLE_PROXY_PASS=<proxy password> #- WHOOGLE_PROXY_TYPE=<proxy type (http|https|socks4|socks5) #- WHOOGLE_PROXY_LOC=<proxy host/ip> # Site alternative configurations, uncomment to enable # Note: If not set, the feature will still be available # with default values. # - WHOOGLE_CONFIG_TOR=1 - WHOOGLE_ALT_TW=farside.link/nitter - WHOOGLE_ALT_YT=farside.link/invidious - WHOOGLE_ALT_IG=farside.link/bibliogram/u - WHOOGLE_ALT_RD=farside.link/libreddit - WHOOGLE_ALT_MD=farside.link/scribe - WHOOGLE_ALT_TL=lingva.ml - WHOOGLE_ALT_IMG=imgin.voidnet.tech - WHOOGLE_ALT_WIKI=wikiless.org #env_file: # Alternatively, load variables from whoogle.env #- whoogle.env ports: - 5000:5000
kerem 2026-02-25 20:35:40 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@DUOLabs333 commented on GitHub (Feb 4, 2022):

(Possibly) related: only on "bitcoin" does WHOOGLE_MINIMAL not work? Maybe "bitcoin" is interfering somehow?

<!-- gh-comment-id:1029934044 --> @DUOLabs333 commented on GitHub (Feb 4, 2022): (Possibly) related: only on "bitcoin" does `WHOOGLE_MINIMAL` not work? Maybe "bitcoin" is interfering somehow?
Author
Owner

@DUOLabs333 commented on GitHub (Feb 4, 2022):

Interesting -- the sections of "People also ask", etc. does not show up in result_children. Maybe Google is making an exception for this page?

<!-- gh-comment-id:1029936383 --> @DUOLabs333 commented on GitHub (Feb 4, 2022): Interesting -- the sections of "People also ask", etc. does not show up in `result_children`. Maybe Google is making an exception for this page?
Author
Owner

@DUOLabs333 commented on GitHub (Feb 4, 2022):

Can you show us the log?

<!-- gh-comment-id:1030136197 --> @DUOLabs333 commented on GitHub (Feb 4, 2022): Can you show us the log?
Author
Owner

@eddik1970 commented on GitHub (Feb 4, 2022):

how do I find the log in a docker container?

<!-- gh-comment-id:1030196415 --> @eddik1970 commented on GitHub (Feb 4, 2022): how do I find the log in a docker container?
Author
Owner

@DUOLabs333 commented on GitHub (Feb 4, 2022):

It should be with docker logs, but I'm not sure.

<!-- gh-comment-id:1030197284 --> @DUOLabs333 commented on GitHub (Feb 4, 2022): It should be with `docker logs`, but I'm not sure.
Author
Owner

@benbusby commented on GitHub (Feb 4, 2022):

My guess is that it has something to do with the currency converter that appears when searching for bitcoin. Logs would definitely help.

Also, what settings do you have configured for your whoogle instance (i.e. language, country, etc)?

<!-- gh-comment-id:1030434907 --> @benbusby commented on GitHub (Feb 4, 2022): My guess is that it has something to do with the currency converter that appears when searching for bitcoin. Logs would definitely help. Also, what settings do you have configured for your whoogle instance (i.e. language, country, etc)?
Author
Owner

@DUOLabs333 commented on GitHub (Feb 4, 2022):

Weird, I can't get the problem to show up with any other currency, crypto or otherwise.

<!-- gh-comment-id:1030440806 --> @DUOLabs333 commented on GitHub (Feb 4, 2022): Weird, I can't get the problem to show up with any other currency, crypto or otherwise.
Author
Owner

@eddik1970 commented on GitHub (Feb 7, 2022):

It should be with docker logs, but I'm not sure.

I cannot find that anything happens in the logs, except for normal activity, like about Tor and bootstrapping and such. Is there some extra logging I could turn on?

Also, you write " I can't get the problem to show up with any other currency, crypto or otherwise". Does that mean it crashes for you on bitcoin, or not? Other cryptocurrencies works fine here.

I have not set Country, Interface og search language, but it is in norwegian, so I guess that is coming via the browser.

<!-- gh-comment-id:1031317092 --> @eddik1970 commented on GitHub (Feb 7, 2022): > It should be with `docker logs`, but I'm not sure. I cannot find that anything happens in the logs, except for normal activity, like about Tor and bootstrapping and such. Is there some extra logging I could turn on? Also, you write " I can't get the problem to show up with any other currency, crypto or otherwise". Does that mean it crashes for you on bitcoin, or not? Other cryptocurrencies works fine here. I have not set Country, Interface og search language, but it is in norwegian, so I guess that is coming via the browser.
Author
Owner

@DUOLabs333 commented on GitHub (Feb 11, 2022):

@eddik1970 Can you try the latest tag?

<!-- gh-comment-id:1036655223 --> @DUOLabs333 commented on GitHub (Feb 11, 2022): @eddik1970 Can you try the `latest` tag?
Author
Owner

@eddik1970 commented on GitHub (Feb 16, 2022):

I did a docker-compose pull and up, but it seems there are still the same problem unfortunately.

But now I got something in the log:

Feb 16 07:34:23.000 [notice] While bootstrapping, fetched this many bytes: 561668 (consensus network-status fetch); 13280 (authority cert fetch); 2621895 (microdescriptor fetch)
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_functionsrule.endpoint
File "/whoogle/app/routes.py", line 92, in decorated
return f(*args, **kwargs)
File "/whoogle/app/routes.py", line 51, in decorated
return f(*args, **kwargs)
File "/whoogle/app/routes.py", line 359, in search
conversion = check_currency(str(response))
File "/whoogle/app/utils/results.py", line 255, in check_currency
'currencyValue2': float(currency2[0]),
ValueError: could not convert string to float: '391\xa0529.23'

<!-- gh-comment-id:1041197890 --> @eddik1970 commented on GitHub (Feb 16, 2022): I did a docker-compose pull and up, but it seems there are still the same problem unfortunately. But now I got something in the log: Feb 16 07:34:23.000 [notice] While bootstrapping, fetched this many bytes: 561668 (consensus network-status fetch); 13280 (authority cert fetch); 2621895 (microdescriptor fetch) 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 92, in decorated return f(*args, **kwargs) File "/whoogle/app/routes.py", line 51, in decorated return f(*args, **kwargs) File "/whoogle/app/routes.py", line 359, in search conversion = check_currency(str(response)) File "/whoogle/app/utils/results.py", line 255, in check_currency 'currencyValue2': float(currency2[0]), ValueError: could not convert string to float: '391\xa0529.23'
Author
Owner

@DUOLabs333 commented on GitHub (Feb 16, 2022):

Oh, seems simple enough to fix -- just have to remove non numeric characters (except periods of course).

<!-- gh-comment-id:1041401231 --> @DUOLabs333 commented on GitHub (Feb 16, 2022): Oh, seems simple enough to fix -- just have to remove non numeric characters (except periods of course).
Author
Owner

@benbusby commented on GitHub (Feb 16, 2022):

@DUOLabs333 yes and no. That solution would work, but the bigger issue here is that there's a unicode char (\xa0) in the currency string returned by Google for some reason, which includes a 0. So it'd probably be better to fix like:

amount = ''.join([i if ord(i) < 128 else '' for i in str(response)])
conversion = check_currency(amount)

Might need further sanitizing though, I haven't looked yet.

<!-- gh-comment-id:1041842025 --> @benbusby commented on GitHub (Feb 16, 2022): @DUOLabs333 yes and no. That solution would work, but the bigger issue here is that there's a unicode char (`\xa0`) in the currency string returned by Google for some reason, which includes a `0`. So it'd probably be better to fix like: ```python amount = ''.join([i if ord(i) < 128 else '' for i in str(response)]) conversion = check_currency(amount) ``` Might need further sanitizing though, I haven't looked yet.
Author
Owner

@DUOLabs333 commented on GitHub (Feb 16, 2022):

It's still Unicode right, so wouldn't something like re.sub('[^\d\.]', '',currency[0]) work?

<!-- gh-comment-id:1041844288 --> @DUOLabs333 commented on GitHub (Feb 16, 2022): It's still Unicode right, so wouldn't something like `re.sub('[^\d\.]', '',currency[0])` work?
Author
Owner

@benbusby commented on GitHub (Feb 16, 2022):

Yep, that works as well

<!-- gh-comment-id:1041847483 --> @benbusby commented on GitHub (Feb 16, 2022): Yep, that works as well
Author
Owner

@DUOLabs333 commented on GitHub (Feb 17, 2022):

Should I make a pull request?

<!-- gh-comment-id:1043361405 --> @DUOLabs333 commented on GitHub (Feb 17, 2022): Should I make a pull request?
Author
Owner

@benbusby commented on GitHub (Feb 17, 2022):

@DUOLabs333 I got it, thanks though

<!-- gh-comment-id:1043625685 --> @benbusby commented on GitHub (Feb 17, 2022): @DUOLabs333 I got it, thanks though
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#407
No description provided.