mirror of
https://github.com/benbusby/whoogle-search.git
synced 2026-04-25 12:15:50 +03:00
[GH-ISSUE #642] [BUG] search for bitcoin gives Internal Server Error #407
Labels
No labels
Fixed (Pending PR Merge)
Stale
bug
enhancement
enhancement
good first issue
help wanted
keep-open
needs more info
pull-request
question
theme
unfortunate
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/whoogle-search#407
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
Deployment Method
Version of Whoogle Search
Desktop (please complete the following information):
Smartphone (please complete the following information):
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'
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
@DUOLabs333 commented on GitHub (Feb 4, 2022):
(Possibly) related: only on "bitcoin" does
WHOOGLE_MINIMALnot work? Maybe "bitcoin" is interfering somehow?@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?@DUOLabs333 commented on GitHub (Feb 4, 2022):
Can you show us the log?
@eddik1970 commented on GitHub (Feb 4, 2022):
how do I find the log in a docker container?
@DUOLabs333 commented on GitHub (Feb 4, 2022):
It should be with
docker logs, but I'm not sure.@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)?
@DUOLabs333 commented on GitHub (Feb 4, 2022):
Weird, I can't get the problem to show up with any other currency, crypto or otherwise.
@eddik1970 commented on GitHub (Feb 7, 2022):
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.
@DUOLabs333 commented on GitHub (Feb 11, 2022):
@eddik1970 Can you try the
latesttag?@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'
@DUOLabs333 commented on GitHub (Feb 16, 2022):
Oh, seems simple enough to fix -- just have to remove non numeric characters (except periods of course).
@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 a0. So it'd probably be better to fix like:Might need further sanitizing though, I haven't looked yet.
@DUOLabs333 commented on GitHub (Feb 16, 2022):
It's still Unicode right, so wouldn't something like
re.sub('[^\d\.]', '',currency[0])work?@benbusby commented on GitHub (Feb 16, 2022):
Yep, that works as well
@DUOLabs333 commented on GitHub (Feb 17, 2022):
Should I make a pull request?
@benbusby commented on GitHub (Feb 17, 2022):
@DUOLabs333 I got it, thanks though