Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Missing hash key: "browseEndpoint" (KeyError) #4133

Closed
cd-FileX opened this issue Oct 1, 2023 · 3 comments · Fixed by #3869
Closed

[Bug] Missing hash key: "browseEndpoint" (KeyError) #4133

cd-FileX opened this issue Oct 1, 2023 · 3 comments · Fixed by #3869
Labels
bug Something isn't working

Comments

@cd-FileX
Copy link

cd-FileX commented Oct 1, 2023

Describe the bug

error when searching for watch:<specific video code>.

Did not occur on kpGdeUE26Dk.

Steps to Reproduce
Steps to reproduce the behavior:

  1. Search for watch:-opPozIBXqM
  2. See error

Logs

Title: Missing hash key: "browseEndpoint" (KeyError)
Date: 2023-10-01T02:17:17Z
Route: /search?q=watch%3A-opPozIBXqM
Version: 2023.09.18-bb14f79 @ master

Backtrace

Missing hash key: "browseEndpoint" (KeyError)
  from /usr/share/crystal/src/hash.cr:1080:9 in '[]'
  from src/invidious/yt_backend/extractors.cr:61:13 in 'process'
  from src/invidious/yt_backend/extractors.cr:843:17 in 'parse_item'
  from src/invidious/yt_backend/extractors.cr:890:14 in 'extract_items'
  from src/invidious/search/processors.cr:12:18 in 'process'
  from src/invidious/routes/search.cr:55:17 in 'search'
  from src/invidious/helpers/handlers.cr:30:37 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/fiber.cr:146:11 in 'run'
  from ???

Screenshots

Additional context

Instance: yt.artemislena.eu
Browser: Firefox
OS: Windows

@cd-FileX cd-FileX added the bug Something isn't working label Oct 1, 2023
@RadoslavL
Copy link
Contributor

RadoslavL commented Oct 6, 2023

I can't reproduce the error on any other Invidious instance. It doesn't occur on yewtu.be, and just returns unrelated videos. It seems that searching the "-opPozIBXqM" video ID doesn't work on YouTube as well.

@mk-pmb
Copy link

mk-pmb commented Dec 5, 2023

I found a similar bug just now on vid.puffyan.us for two search terms. They reliably reproduce the key error there but work perfectly on other instances. Maybe it's site-specific due to a different salt being used or random number generator seed at startup or something? Or is the instance name a part of the hash input?

It seems the Crystal Language has quite a lot of "Missing hash key" issues, some closed due to inability to reproduce. This might indicate that it's something not specific to iv.

@weebee42
Copy link

weebee42 commented Jan 29, 2024

I got the same bug, well reproducible on 6 (german) instances with 3 different SW versions (2023.12.06-9e8baa35, 2024.01.29-c005ada, 2024.01.10-1c0b420). The backtrace from the first appears a bit more verbose to me. I hope, this may give some more insight:

Title: `Missing hash key: "browseEndpoint" (KeyError)`
Date: `2024-01-29T14:22:38Z`
Route: `/search?q=Geheimes+Kuba`
Version: `2024.01.10-1c0b420 @ master`

Missing hash key: "browseEndpoint" (KeyError)
  from /usr/share/crystal/src/hash.cr:1172:11 in '[]'
  from /usr/share/crystal/src/json/any.cr:115:7 in '[]'
  from /usr/share/crystal/src/json/any.cr:151:5 in 'dig'
  from /usr/share/crystal/src/json/any.cr:151:5 in 'dig'
  from src/invidious/yt_backend/extractors.cr:827:12 in 'get_browse_id'
  from src/invidious/yt_backend/extractors.cr:60:9 in 'parse'
  from src/invidious/yt_backend/extractors.cr:49:16 in 'process'
  from src/invidious/yt_backend/extractors.cr:845:17 in 'parse_item'
  from src/invidious/yt_backend/extractors.cr:892:14 in 'extract_items'
  from src/invidious/search/processors.cr:12:18 in 'regular'
  from src/invidious/search/query.cr:116:9 in 'process'
  from src/invidious/routes/search.cr:55:17 in 'search'
  from src/invidious/routing.cr:184:20 in '->'
  from lib/kemal/src/kemal/route.cr:12:26 in '->'
  from src/invidious/helpers/handlers.cr:30:5 in 'process_request'
  from lib/kemal/src/kemal/route_handler.cr:17:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from lib/kemal/src/kemal/websocket_handler.cr:13:14 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30: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:30:7 in 'call_next'
  from src/invidious/helpers/handlers.cr:212:5 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from src/invidious/helpers/handlers.cr:94:12 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from src/invidious/helpers/handlers.cr:145:12 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from src/invidious/helpers/handlers.cr:70:5 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from src/ext/kemal_static_file_handler.cr:162:16 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from lib/kemal/src/kemal/exception_handler.cr:8:7 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from src/invidious/helpers/logger.cr:17:35 in 'call'
  from /usr/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
  from lib/kemal/src/kemal/init_handler.cr:12:7 in 'call'
  from /usr/share/crystal/src/http/server/request_processor.cr:51:11 in 'process'
  from /usr/share/crystal/src/http/server.cr:521:5 in 'handle_client'
  from /usr/share/crystal/src/http/server.cr:451:5 in '->'
  from /usr/share/crystal/src/fiber.cr:146:11 in 'run'
  from /usr/share/crystal/src/fiber.cr:98:34 in '->'
  from ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants