Skip to content

[Bug] Scan fails with FileNotFoundError when ScreenScraper cover fetch fails #2247

@clodobox

Description

@clodobox

RomM version
4.0.1

Describe the bug
During a scan, if the download of a cover image from ScreenScraper fails, RomM still attempts to open the local image that was supposed to have been downloaded (small.png) and crashes with a FileNotFoundError. The RQ job fails and the scan is interrupted.

How to replicate the bug
Simply start a scan by selecting Screenscraper only or with other services in a large ROM folder.
After a few minutes, the error occurs.

Logs

romm     | INFO:          [RomM][hasheous_handler][2025-08-10 15:46:45] No RA ID provided for Hasheous RA game lookup.
romm     | INFO:          [RomM][scan][2025-08-10 15:46:50] Gravity (Europe).zip identified as Gravity 👾
romm     | INFO:          [RomM][hasheous_handler][2025-08-10 15:46:52] No IGDB ID provided for Hasheous IGDB game lookup.
romm     | INFO:          [RomM][hasheous_handler][2025-08-10 15:46:52] No RA ID provided for Hasheous RA game lookup.
romm     | INFO:          [RomM][scan][2025-08-10 15:46:58] Growth (Europe).zip identified as Growth 👾
romm     | INFO:          [RomM][hasheous_handler][2025-08-10 15:46:58] No IGDB ID provided for Hasheous IGDB game lookup.
romm     | INFO:          [RomM][hasheous_handler][2025-08-10 15:46:58] No RA ID provided for Hasheous RA game lookup.
romm     | INFO:          [RomM][scan][2025-08-10 15:47:02] Guardian Angel (Europe).zip identified as Guardian Angel 👾
romm     | INFO:          [RomM][websockets_impl][2025-08-10 15:47:37]  - "WebSocket /ws/socket.io/?EIO=4&transport=websocket" [accepted]
romm     | ERROR:         [RomM][resources_handler][2025-08-10 15:49:03] Unable to fetch cover at https://neoclone.screenscraper.fr/api2/mediaJeu.php?devid=[confidential]&devpassword=[confidential]&softname=romm&ssid=[confidential]&sspassword=[confidential]&systemeid=42&jeuid=31305&media=box-2D(eu):
romm     | ERROR:         [RomM][scan][2025-08-10 15:49:03] Error in scan_platform: [Errno 2] No such file or directory: '/romm/resources/roms/1/121/cover/small.png'
romm     | ERROR:         [RomM][worker][2025-08-10 15:49:03] [Job d028403e-33ae-42e2-b127-0fd80fb23608]: exception raised while executing (endpoints.sockets.scan.scan_platforms)
romm     | Traceback (most recent call last):
romm     |   File "/src/.venv/lib/python3.13/site-packages/rq/worker.py", line 1643, in perform_job
romm     |     return_value = job.perform()
romm     |   File "/src/.venv/lib/python3.13/site-packages/rq/job.py", line 1359, in perform
romm     |     self._result = self._execute()
romm     |                    ~~~~~~~~~~~~~^^
romm     |   File "/src/.venv/lib/python3.13/site-packages/rq/job.py", line 1396, in _execute
romm     |     coro_result = loop.run_until_complete(result)
romm     |   File "/usr/local/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
romm     |     return future.result()
romm     |            ~~~~~~~~~~~~~^^
romm     |   File "/usr/local/lib/python3.13/contextlib.py", line 101, in inner
romm     |     return await func(*args, **kwds)
romm     |            ^^^^^^^^^^^^^^^^^^^^^^^^^
romm     |   File "/backend/endpoints/sockets/scan.py", line 517, in scan_platforms
romm     |     raise e
romm     |   File "/backend/endpoints/sockets/scan.py", line 492, in scan_platforms
romm     |     scan_stats += await _identify_platform(
romm     |                   ^^^^^^^^^^^^^^^^^^^^^^^^^
romm     |     ...<6 lines>...
romm     |     )
romm     |     ^
romm     |   File "/backend/endpoints/sockets/scan.py", line 402, in _identify_platform
romm     |     scan_stats += await _identify_rom(
romm     |                   ^^^^^^^^^^^^^^^^^^^^
romm     |     ...<7 lines>...
romm     |     )
romm     |     ^
romm     |   File "/backend/endpoints/sockets/scan.py", line 270, in _identify_rom
romm     |     path_cover_s, path_cover_l = await fs_resource_handler.get_cover(
romm     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
romm     |     ...<3 lines>...
romm     |     )
romm     |     ^
romm     |   File "/backend/handler/filesystem/resources_handler.py", line 108, in get_cover
romm     |     await self._store_cover(entity, url_cover, CoverSize.SMALL)
romm     |   File "/backend/handler/filesystem/resources_handler.py", line 81, in _store_cover
romm     |     with Image.open(image_path) as img:
romm     |          ~~~~~~~~~~^^^^^^^^^^^^
romm     |   File "/src/.venv/lib/python3.13/site-packages/PIL/Image.py", line 3431, in open
romm     |     fp = builtins.open(filename, "rb")
romm     | FileNotFoundError: [Errno 2] No such file or directory: '/romm/resources/roms/1/121/cover/small.png'
romm     |
romm     |
romm-db  | 2025-08-10 15:49:03 1762 [Warning] Aborted connection 1762 to db: 'romm' user: 'romm-user' host: '192.168.32.3' (Got an error reading communication packets)
romm     | INFO:          [RomM][worker][2025-08-10 15:49:03] Cleaning registries for queue: high
romm     | INFO:          [RomM][worker][2025-08-10 15:49:03] Cleaning registries for queue: default
romm     | INFO:          [RomM][worker][2025-08-10 15:49:03] Cleaning registries for queue: low

