rommapp / romm

A beautiful, powerful, self-hosted rom manager
https://romm.app
GNU Affero General Public License v3.0
2.04k stars 88 forks source link

[Bug] Empty error message and failure on searching by ID for specific game #835

Closed Perrylicious closed 5 months ago

Perrylicious commented 5 months ago

Edit: this is the same error profile as bug #834, should be merged into that bug

fury RomM version 3.1.0

Describe the bug When trying to identify a specific game by ID from IGDB, an empty error message is thrown and the game can not be identified.

To Reproduce Steps to reproduce the behavior:

  1. Have the amiga-cd32 platform
  2. Have a game called "Fury of the Furries (Europe).chd" in that folder (or a dummy file)
  3. Try to identify this game by searching for its IGDB ID 8212 - found here: https://www.igdb.com/games/fury-of-the-furries
  4. An empty error message is thrown (see attached screenshot). I have attached container logs below. There may be others like this, but this was the first one I came across alphabetically

Expected behavior The game should either not be found on the platform or should be force-added by ID, but an empty error message seems odd. Maybe this can be exception handled. The vast majority of other games that are unidentified can be added without problems so far, even if they're not strictly from the same platform - e.g. adding the details by ID from a sega-saturn game to a ps1 port of that game that can't be found on IGDB for the ps1 platform - and even from within the amiga/amiga-cd32 ecosystem, which is why I thought this was report worthy.

Screenshots See fury.png for empty error message shown to frontend

Desktop (please complete the following information):

Additional context

INFO:     [nginx][2024-05-03 10:46:49]  192.x.x.x - - "GET /api/search/roms?rom_id=17756&search_term=Fury+of+the+Furries&search_by=Name&search_extended=false HTTP/1.1" 200 2 "https://xxx.local/platform/30" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0" rt=2.326 uct="0.000" uht="2.325" urt="2.325"

INFO:     [RomM][2024-05-03 10:46:51] šŸ”Ž Searching metadata providers...

INFO:     [RomM][2024-05-03 10:46:51] Searching by id: 8212

INFO:     [RomM][2024-05-03 10:46:51] šŸŽ® amiga-cd32: Fury of the Furries (Europe).chd

 - "GET /search/roms?rom_id=17756&search_term=8212&search_by=ID&search_extended=false HTTP/1.0" 500

INFO:     [nginx][2024-05-03 10:46:52]  192.x.x.x - - "GET /api/search/roms?rom_id=17756&search_term=8212&search_by=ID&search_extended=false HTTP/1.1" 500 21 "https://xxx.local/platform/30" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0" rt=1.519 uct="0.000" uht="1.519" urt="1.519"

[2024-05-03 10:46:52 +0000] [40] [ERROR] Exception in ASGI application

Traceback (most recent call last):

  File "/backend/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi

    result = await app(  # type: ignore[func-returns-value]

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/backend/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__

    return await self.app(scope, receive, send)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/backend/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__

    await super().__call__(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__

    await self.middleware_stack(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__

    raise exc

  File "/backend/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__

    await self.app(scope, receive, _send)

  File "/backend/handler/auth_handler/middleware.py", line 136, in __call__

    await self.app(scope, receive, send_wrapper)

  File "/backend/lib/python3.11/site-packages/starlette/middleware/authentication.py", line 48, in __call__

    await self.app(scope, receive, send)

  File "/backend/handler/auth_handler/middleware.py", line 17, in __call__

    await super().__call__(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette_csrf/middleware.py", line 72, in __call__

    await self.app(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in __call__

    await self.app(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__

    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app

    raise exc

  File "/backend/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app

    await app(scope, receive, sender)

  File "/backend/lib/python3.11/site-packages/starlette/routing.py", line 758, in __call__

    await self.middleware_stack(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/routing.py", line 778, in app

    await route.handle(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/routing.py", line 299, in handle

    await self.app(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/routing.py", line 79, in app

    await wrap_app_handling_exceptions(app, request)(scope, receive, send)

  File "/backend/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app

    raise exc

  File "/backend/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app

    await app(scope, receive, sender)

  File "/backend/lib/python3.11/site-packages/starlette/routing.py", line 74, in app

    response = await func(request)

               ^^^^^^^^^^^^^^^^^^^

  File "/backend/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app

    raw_response = await run_endpoint_function(

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/backend/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function

    return await dependant.call(**values)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/backend/lib/python3.11/site-packages/starlette/authentication.py", line 84, in async_wrapper

    return await func(*args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/backend/endpoints/search.py", line 81, in search_rom

    merged_dict[item["name"]] = {

                ~~~~^^^^^^^^

KeyError: 'name'
gantoine commented 5 months ago

this'll be fixed in the next release!

gantoine commented 5 months ago

Closing as duplicate of #834