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

"Unexpected end of JSON input" error when a cached org definition file is bad #2066

Closed
aidan-harding opened this issue Apr 14, 2023 · 3 comments
Labels
bug Issue or pull request that identifies or fixes a bug configFile problems related to sfdx-core/configFile

Comments

@aidan-harding
Copy link

Summary

It seems to be a recurring problem that users of the CLI can end up with a bad org definition file in ~/.sfdx. And when that happens, the CLI is unable to list orgs. Instead it gives the message "Unexpected end of JSON input".

See, for example, https://salesforce.stackexchange.com/questions/391686/vs-code-unexpected-end-of-json-input-error-when-changing-the-default-org

My team and I hit this infrequently enough to have to Google the cause, and it's a show-stopper until you realise what happened.

Steps To Reproduce:

cat > ~/.sfdx/[email protected]
(Press ^D)
sfdx force:org:list   

Expected result

A list of the orgs that actually work

Actual result

Error (1): Unexpected end of JSON input

System Information

  • Which shell/terminal are you using? (e.g. bash, zsh, powershell 5, powershell 7, cmd.exe, etc.)
    zsh

  • If you are using sfdx

    • Run sfdx version --verbose --json
{
  "cliVersion": "sfdx-cli/7.196.8",
  "architecture": "darwin-x64",
  "nodeVersion": "node-v18.15.0",
  "osVersion": "Darwin 22.4.0",
  "shell": "zsh",
  "rootPath": "/Users/aidan/.local/share/sfdx/client/7.196.8-16a11d1",
  "pluginVersions": [
    "@dx-cli-toolbox/sfdx-toolbox-package-utils 0.8.4 (user)",
    "@mshanemc/plugin-streaming 1.1.7 (user)",
    "@mshanemc/sfdx-sosl 1.1.0 (user)",
    "@oclif/plugin-autocomplete 2.1.8 (user)",
    "@oclif/plugin-commands 2.2.13 (core)",
    "@oclif/plugin-help 5.2.9 (user)",
    "@oclif/plugin-not-found 2.3.23 (core)",
    "@oclif/plugin-plugins 2.4.4 (core)",
    "@oclif/plugin-search 0.0.15 (core)",
    "@oclif/plugin-update 3.1.9 (core)",
    "@oclif/plugin-version 1.3.2 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.33 (core)",
    "@oclif/plugin-which 2.2.18 (core)",
    "@salesforce/analytics 1.3.0 (user)",
    "apex 2.2.10 (core)",
    "auth 2.7.11 (core)",
    "community 2.2.9 (core)",
    "custom-metadata 2.1.11 (core)",
    "data 2.3.9 (core)",
    "deploy-retrieve 1.8.12 (core)",
    "info 2.6.4 (core)",
    "limits 2.3.12 (core)",
    "org 2.6.12 (core)",
    "packaging 1.16.3 (core)",
    "schema 2.3.6 (core)",
    "settings 1.4.3 (core)",
    "signups 1.4.11 (core)",
    "source 2.9.4 (core)",
    "telemetry 2.1.3 (core)",
    "templates 55.4.5 (core)",
    "trust 2.4.6 (core)",
    "user 2.3.7 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
    "sfdmu 4.26.10 (user)",
    "sfdx-cli 7.196.8 (core)",
    "sfdx-hardis 3.13.1 (user)",
    "shane-sfdx-plugins 4.43.0 (user)"
  ]
}

Additional information

Feel free to attach a screenshot.

@aidan-harding aidan-harding added the investigating We're actively investigating this issue label Apr 14, 2023
@github-actions
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.

@WillieRuemmele WillieRuemmele added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Apr 14, 2023
@git2gus
Copy link

git2gus bot commented Apr 14, 2023

This issue has been linked to a new work item: W-13039897

@shetzel
Copy link
Contributor

shetzel commented Jul 6, 2023

This is now in the latest CLIs: sfdx 7.208.10 / sf 1.85.8

@shetzel shetzel closed this as completed Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug configFile problems related to sfdx-core/configFile
Projects
None yet
Development

No branches or pull requests

4 participants