Server:

  • OS: DSM 7.2.2-72806 Update 3

Additional context

Docker-Compose :

services:
  romm:
    image: rommapp/romm:latest
    container_name: romm
    restart: unless-stopped
    environment:
      - IGDB_CLIENT_ID=[confidential]
      - IGDB_CLIENT_SECRET=[confidential]
      - DB_HOST=romm-db
      - DB_PASSWD=[confidential]
      - DB_USER=romm-user
      - DB_NAME=romm
      - ROMM_AUTH_SECRET_KEY=[confidential]
      - SCREENSCRAPER_USER=[confidential]
      - SCREENSCRAPER_PASSWORD=[confidential]
      - RETROACHIEVEMENTS_API_KEY=[confidential]
      - STEAMGRIDDB_API_KEY=[confidential]
      - HASHEOUS_API_ENABLED=true
    volumes:
      - ./romm_resources:/romm/resources
      - ./romm_redis_data:/redis-data
      - /volume1/Tools/Logiciel/Jeux/ROMs/Romm:/romm/library
      - ./assets:/romm/assets
      - ./config:/romm/config
    ports:
      - 8070:8080
    network_mode: rommbridge
    depends_on:
      romm-db:
        condition: service_healthy
        restart: true
  romm-db:
    image: mariadb:latest
    container_name: romm-db
    restart: unless-stopped
    environment:
      - MARIADB_ROOT_PASSWORD=[confidential]
      - MARIADB_DATABASE=romm
      - MARIADB_USER=romm-user
      - MARIADB_PASSWORD=[confidential]
    ports:
      - 3309:3306
    network_mode: rommbridge
    volumes:
      - ./dbdata:/var/lib/mysql
    healthcheck:
      test:
        - CMD
        - healthcheck.sh
        - --connect
        - --innodb_initialized
      start_period: 30s
      # start_interval: 10s
      interval: 10s
      timeout: 5s
      retries: 5
networks: {}

Other info :

  • I have a Screenscraper “donor” account with 6 simultaneous streams available for download.
  • I applied the file permission changes for Synology as indicated in the help section.
  • When scanning without using Screenscaper, everything works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions