sf auth web login command for non-preview sandbox generates json file `~/.sfdx/username@as.email.json` with preview API version "63.0" which produces many different errors

Open
#3,205 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
node.js

Research direction

Start by reproducing the problem with sf auth web login against a non-preview sandbox, then inspect the generated ~/.sfdx/username@as.email.json and compare its instanceApiVersion with the sandbox. Verify the result using sf org open and sf bulk data upsert, including their --json variants; done means these commands no longer fail because of an unavailable preview API version.

Written by the indexing model from the issue text.

Description

bug validated

Note
Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.
Summary

sf auth web login command for non-preview sandbox generates json file ~/.sfdx/username@as.email.json with preview API version "63.0" which produces many different errors

https://salesforce.stackexchange.com/questions/429908/strange-error-executing-any-sf-command-for-a-recently-refreshed-non-preview-sand/429909#429909

Steps To Reproduce

IMPORTANT
Provide a repository that's configured to reproduce the issue. If you are unable to provide a repo, please explain why not. The more info we have from the start, the faster we can resolve your issue.
We may close your issue if you don't include proper instructions.

  • Generate a project with sf project generate or fork dreamhouse-lwc.
  • Provide detailed step-by-step instructions on how to reproduce the issue.
  1. Create a non-preview sandbox.
  2. Authorize it using sf auth web login command
  3. Notice instanceApiVersion has preview version 63.0.
  4. if you try to execute sf org open you will receive an error with no description
  5. If you try to execute sf org open --json there will be 404 not found errors probably because version 63.0 is not available for non-preview sandbox and any requests there fail as not found.
  6. Same for sf bulk data upsert

[!TIP]
use sf doctor --create-issue to automatically fill the required information

Expected result

Expect SF CLI work without any errors

Actual result

Multiple errors with no description or not found error description for json variant.

Additional information

https://i.sstatic.net/UmtYcfvE.png

https://i.sstatic.net/b5NKfxUr.png

https://i.sstatic.net/9nWcLF8K.png

System Information
{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.74.6",
  "nodeVersion": "node-v22.12.0",
  "osVersion": "Darwin 24.3.0",
  "rootPath": "/Users/bdovh/.local/share/sf/client/2.74.6-02685ea",
  "shell": "zsh",
  "pluginVersions": [
    "@futurefirst/sfdx-plugin-picklist 0.0.1 (user) published 1700 days ago (Wed Jun 10 2020)",
    "@oclif/plugin-autocomplete 3.2.18 (core)",
    "@oclif/plugin-commands 4.1.17 (core)",
    "@oclif/plugin-help 6.2.22 (core)",
    "@oclif/plugin-not-found 3.2.37 (core)",
    "@oclif/plugin-plugins 5.4.26 (core)",
    "@oclif/plugin-search 1.2.19 (core)",
    "@oclif/plugin-update 4.6.26 (core)",
    "@oclif/plugin-version 2.2.20 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.31 (core)",
    "@oclif/plugin-which 3.2.26 (core)",
    "@salesforce/cli 2.74.6 (core)",
    "apex 3.6.8 (core)",
    "api 1.3.3 (core)",
    "auth 3.6.87 (core)",
    "community 3.3.8 (user) published 24 days ago (Sat Jan 11 2025) (latest is 3.3.10)",
    "data 4.0.1 (core)",
    "deploy-retrieve 3.17.7 (core)",
    "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.6.10 (user) published 24 days ago (Sat Jan 11 2025) (latest is 2.6.12)",
    "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)"
  ]
}
Dominant language
No language data
Stars
571
Forks
80
Avg merge
7d 7h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from forcedotcom/cli

All issues in forcedotcom/cli

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.