Repository navigation
Closed
Description
Summary
Cannot generate a full manifest file on a huge org while it's working on smaller orgs.
Steps To Reproduce
Run this command on a huge org: sf project generate manifest --output-dir manifest --name=allMetadata --from-org {ORG}
Expected result
Manifest generated
Actual result
{
"name": "RangeError",
"message": "Maximum call stack size exceeded",
"exitCode": 1,
"context": "ManifestGenerate",
"stack": "RangeError: Maximum call stack size exceeded\n at SfCommandError.from (file://~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/SfCommandError.js:39:16)\n at ManifestGenerate.catch (file://~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/sfCommand.js:316:47)\n at ManifestGenerate._run (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/node_modules/@oclif/core/lib/command.js:316:29)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Config.runCommand (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:435:25)\n at async run (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:96:16)\n at async file://~/.npm-global/lib/node_modules/@salesforce/cli/bin/run.js:15:1",
"cause": "RangeError: Maximum call stack size exceeded\n at sendIt (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/source-deploy-retrieve/lib/src/resolve/connectionResolver.js:132:35)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async ConnectionResolver.sendBatchedRequests (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/source-deploy-retrieve/lib/src/resolve/connectionResolver.js:156:17)\n at async ConnectionResolver.resolve (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/source-deploy-retrieve/lib/src/resolve/connectionResolver.js:70:39)\n at async ComponentSet.fromConnection (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/source-deploy-retrieve/lib/src/collections/componentSet.js:215:26)\n at async ComponentSetBuilder.build (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/source-deploy-retrieve/lib/src/collections/componentSetBuilder.js:147:37)\n at async ManifestGenerate.run (file://~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/plugin-deploy-retrieve/lib/commands/project/generate/manifest.js:103:30)\n at async ManifestGenerate._run (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/node_modules/@oclif/core/lib/command.js:312:22)\n at async Config.runCommand (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:435:25)\n at async run (~/.npm-global/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:96:16)",
"warnings": [],
"code": "1",
"status": 1,
"commandName": "ManifestGenerate"
}System Information
{
"architecture": "darwin-x64",
"cliVersion": "@salesforce/cli/2.73.9",
"nodeVersion": "node-v20.12.2",
"osVersion": "Darwin 24.2.0",
"rootPath": "~/.npm-global/lib/node_modules/@salesforce/cli",
"shell": "zsh",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.17 (core)",
"@oclif/plugin-commands 4.1.16 (core)",
"@oclif/plugin-help 6.2.21 (core)",
"@oclif/plugin-not-found 3.2.35 (core)",
"@oclif/plugin-plugins 5.4.25 (core)",
"@oclif/plugin-search 1.2.18 (core)",
"@oclif/plugin-update 4.6.23 (core)",
"@oclif/plugin-version 2.2.20 (core)",
"@oclif/plugin-warn-if-update-available 3.1.30 (core)",
"@oclif/plugin-which 3.2.25 (core)",
"@salesforce/cli 2.73.9 (core)",
"apex 3.6.8 (core)",
"api 1.3.3 (core)",
"auth 3.6.87 (core)",
"community 3.2.10 (user) published 262 days ago (Sat May 11 2024) (latest is 3.3.8)",
"data 4.0.1 (core)",
"deploy-retrieve 3.17.7 (core)",
"dev 2.1.8 (user) published 370 days ago (Wed Jan 24 2024) (latest is 2.5.1)",
"info 3.4.32 (core)",
"limits 3.3.44 (core)",
"marketplace 1.3.7 (core)",
"org 5.2.23 (core)",
"packaging 2.9.12 (core)",
"schema 3.3.46 (core)",
"settings 2.4.10 (core)",
"signups 2.0.21 (user) published 349 days ago (Tue Feb 13 2024) (latest is 2.6.10)",
"sobject 1.4.49 (core)",
"telemetry 3.6.29 (core)",
"templates 56.3.35 (core)",
"trust 3.7.55 (core)",
"user 3.6.6 (core)",
"@salesforce/sfdx-scanner 4.7.0 (user) published 90 days ago (Tue Oct 29 2024) (latest is 4.8.0)",
"sfdmu 4.33.17 (user) published 271 days ago (Thu May 02 2024) (latest is 4.38.0)"
]
}
Activity
github-actions commentedon Jan 28, 2025
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
cristiand391 commentedon Jan 29, 2025
We've recently added some new options to improve manifest generation from an org:
https://github.com/forcedotcom/cli/tree/main/releasenotes/#27221-jan-15-2025
suggestions:
sf project generate manifest --output-dir manifest --name=allMetadata --from-org {ORG}with the--dev-debugflag and see if it's hanging on a specific type--excluded-metadatagavignon commentedon Jan 31, 2025
Thanks @cristiand391
But I'm not sure on how using the dev debug to identify the metadata to exclude as the last step seems to be different on each execution.
Do I need to exclude all the metadata types that cannot be used in the DEBUG statements ?
Here is the output:
jakubmplatek commentedon Feb 5, 2025
Hi @gavignon ,
I've also hit this issue (have a case open with Support at the moment).
As a temporary workaround, I managed to get it to succeed by excluding metadata types in folders, as those are often the biggest lift when describing metadata in a large enterprise org.
Parameter I used:
--excluded-metadata Dashboard,DashboardFolder,Document,DocumentFolder,Report,ReportFolderHope this helps
cristiand391 commentedon Feb 12, 2025
hey @gavignon, sorry for the late reply.
I was expecting the logs to show at which type it got stuck on the recursive call but it doesn't.
Does @jakubmplatek's work for you? We've had multiple customers experience issues with types in folders.
FCAADMIN commentedon Feb 13, 2025
Hi Team,
we are also facing same issue, which is impacting our retrieval activities. Could we get any update on this ?
Thanks,
Siva
JaydeepGo commentedon Feb 19, 2025
Hi @gavignon
You can use Environment Variable SF_LIST_METADATA_BATCH_SIZE=10 to get around this error. This Environment Variable SF_LIST_METADATA_BATCH_SIZE allows you to set the number of concurrent requests to fetch the data.
You can try to configure the value based on your org size.
Article Info.
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm#cli_reference_project_generate_manifest_unified
If the even lower values doesn’t work. You can try changing your node stack size to higher number.
export NODE_OPTIONS="--stack-size=100000"jakubmplatek commentedon Feb 19, 2025
FYI, we did test it with
SF_LIST_METADATA_BATCH_SIZE=5as part of troubleshooting our Support Case and it did not solve the issue.JaydeepGo commentedon Feb 19, 2025
@jakubmplatek Not sure about the test. Just curious if you run the command in same terminal session and verified if the value is being set properly. What about
SF_LIST_METADATA_BATCH_SIZE=1?If that doesn’t work you can try to increase the increase the node stack size to get around this isssue.
As there is support case already there, i will let them check further.
iowillhoit commentedon Feb 20, 2025
Hello all, like Cristian mentioned here they should also try excluding metadata that they know that they do not use in their orgs to reduce the number of API calls.
They can also include only the metadata they care about. See the release notes for more details
An example of exclude:
sf project generate manifest --from-org my-org --excluded-metadata StandardValueSetAlso, if they are using
2.77.6or higher, we have added the ability of combining flags to make narrowing the desired metadata easier. Try using:--metadatawith--source-dir--excluded-metadatawith--source-dirgit2gus commentedon Feb 20, 2025
This issue has been linked to a new work item: W-17876861
cristiand391 commentedon Feb 27, 2025
This was fixed yesterday, if you want to give it a try it by installing latest plugin-deploy-retrieve:
sf plugins install @salesforce/[email protected]..The
Maximum call stack size exceedederror happened when trying to get +100K components from the org, even lowering the batch size couldn't help if just 1 metadata type had ~100K components.After fixing it we also found the command would hang if you had a bunch (~1K) folder type components to retrieve, we set a new default batch size limit of 500 so this should work ootb for most users.
Please let us know if you still experience any other issue.
shetzel commentedon Mar 11, 2025
The fix went into the 12.15.2 release of the source-deploy-retrieve (SDR) library here:
https://github.com/forcedotcom/source-deploy-retrieve/releases/tag/12.15.2
And the SDR library dependency was bumped in the deploy-retrieve library so that the plugin has the fix here:
https://github.com/salesforcecli/plugin-deploy-retrieve/releases/tag/3.20.7
So if you have at least version 3.20.7 of the deploy-retrieve plugin you have the fix. To check it, run:
sf plugins inspect deploy-retrieveand look at the plugin version and the version of the SDR library to ensure they are at or above the versions listed above.cristiand391 commentedon Mar 19, 2025
this was fixed in sf v2.80.12:
https://github.com/forcedotcom/cli/tree/main/releasenotes/#28012-march-19-2025-stable
another big customer found a similar issue when having a ton of folder types, the fix for that issue is currently in sf v2.81.9 (current RC):
https://github.com/forcedotcom/cli/tree/main/releasenotes/#2819-march-26-2025-stable-rc