sst icon indicating copy to clipboard operation
sst copied to clipboard

Original error message is hidden and masked as "RangeError: Invalid string length"

Open onhate opened this issue 3 months ago • 13 comments

Before monkey patching @pulumi/cmd/run:

Image

After monkey patching @pulumi/cmd/run:

Image

I also see a spike on the memory of sst from 1.2GB to 4.5GB when calling defaultErrorMessage and the error RangeError: Invalid string length is related to OutOfMemory calling JSON.stringify https://github.com/nodejs/node/issues/13465

This may be a https://github.com/pulumi/pulumi issue, right?

onhate avatar Oct 01 '25 17:10 onhate

Yes, looks like so https://github.com/pulumi/pulumi/issues/20567

onhate avatar Oct 01 '25 17:10 onhate

whats the solution to this one?

kevupton avatar Oct 07 '25 05:10 kevupton

maybe force pulumi version on your package manager

https://github.com/pulumi/pulumi/issues/20567#issuecomment-3329883515

onhate avatar Oct 07 '25 14:10 onhate

I think I may have tracked this down to an issue with util.inspect(... { color: true }) with node 24.7.0. If you're using a very new node version, try node <= 24.6.0.

fiadliel avatar Oct 09 '25 12:10 fiadliel

Combination node 24.5.0 and sst 3.17.14 works

anthonyringoet avatar Oct 10 '25 14:10 anthonyringoet

If you run into this, do the monkey patch like @onhate says and you should see what your real error is. For me, the file was located in .sst/platform/node_modules/@pulumi/pulumi/cmd/run/run.js. I just put log.error(err.message); under the const uncaughtHandler = (err) => {

mattkinnersley avatar Oct 10 '25 14:10 mattkinnersley

Ran into this too, patching logging the error helped. It ended up being a missing secret in the stage I was trying to deploy. I swear there used to be a specific error for the case where a secret isn't yet set in a stage and you attempt a deploy

ReallyBadNews avatar Oct 21 '25 22:10 ReallyBadNews

Going to node 24.5.0 solved it for me

padapada09 avatar Nov 07 '25 00:11 padapada09

Going to node 24.6.0 solved it for me

mgroff2 avatar Nov 07 '25 07:11 mgroff2

maybe force pulumi version on your package manager

pulumi/pulumi#20567 (comment)

Note sure how you would do that in sst context given that sst generates it's own package.json under .sst/platform and regenerate it on every sst install ? Did anyone found a way?

FYI I got the same issue with node v22.21.1 and node v24.11.0 and using node v24.6.0 solved it for me too.

sarod avatar Nov 12 '25 09:11 sarod

Same here, went from Node v24.7.0 to v24.11.1 and finally v24.6.0 worked

JuanICasareski avatar Nov 17 '25 02:11 JuanICasareski

Ran into this too, patching logging the error helped. It ended up being a missing secret in the stage I was trying to deploy. I swear there used to be a specific error for the case where a secret isn't yet set in a stage and you attempt a deploy

Thank you so much, I was pulling my hair out trying to understand why I was getting seemingly unrelated issues following the SST guide here - https://guide.sst.dev/chapters/getting-production-ready.html - which doesn't have the steps in the right order. Absolute hero!

Blakomen avatar Nov 17 '25 11:11 Blakomen

probably fixed by #5944

vimtor avatar Dec 04 '25 20:12 vimtor

just tested against #5944 and the real error shows up

vimtor avatar Dec 10 '25 19:12 vimtor