[GH-ISSUE #987] [BUG] binascii.Error: Incorrect padding #612

Closed
opened 2026-02-25 20:36:08 +03:00 by kerem · 6 comments
Owner

Originally created by @un99known99 on GitHub (Apr 14, 2023).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/987

searching via whoogle, clicking in result list from ALL (ALLE) to PICTURES (BILDER):

grafik

grafik

same for "weiter" / continue, trying to see more search results:

grafik

Getting error in logfile:

pi@pihole:[/var/log] $ cat whoogle.log

ERROR:app:Exception on /search [GET]
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 1818, in full_dispatch_request
rv = self.preprocess_request()
File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 2309, in preprocess_request
rv = self.ensure_sync(before_func)()
File "/home/pi/.local/lib/python3.9/site-packages/app/routes.py", line 158, in before_request_func
g.user_config = g.user_config.from_params(g.request_params)
File "/home/pi/.local/lib/python3.9/site-packages/app/models/config.py", line 143, in from_params
params_new = self._decode_preferences(params['preferences'])
File "/home/pi/.local/lib/python3.9/site-packages/app/models/config.py", line 214, in _decode_preferences
brotli.decompress(urlsafe_b64decode(preferences.encode()))
File "/usr/lib/python3.9/base64.py", line 133, in urlsafe_b64decode
return b64decode(s)
File "/usr/lib/python3.9/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

Originally created by @un99known99 on GitHub (Apr 14, 2023). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/987 searching via whoogle, clicking in result list from ALL (ALLE) to PICTURES (BILDER): ![grafik](https://user-images.githubusercontent.com/1615207/232121701-43901278-032e-422e-b1e8-be59e4671504.png) ![grafik](https://user-images.githubusercontent.com/1615207/232121018-03070f80-3703-403b-b4f9-2a8e91d5b833.png) same for "weiter" / continue, trying to see more search results: ![grafik](https://user-images.githubusercontent.com/1615207/232219468-fd1cc80b-3413-4423-b9a6-997914129a06.png) Getting error in logfile: pi@pihole:[/var/log] $ cat whoogle.log ERROR:app:Exception on /search [GET] Traceback (most recent call last): File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app response = self.full_dispatch_request() File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 1818, in full_dispatch_request rv = self.preprocess_request() File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 2309, in preprocess_request rv = self.ensure_sync(before_func)() File "/home/pi/.local/lib/python3.9/site-packages/app/routes.py", line 158, in before_request_func g.user_config = g.user_config.from_params(g.request_params) File "/home/pi/.local/lib/python3.9/site-packages/app/models/config.py", line 143, in from_params params_new = self._decode_preferences(params['preferences']) File "/home/pi/.local/lib/python3.9/site-packages/app/models/config.py", line 214, in _decode_preferences brotli.decompress(urlsafe_b64decode(preferences.encode())) File "/usr/lib/python3.9/base64.py", line 133, in urlsafe_b64decode return b64decode(s) File "/usr/lib/python3.9/base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Incorrect padding
kerem 2026-02-25 20:36:08 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@un99known99 commented on GitHub (Apr 15, 2023):

might be revealed again => https://github.com/benbusby/whoogle-search/issues/910

<!-- gh-comment-id:1509746856 --> @un99known99 commented on GitHub (Apr 15, 2023): might be revealed again => https://github.com/benbusby/whoogle-search/issues/910
Author
Owner

@un99known99 commented on GitHub (Apr 15, 2023):

Seems Whoogle not working properly together with Firefox, cant get the search work correctly, seems to be ok for Vivaldi and Brave for example.

Is this known issue that FF desktop not working properly with Whoogle?

<!-- gh-comment-id:1509752324 --> @un99known99 commented on GitHub (Apr 15, 2023): Seems Whoogle not working properly together with Firefox, cant get the search work correctly, seems to be ok for Vivaldi and Brave for example. Is this known issue that FF desktop not working properly with Whoogle?
Author
Owner

@un99known99 commented on GitHub (Apr 21, 2023):

anyone able to help?

<!-- gh-comment-id:1517653976 --> @un99known99 commented on GitHub (Apr 21, 2023): anyone able to help?
Author
Owner

@un99known99 commented on GitHub (May 11, 2023):

any help here? Still the error:

ERROR:app:Exception on /search [GET]
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 1818, in full_dispatch_request
rv = self.preprocess_request()
File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 2309, in preprocess_request
rv = self.ensure_sync(before_func)()
File "/home/pi/.local/lib/python3.9/site-packages/app/routes.py", line 158, in before_request_func
g.user_config = g.user_config.from_params(g.request_params)
File "/home/pi/.local/lib/python3.9/site-packages/app/models/config.py", line 143, in from_params
params_new = self._decode_preferences(params['preferences'])
File "/home/pi/.local/lib/python3.9/site-packages/app/models/config.py", line 214, in _decode_preferences
brotli.decompress(urlsafe_b64decode(preferences.encode()))
File "/usr/lib/python3.9/base64.py", line 133, in urlsafe_b64decode
return b64decode(s)
File "/usr/lib/python3.9/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

<!-- gh-comment-id:1543701281 --> @un99known99 commented on GitHub (May 11, 2023): any help here? Still the error: ERROR:app:Exception on /search [GET] Traceback (most recent call last): File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app response = self.full_dispatch_request() File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 1818, in full_dispatch_request rv = self.preprocess_request() File "/home/pi/.local/lib/python3.9/site-packages/flask/app.py", line 2309, in preprocess_request rv = self.ensure_sync(before_func)() File "/home/pi/.local/lib/python3.9/site-packages/app/routes.py", line 158, in before_request_func g.user_config = g.user_config.from_params(g.request_params) File "/home/pi/.local/lib/python3.9/site-packages/app/models/config.py", line 143, in from_params params_new = self._decode_preferences(params['preferences']) File "/home/pi/.local/lib/python3.9/site-packages/app/models/config.py", line 214, in _decode_preferences brotli.decompress(urlsafe_b64decode(preferences.encode())) File "/usr/lib/python3.9/base64.py", line 133, in urlsafe_b64decode return b64decode(s) File "/usr/lib/python3.9/base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Incorrect padding
Author
Owner

@benbusby commented on GitHub (May 19, 2023):

Hi, sorry for the delay! I believe the issue you're encountering should be fixed now, although I wasn't able to reproduce it on my end unfortunately. The preferences string should be encoded correctly (and therefore have the correct padding), but perhaps Firefox is stripping the padding from the param?

In any case, padding is now manually appended to the end of the value, which should fix this for you. Let me know if I can help further.

<!-- gh-comment-id:1555021479 --> @benbusby commented on GitHub (May 19, 2023): Hi, sorry for the delay! I believe the issue you're encountering should be fixed now, although I wasn't able to reproduce it on my end unfortunately. The preferences string should be encoded correctly (and therefore have the correct padding), but perhaps Firefox is stripping the padding from the param? In any case, padding is now manually appended to the end of the value, which should fix this for you. Let me know if I can help further.
Author
Owner

@un99known99 commented on GitHub (May 27, 2023):

@benbusby - many thanks for the feedback, it is indeed a bit strange, other browser apart from FF (vivaldi, brave, etc.) are doing ok - on desktop, on mobile all are in fact OK, even FF

If I could provide more info just let me know.

So the fix you mentioned will be in 0.8.3?

<!-- gh-comment-id:1565594111 --> @un99known99 commented on GitHub (May 27, 2023): @benbusby - many thanks for the feedback, it is indeed a bit strange, other browser apart from FF (vivaldi, brave, etc.) are doing ok - on desktop, on mobile all are in fact OK, even FF If I could provide more info just let me know. So the fix you mentioned will be in 0.8.3?
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#612
No description provided.