iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.07k stars 1.77k forks source link

[Bug] Arithmetic overflow (OverflowError) when Performing Simple Search for Content #3451

Closed stellarpower closed 1 year ago

stellarpower commented 1 year ago

Describe the bug

Get an overflow somehow, when I perform certain searches. Not managed to find an MRPE yet. I thought it was using numbers in the search, but luckily Crystal ain't JS and seems to be unrelated. I just know the URL below results in errors.

I would guess that might be some youtube API changes - perhaps e.g. intermingling of channels and videos; the search term may need to bring back some different kinds of results (video, channel, user) to trigger this. Total guess though.

Steps to Reproduce Simply perform a search using DuckDuckGo bangs or whatever: https://yewtu.be/search?q=three+blue+one+brown https://yewtu.be/search?q=3+blue+one+brown https://yewtu.be/search?q=three+blue+1+brown etc.

Logs

Title: Arithmetic overflow (OverflowError) Date: 2022-11-29T22:32:19Z Route: /search?q=3+blue+brown+1+fourier Version: 2022.11.29-fdb4060 @ master

Backtrace

``` Arithmetic overflow (OverflowError) from src/invidious/yt_backend/extractors_utils.cr:18 in 'process' from src/invidious/yt_backend/extractors.cr:707:17 in 'extract_item' from src/invidious/yt_backend/extractors.cr:738:28 in 'extract_items' from src/invidious/search/processors.cr:12:14 in 'process' from src/invidious/routes/search.cr:56:7 in 'search' from lib/kemal/src/kemal/config.cr:92:7 in 'call' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call_next' from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call_next' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call_next' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call_next' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call_next' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call_next' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call' from /usr/lib/crystal/core/http/server/handler.cr:28:7 in 'call_next' from lib/kemal/src/kemal/init_handler.cr:12:7 in 'process' from /usr/lib/crystal/core/http/server.cr:500:5 in '->' from /usr/lib/crystal/core/fiber.cr:146:11 in 'run' from /src/boringssl/src/google-boringssl-251b516/ssl/internal.h:334:8 in '??' ```

Screenshots

Additional context

SamantazFox commented 1 year ago

thanks for reporting ^^

DUOLabs333 commented 1 year ago

This should be fixed by PR #3535.

DUOLabs333 commented 1 year ago

This seems to be caused by any user who has a number in their name, probably due to the fact that short_text_to_number does not have anchors (my PR should make that irrelevant though).

snowc0de commented 1 year ago

Hello, for some reason, hello I just encountered this bug too:

Logs

Title: Arithmetic overflow (OverflowError) Date: 2023-01-15T19:28:07Z Route: /search?q=3b1b Version: 2022.11.22-5160d8ba @ master

Backtrace

``` Arithmetic overflow (OverflowError) from src/invidious/yt_backend/extractors.cr:173:63 in 'process' from src/invidious/yt_backend/extractors.cr:707:17 in 'extract_item' from src/invidious/yt_backend/extractors.cr:738:28 in 'extract_items' from src/invidious/search/processors.cr:12:14 in 'process' from src/invidious/routes/search.cr:55:18 in 'search' from /usr/share/crystal/src/primitives.cr:266:3 in 'call' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next' from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call' from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next' from lib/kemal/src/kemal/init_handler.cr:12:7 in 'process' from /usr/share/crystal/src/http/server.cr:500:5 in '->' from /usr/share/crystal/src/primitives.cr:266:3 in 'run' from ??? ```

For some reason it's again looking for 3 blue 1 brown xD And I don't really have that for other channels as far as I know

stellarpower commented 1 year ago

I was just playing around with some other queries that work fine - but to confirm., it's the user ID that the number needs to be, so the actual query isn't really the root cause here?

DUOLabs333 commented 1 year ago

Yes, if a channel with a number in its name is returned, the error will occur.

elithorn commented 1 year ago

IDK if it's relevant but I just reproduced it in 7f279cf I tried to search for commit by hash to verify it's not from outdated build but couldn't find it Sorry to bother you if it's already fixed

Title: `Arithmetic overflow (OverflowError)`
Date: `2023-01-22T16:29:53Z`
Route: `/search?q=adric22`
Version: `2023.01.20-7f279cf @ master`