Skip to content
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 Parse Error When Using SFDX Commands (SFDX In Command Pallet Throws Different Error) #2620

Closed
ahardyGitHub opened this issue Dec 22, 2023 · 2 comments
Labels
validated Version information for this issue has been validated

Comments

@ahardyGitHub
Copy link

Summary

CLI Commands abruptly stopped working as expected both using Git Bash and the point-and-click tools in VS Code.

In Gitbash, a command will return the error "JsonParseError: Unexpected end of JSON input".
Using point and click Command Palette commands, for example, "SFDX: Create Apex Trigger" will give an error pop-up message that says, "Command 'SFDX: Create Apex Trigger' resulted in an error. Command sfdx.force.apex.trigger.create' not found"

Steps To Reproduce

  1. Open Salesforce DX project in VS Code
  2. Attempt to run a DX command using Git Bash

OR

  1. Open Salesforce DX project in VS Code
  2. Attempt to any SFDX command using the Command Pallet results in error: "Command 'SFDX: [Action Name]' resulted in an error. Command sfdx.force.apex.trigger.create' not found"

Expected result

Commands operate as expected and how they have previously operated

Actual result

Git bash command results in error: "JsonParseError: Unexpected end of JSON input"
Command Palette SFDX Command result in pop-up error message: "Command 'SFDX: Create Apex Trigger' resulted in an error. Command sfdx.force.apex.trigger.create' not found"

System Information

Git Bash

{
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.21.8",
"nodeVersion": "node-v20.10.0",
"osVersion": "Windows_NT 10.0.22631",
"rootPath": "C:\Program Files\sf\client",
"shell": "C:\Program Files (x86)\Git\usr\bin\bash.exe",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.0.2 (core)",
"@oclif/plugin-commands 3.0.7 (core)",
"@oclif/plugin-help 6.0.7 (core)",
"@oclif/plugin-not-found 3.0.4 (core)",
"@oclif/plugin-plugins 4.1.9 (core)",
"@oclif/plugin-search 1.0.8 (core)",
"@oclif/plugin-update 4.1.4 (core)",
"@oclif/plugin-version 2.0.8 (core)",
"@oclif/plugin-warn-if-update-available 3.0.5 (core)",
"@oclif/plugin-which 3.0.11 (core)",
"@salesforce/cli 2.21.8 (core)",
"apex 3.0.8 (core)",
"auth 3.0.10 (core)",
"data 3.0.5 (core)",
"deploy-retrieve 2.2.3 (core)",
"info 3.0.7 (core)",
"limits 3.0.5 (core)",
"marketplace 1.0.10 (core)",
"org 3.1.1 (core)",
"packaging 1.27.10 (core)",
"schema 3.0.8 (core)",
"settings 2.0.9 (core)",
"sobject 1.0.5 (core)",
"source 3.0.3 (core)",
"telemetry 3.1.4 (core)",
"templates 56.0.4 (core)",
"trust 3.1.2 (core)",
"user 3.1.0 (core)"
]
}

Additional information

This issue is happening only on my Windows 11 laptop, across multiple projects. All of these projects previously worked without issue.

I have tried uninstalling and reinstalling CLI, but the errors remain.

The issue started yesterday morning after I ran sf config set target-dev-hub=myScratchOrg -g

No system updates had been run between when it was last working and stopped.

Screenshot 2023-12-22 090807
Screenshot 2023-12-21 130836

@ahardyGitHub ahardyGitHub added the investigating We're actively investigating this issue label Dec 22, 2023
Copy link

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.

@github-actions github-actions bot added the validated Version information for this issue has been validated label Dec 22, 2023
@cristiand391
Copy link
Member

@ahardyGitHub that seems like the CLI is trying to read a corrupted json file (could be auth/config).

if you run sf org list do you see a warning like Warning: The auth file for <username> is invalid.?

@shetzel shetzel removed the investigating We're actively investigating this issue label Jan 11, 2024
@shetzel shetzel closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants