-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Labels
bugIssue or pull request that identifies or fixes a bugIssue or pull request that identifies or fixes a buginvestigatingWe're actively investigating this issueWe're actively investigating this issuevalidatedVersion information for this issue has been validatedVersion information for this issue has been validated
Description
Summary
When running sf project deploy start -c I run into an error: Unexpected end of JSON input.
After some digging, I found that the problem was an empty ~/.sf/deploy-cache.json file. Once I removed the empty file, everything went back to working again.
Steps To Reproduce
- Have any valid sfdx project open with the latest cli version
- Deploy changes to the org, to create a valid
~/.sf/deploy-cache.jsonfile - Empty that file, so it has 0 bytes in it
- Make a change to source
- Deploy again using
sf project deploy start -c
Expected result
The deploy should happen, and the CLI should report back the changes.
Actual result
The deploy is successful, I can see that from my org.
The output from the sf cli is this:
Additional information
I have ran sf project deploy start -c --dev-debug which give a useful stacktrace. (I only left in part of it because the issue description became too long)
Error (1): Unexpected end of JSON input
*** Internal Diagnostic ***
SfCommandError [JsonParseError]: Unexpected end of JSON input
at Function.from (file:///Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/SfCommandError.js:39:16)
at DeployMetadata.catch (file:///Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/sfCommand.js:323:47)
at DeployMetadata.catch (file:///Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/plugin-deploy-retrieve/src/commands/project/deploy/start.ts:325:23)
at DeployMetadata._run (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:185:29)
at async Config.runCommand (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:456:25)
at async run (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:97:16)
at async file:///Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/bin/run.js:15:1 {
actions: undefined,
exitCode: 1,
context: 'DeployMetadata',
data: undefined,
cause: JsonParseError: Unexpected end of JSON input
at Function.create (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/kit/lib/errors.js:61:20)
at parseJson (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/kit/lib/json.js:41:39)
at parseJsonMap (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/kit/lib/json.js:79:18)
... 6 lines matching cause stack trace ...
at async DeployMetadata._run (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:181:22) {
cause: SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at parseJson (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/kit/lib/json.js:38:21)
at parseJsonMap (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/kit/lib/json.js:79:18)
at DeployCache.read (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/core/lib/config/configFile.js:156:52)
at async DeployCache.init (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/core/lib/config/ttlConfig.js:45:26)
at async Function.create (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/kit/lib/creatable.js:66:9)
at async Function.set (file:///Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/plugin-deploy-retrieve/src/utils/deployCache.ts:35:19)
at async executeDeploy (file:///Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/plugin-deploy-retrieve/src/utils/deploy.ts:186:3)
at async DeployMetadata.run (file:///Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@salesforce/plugin-deploy-retrieve/src/commands/project/deploy/start.ts:238:24)
at async DeployMetadata._run (/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:181:22),
path: '/Users/aaugustijn/.sf/deploy-cache.json',
line: undefined,
errorPortion: undefined
},
status: 1,
commandName: 'DeployMetadata',
warnings: [],
result: undefined,
skipOclifErrorHandling: true,
oclif: { exit: 1 }
}
System Information
Using MBP M4 with zsh as a shell
{
"architecture": "darwin-arm64",
"cliVersion": "@salesforce/cli/2.106.4",
"nodeVersion": "node-v22.17.0",
"osVersion": "Darwin 24.6.0",
"rootPath": "/Users/aaugustijn/.nvm/versions/node/v22.17.0/lib/node_modules/@salesforce/cli",
"shell": "zsh",
"pluginVersions": [
"@mysolution/sfdxplugins 2.0.51 (link) /Users/aaugustijn/mys/SfdxPlugins",
"@oclif/plugin-autocomplete 3.2.34 (core)",
"@oclif/plugin-commands 4.1.32 (core)",
"@oclif/plugin-help 6.2.32 (core)",
"@oclif/plugin-not-found 3.2.67 (core)",
"@oclif/plugin-plugins 5.4.46 (core)",
"@oclif/plugin-search 1.2.28 (core)",
"@oclif/plugin-update 4.7.4 (core)",
"@oclif/plugin-version 2.2.32 (core)",
"@oclif/plugin-warn-if-update-available 3.1.46 (core)",
"@oclif/plugin-which 3.2.39 (core)",
"@salesforce/cli 2.106.4 (core)",
"agent 1.24.8 (core)",
"apex 3.6.19 (core)",
"api 1.3.3 (core)",
"auth 3.9.4 (core)",
"code-analyzer 5.2.2 (user) published 76 days ago (Tue Jun 24 2025) (latest is 5.4.0)",
"community 3.3.40 (user) published 2 days ago (Sun Sep 07 2025)",
"data 4.0.55 (core)",
"deploy-retrieve 3.23.1 (core)",
"info 3.4.85 (core)",
"lightning-dev 3.5.1 (user) published 12 days ago (Wed Aug 27 2025)",
"limits 3.3.66 (core)",
"marketplace 1.3.8 (core)",
"org 5.9.27 (core)",
"packaging 2.19.10 (core)",
"schema 3.3.81 (core)",
"settings 2.4.46 (core)",
"sobject 1.4.72 (core)",
"telemetry 3.6.55 (core)",
"templates 56.3.63 (core)",
"trust 3.7.113 (core)",
"user 3.6.38 (core)"
]
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue or pull request that identifies or fixes a bugIssue or pull request that identifies or fixes a buginvestigatingWe're actively investigating this issueWe're actively investigating this issuevalidatedVersion information for this issue has been validatedVersion information for this issue has been validated