Original error message is hidden and masked as "RangeError: Invalid string length"
Before monkey patching @pulumi/cmd/run:
After monkey patching @pulumi/cmd/run:
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?
Yes, looks like so https://github.com/pulumi/pulumi/issues/20567
whats the solution to this one?
maybe force pulumi version on your package manager
https://github.com/pulumi/pulumi/issues/20567#issuecomment-3329883515
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.
Combination node 24.5.0 and sst 3.17.14 works
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) => {
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
Going to node 24.5.0 solved it for me
Going to node 24.6.0 solved it for me
maybe force pulumi version on your package manager
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.
Same here, went from Node v24.7.0 to v24.11.1 and finally v24.6.0 worked
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!
probably fixed by #5944
just tested against #5944 and the real error shows up