Skip to content

[Bug] Nintendo DSi ROMs with numeric names and no extension are not scanned correctly #2163

@zeedif

Description

@zeedif

[Bug] Nintendo DSi ROMs with numeric names and no extension are not scanned correctly

RomM version
Specify the version of RomM you are using.

Describe the bug
When scanning Nintendo DSi ROMs, files that have no extension and use numeric names (e.g., 00000001), as specified in No-Intro DATs, are not processed correctly. The RomM scanner appears to fail to detect the file size, registering it as 0 Bytes. This causes a "Network Error" when attempting to play the title with EmulatorJS, as the content download request fails with a 502 (Bad Gateway) error at the server level.

To Reproduce
Steps to reproduce the behavior:

  1. Add a Nintendo DSi (Digital) ROM set containing titles with numeric names and no extension (e.g., "The Legend of Zelda - Four Swords Anniversary Edition").
  2. Go to the "Scan" section in RomM and run a scan for the Nintendo DSi platform.
  3. Once the scan is complete, navigate to the details page of the affected game.
  4. In the "Info" section, observe that the file size is displayed as "0 Bytes".
  5. Attempt to play the game using the EmulatorJS player.
  6. Observe the "Network Error" in the emulator.

Expected behavior
RomM should correctly parse the ROM file, register its actual size, and allow it to be downloaded and played via EmulatorJS without errors.

Screenshots
Here you can see the RomM interface showing a file size of 0 Bytes for the game.
Image

Image Image

Additional context

No-Intro DAT Structure:
The following snippet from a No-Intro .dat file shows how these files are cataloged with numeric names and no extension:

<?xml version="1.0"?>
<datafile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://datomatic.no-intro.org/stuff https://datomatic.no-intro.org/stuff/schema_nointro_datfile_v3.xsd">
	<header>
		<name>Nintendo - Nintendo DSi (Digital) (Retool)</name>
		<description>Nintendo - Nintendo DSi (Digital) (738) (-y) [-AaBbcdkmMPpuv] (20220506-190731) (Retool)</description>
		<version>20220506-190731</version>
		<date>2025-07-11 17-27-20</date>
		<author>aci68, Densetsu, einstein95, Gefflon, Hiccup, jimmsu, Money_114, norkmetnoil577, ohnootp, SonGoku, xuom2, zg</author>
		<homepage>http://www.github.com/unexpectedpanda/retool</homepage>
		<url>https://www.no-intro.org</url>
		<retool>Created by Retool 2.3.9</retool>
		<clrmamepro forcenodump="required"/>
	</header>
	<game name="Legend of Zelda, The - Four Swords Anniversary Edition (USA) (En,Fr,Es)">
		<category>Games</category>
		<description>Legend of Zelda, The - Four Swords Anniversary Edition (USA) (En,Fr,Es)</description>
		<rom name="00000000" size="14496768" crc="0eee2777" md5="e7223ec76a60804205a3ec41bd8a563a" sha1="e0a0086df319f4a921111083fbea18a66527a801"/>
	</game>
	<game name="Zelda no Densetsu - 4-tsu no Tsurugi - 25th Kinen Edition (Japan)">
		<category>Games</category>
		<description>Zelda no Densetsu - 4-tsu no Tsurugi - 25th Kinen Edition (Japan)</description>
		<rom name="00000001" size="14131200" crc="c42b9288" md5="057f5e9dd5451766793b2107894771a9" sha1="f1b663ac2112bac6fbc92142e9b5649b71da0d09"/>
	</game>
</datafile>

Browser Console and Server Logs:
When trying to play, the browser console shows a 502 (Bad Gateway) error. The Nginx logs indicate an issue with mod_zip and the decode.js script.

# Browser Console
emulator.min.js:1 GET https://play.zeedif.zeepubs.com/api/roms/8625/content/Legend%20of%20Zelda,%20The%20-%20Four%20Swords%20Anniversary%20Edition%20(USA)%20(En,Fr,Es)? 502 (Bad Gateway)
emulator.min.js:1 Network Error

# RomM Backend Logs
INFO:     [RomM][rom][2025-07-27 15:46:25] User zeedif is downloading Legend of Zelda, The - Four Swords Anniversary Edition (USA) (En,Fr,Es)
INFO:     [RomM][httptools_impl][2025-07-27 15:46:25] 192.168.1.67:0 - "GET /api/roms/8625/content/Legend%20of%20Zelda%2C%20The%20-%20Four%20Swords%20Anniversary%20Edition%20%28USA%29%20%28En%2CFr%2CEs%29 HTTP/1.0" 200

# Nginx Error Logs
2025/07/27 15:46:25 [error] 66#66: *2152 mod_zip: a subrequest returned 400, aborting..., client: 172.18.0.250, server: localhost, request: "GET /api/roms/8625/content/Legend%20of%20Zelda,%20The%20-%20Four%20Swords%20Anniversary%20Edition%20(USA)%20(En,Fr,Es)? HTTP/1.1", subrequest: "/decode", host: "play.zeedif.zeepubs.com", referrer: "https://play.zeedif.zeepubs.com/rom/8625/ejs"
INFO:     [RomM][nginx][2025-07-27 15:46:25] 172.18.0.250 | 192.168.1.67 | GET /api/roms/8625/content/Legend%20of%20Zelda,%20The%20-%20Four%20Swords%20Anniversary%20Edition%20(USA)%20(En,Fr,Es)? 200 | 0 | Chrome Windows | 0.038
2025/07/27 15:46:25 [error] 66#66: *2152 js exception: Error: failed to send response at Request.return (native) at decodeBase64 (/etc/nginx/js/decode.js:7), client: 172.18.0.250, server: localhost, request: "GET /api/roms/8625/content/Legend%20of%20Zelda,%20The%20-%20Four%20Swords%20Anniversary%20Edition%20(USA)%20(En,Fr,Es)? HTTP/1.1", subrequest: "/decode", host: "play.zeedif.zeepubs.com", referrer: "https://play.zeedif.zeepubs.com/rom/8625/ejs"
2025/07/27 15:46:25 [error] 66#66: *2152 mod_zip: a subrequest returned 500, aborting..., client: 172.18.0.250, server: localhost, request: "GET /api/roms/8625/content/Legend%20of%20Zelda,%20The%20-%20Four%20Swords%20Anniversary%20Edition%20(USA)%20(En,Fr,Es)? HTTP/1.1", subrequest: "/decode", host: "play.zeedif.zeepubs.com", referrer: "https://play.zeedif.zeepubs.com/rom/8625/ejs"

The issue seems to originate in the scanner, which is not correctly determining the file size, leading to failures in the download and playback process chain.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions