sfdx-hardis icon indicating copy to clipboard operation
sfdx-hardis copied to clipboard

Running into maximum call stack size exceeded error

Open guan-tay opened this issue 2 years ago • 10 comments

Greetings!

I have been used SFDX-Hardis for some time to run the Legacy API checking and I love this feature :) However, when I ran this today, and a week ago, I kept running into an issue "Running into maximum call stack size exceeded"

image

I believe this was caused by the sheer amount of API calls in the SF orgs. Any suggestions on how to get around this?

Thanks, Guan

guan-tay avatar Nov 29 '22 21:11 guan-tay

Hi @guan-tay , thanks for your support and for reporting the issue :)

Please can you :

  1. run the same command with --debug argument and share the log here ?

  2. Also running with --dev-debug would provide a huge log but be eventually helpful :)

nvuillam avatar Nov 30 '22 04:11 nvuillam

thanks @nvuillam for the suggestion! However, i was using the one click button to run the command, so not sure how to add the -debug argument in the part where it calling org API to get the CSV Content of each evenlogfile record

image

guan-tay avatar Nov 30 '22 05:11 guan-tay

In the terminal, type on the up arrow of your keyboard, it will bring back previously run command

Then add --debug at the end, then type enter and you're good to go :)

nvuillam avatar Nov 30 '22 05:11 nvuillam

not sure if this help, here are the results i received from the --dev-debug image image let me know if you need other details :) thanks!

guan-tay avatar Nov 30 '22 05:11 guan-tay

Thanks for the details ! There is a default limit to 999, but it's probably too much

Please can you try to run the command with --limit 200 ?

nvuillam avatar Nov 30 '22 11:11 nvuillam

( and if it does not work, try --limit 100 or event --limit 50 , but anyway it will require an update to make the command able to process all the logs undepending their number )

nvuillam avatar Nov 30 '22 11:11 nvuillam

thanks for the suggestion @nvuillam ! I did another try and run using limit 50, image I still run into the same error. Maybe it was because the retrieved content was too big?

guan-tay avatar Dec 05 '22 00:12 guan-tay

That's really strange... we'll try to have a look :/

nvuillam avatar Dec 20 '22 20:12 nvuillam

Hi @nvuillam I am also getting the same error message and tried --limit 10. Any suggestion on how this can be fixed?

talibraza avatar Apr 02 '23 13:04 talibraza

@guan-tay @talibraza do one of you have some Typescript expertise ?

I can't reproduce the issue, but it has to be reproduced to be debugged

Info to do that -> https://github.com/hardisgroupcom/sfdx-hardis#contributing

Then put a breakpoint in legacyapi.ts -> https://github.com/hardisgroupcom/sfdx-hardis/blob/main/src/commands/hardis/org/diagnose/legacyapi.ts

Then run NODE__OPTIONS=--inspect-brk sfdx hardis:org:diagnose:legacyapi

And see from where is this max call stack

nvuillam avatar Apr 02 '23 15:04 nvuillam