question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RangeError: "size" argument must not be larger than 2147483647

See original GitHub issue

I’m getting the following error when trying to read tags from a 9.7MB MP3:

RangeError: "size" argument must not be larger than 2147483647
    at Function.Buffer.alloc (buffer.js:229:3)
    at new Buffer (buffer.js:152:19)
    at NodeID3.getTagsFromBuffer (.../node_modules/node-id3/index.js:318:31)
    at NodeID3.read (.../node_modules/node-id3/index.js:226:25)
    at Object.<anonymous> (.../index.js:40:24)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)

Snippet:

const file = 'sample.mp3'

const buf = fs.readFileSync(file)
console.log(buf.length)
// 9673454 

try {
    let tags = NodeID3.read(file)
} catch (err) {
    console.log(err)
}

Environment:

  • OSX - 10.12.6
  • Node - 8.5.0
  • node-id3 - 0.1.3

Update:

I added console.log(bodyFrameHeader.toString('utf8', 0, 4) + ' ' + bodyFrameSize) to try to debug what was flagging the size limit; here’s the output:

TPE2 29
TPOS 9
WCOP 17
WOAR 40
TLEN 4
TMED 29
TXXX 29
TXXX 31
TXXX 39
TXXX 59
TXXX 31
TXXX 37
TXXX 25
GEOB 100
TXXX 31
GEOB 110
PRIV 334456
�� 3363242937

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Zazamacommented, Sep 12, 2018
0reactions
towfiqicommented, Sep 13, 2018

Great! Thanks for the quick fix 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

RangeError: "size" argument must not be larger than #368
But I just upgraded to 0.7.4 and got this error message: RangeError: "size" argument must not be larger than 2147483...
Read more >
Javascript Read large files failed - Stack Overflow
Hi @robertklep, I am writing a CLI app, where I need to parse a big JSON file, and respond to the user. ·...
Read more >
Developers - RangeError: "size" argument must not be larger than -
This was a one time error. So I'm just gonna put it here as an FYI instead of a thorough report due to...
Read more >
Node.js Error Handling - ERR_BUFFER_TOO_LARGE
An ERR_BUFFER_TOO_LARGE error indicates that an attempt was made to instantiate or allocate a Buffer object of a size exceeding the current ...
Read more >
Node.js v6.2.0 Documentation
Passing a number as the first argument to Buffer() (e.g. new Buffer(10) ), allocates a new Buffer object of the specified size. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found