-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON response truncated #3134
Comments
Hello @mmakwanaCertinia 👋 None of the versions of Shared: Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. After updating, share the full output of |
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. |
Tested on the latest SF CLI version (2.67.7) and it resulted in the same outcome. |
Updated SF output: {
"architecture": "darwin-x64",
"cliVersion": "@salesforce/cli/2.67.7",
"nodeVersion": "node-v20.12.2",
"osVersion": "Darwin 23.6.0",
"rootPath": "/Users/mmakwana/.nvm/versions/node/v20.12.2/lib/node_modules/@salesforce/cli",
"shell": "zsh",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.8 (core)",
"@oclif/plugin-commands 4.1.8 (core)",
"@oclif/plugin-help 6.2.16 (core)",
"@oclif/plugin-not-found 3.2.25 (core)",
"@oclif/plugin-plugins 5.4.15 (core)",
"@oclif/plugin-search 1.2.14 (core)",
"@oclif/plugin-update 4.6.10 (core)",
"@oclif/plugin-version 2.2.15 (core)",
"@oclif/plugin-warn-if-update-available 3.1.21 (core)",
"@oclif/plugin-which 3.2.17 (core)",
"@salesforce/cli 2.67.7 (core)",
"apex 3.6.2 (core)",
"api 1.3.2 (core)",
"auth 3.6.73 (core)",
"data 3.11.3 (core)",
"deploy-retrieve 3.15.11 (core)",
"info 3.4.18 (core)",
"limits 3.3.39 (core)",
"marketplace 1.3.4 (core)",
"org 5.1.4 (core)",
"packaging 2.9.0 (core)",
"schema 3.3.40 (core)",
"settings 2.4.4 (core)",
"sobject 1.4.45 (core)",
"telemetry 3.6.20 (core)",
"templates 56.3.29 (core)",
"trust 3.7.41 (core)",
"user 3.6.2 (core)"
]
} Confirmed behaviour is still present |
@mmakwanaCertinia I'm not able to reproduce this using the following: test.apex throw new DmlException('Insert failed');
{
"name": "executeRuntimeFailure",
"message": "Execution failed at this code:\n\nSystem.DmlException: Insert failed",
"exitCode": 1,
"context": "Run",
"data": {
"success": false,
"compiled": true,
"compileProblem": "",
"exceptionMessage": "System.DmlException: Insert failed",
"exceptionStackTrace": "AnonymousBlock: line 1, column 1",
"line": "1",
"column": "1",
"logs": "62.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO\nExecute Anonymous: throw new DmlException('Insert failed');\n09:20:51.21 (21118024)|USER_INFO|[EXTERNAL]|005O800000Dkz4Q|[email protected]|(GMT-08:00) Pacific Standard Time (America/Los_Angeles)|GMT-08:00\n09:20:51.21 (21143028)|EXECUTION_STARTED\n09:20:51.21 (21150308)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex\n09:20:51.21 (21569163)|FATAL_ERROR|System.DmlException: Insert failed\n\nAnonymousBlock: line 1, column 1\n09:20:51.21 (21599783)|CUMULATIVE_LIMIT_USAGE\n09:20:51.21 (21599783)|LIMIT_USAGE_FOR_NS|(default)|\n Number of SOQL queries: 0 out of 100\n Number of query rows: 0 out of 50000\n Number of SOSL queries: 0 out of 20\n Number of DML statements: 0 out of 150\n Number of Publish Immediate DML: 0 out of 150\n Number of DML rows: 0 out of 10000\n Maximum CPU time: 0 out of 10000\n Maximum heap size: 0 out of 6000000\n Number of callouts: 0 out of 100\n Number of Email Invocations: 0 out of 10\n Number of future calls: 0 out of 50\n Number of queueable jobs added to the queue: 0 out of 50\n Number of Mobile Apex push calls: 0 out of 10\n\n09:20:51.21 (21599783)|CUMULATIVE_LIMIT_USAGE_END\n\n09:20:51.21 (21623798)|CODE_UNIT_FINISHED|execute_anonymous_apex\n09:20:51.21 (21630501)|EXECUTION_FINISHED\n"
},
"stack": "executeRuntimeFailure: Execution failed at this code:\n\nSystem.DmlException: Insert failed\n at SfCommandError.from (file:///Users/mdonnalley/.volta/tools/image/packages/@salesforce/cli/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/SfCommandError.js:39:16)\n at Run.catch (file:///Users/mdonnalley/.volta/tools/image/packages/@salesforce/cli/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/sfCommand.js:316:47)\n at Run._run (/Users/mdonnalley/.volta/tools/image/packages/@salesforce/cli/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:306:29)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Config.runCommand (/Users/mdonnalley/.volta/tools/image/packages/@salesforce/cli/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:425:25)\n at async run (/Users/mdonnalley/.volta/tools/image/packages/@salesforce/cli/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:95:16)\n at async file:///Users/mdonnalley/.volta/tools/image/packages/@salesforce/cli/lib/node_modules/@salesforce/cli/bin/run.js:15:1",
"cause": "undefined",
"warnings": [],
"code": "executeRuntimeFailure",
"status": 1,
"commandName": "Run"
} Are you able to share a repo that replicates the issue? Thanks! |
@mdonnalley hey, I work with @mmakwanaCertinia and he is off ATM, will see if I can get a repo together for you or at least some repro conditions. My suspicion though is that this error will depend on the response which will be determined by the size of the log file that gets returned. Just throwing an exception likely generates a fairly short log so it might need to do something a little more |
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted. |
Summary
When processing the JSON output of a SF command we are unable to as the response gets truncated and ends up not being valid JSON. Specifically when calling the command:
sf apex run -o ${USERNAME} -f ${file} --json
we receive a response like:Steps To Reproduce
Run
sf apex run -o ${USERNAME} -f ${file} --json
.Expected result
Correctly formed JSON returned.
Actual result
Malformed JSON returned
System Information
Terminal = zsh
Note: Tested on the latest SF CLI version and resulted in the same outcome.
The text was updated successfully, but these errors were encountered: