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

having an expired scratch org as the default target-org causes the CLI to hang trying to connect to it #3015

Closed
cristiand391 opened this issue Sep 10, 2024 · 3 comments
Labels
bug Issue or pull request that identifies or fixes a bug doctor Issue was created using the 'doctor' command investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@cristiand391
Copy link
Member

If I create a scratch org, set it as the default with sf config set target-org <org-username> --global then left it expire, sf still tries to connect to it and causes a ~10s delay on all commands executions (it tries to conect to the instance URL, which isn't valid at that point.

Expected result

if the target-org expired then it should be ignored

Actual result

expired target-org causes a ~10s delay on all commands (even if it's not using --target-org like sf plugins).

Additional information

Internal:
here's a video of the bug running JSFORCE_LOG_LEVEL=DEBUG sf config list --dev-debug, see how it hangs on retrying the request:
https://salesforce-internal.slack.com/archives/G02K6C90RBJ/p1725468814588979

...
DEBUG   [fetch]  retrying for the 1 time
DEBUG   [fetch]  reason: statusCode match
DEBUG   [fetch]  retrying for the 1 time

System Information

CLI:
@salesforce/cli/2.58.7 darwin-x64 node-v20.10.0

Plugin Version:
@cristiand391/sf-plugin-fzf-cmp 0.2.0 (user)
@oclif/plugin-autocomplete 3.2.2 (core)
@oclif/plugin-commands 4.0.13 (core)
@oclif/plugin-help 6.2.10 (core)
@oclif/plugin-not-found 3.2.18 (core)
@oclif/plugin-plugins 5.4.6 (core)
@oclif/plugin-search 1.2.7 (core)
@oclif/plugin-update 4.5.5 (core)
@oclif/plugin-version 2.2.11 (core)
@oclif/plugin-warn-if-update-available 3.1.13 (core)
@oclif/plugin-which 3.2.12 (core)
@salesforce/cli 2.58.7 (core)
apex 3.4.8 (core)
api 1.2.1 (core)
auth 3.6.54 (core)
data 3.6.5 (core)
deploy-retrieve 3.12.3 (core)
info 3.4.3 (core)
limits 3.3.29 (core)
marketplace 1.2.25 (core)
org 4.5.7 (core)
packaging 2.8.2 (core)
schema 3.3.26 (core)
settings 2.3.16 (core)
sobject 1.4.33 (core)
source 3.5.18 (core)
telemetry 3.6.10 (core)
templates 56.3.17 (core)
trust 3.7.27 (core)
user 3.5.29 (core)
SF ENV. VARS.
SF_DISABLE_TELEMETRY,true
SF_AUTOUPDATE_DISABLE,true
SF_DISABLE_AUTOUPDATE,true
SF_UPDATE_INSTRUCTIONS,Use "npm update --global @salesforce/cli" to update npm-based installations.
Windows: false
Shell: zsh
Channel: stable

Diagnostics

✅ pass - salesforcedx plugin isn’t installed
✅ pass - you don't have any linked plugins
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/
✅ pass - using latest or latest-rc CLI version
❌ warn - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion
✅ pass - can access: https://test.salesforce.com
✅ pass - can access: https://appexchange.salesforce.com/services/data
✅ pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
✅ pass - [@salesforce/plugin-auth] CLI supports v2 crypto

@cristiand391 cristiand391 added investigating We're actively investigating this issue doctor Issue was created using the 'doctor' command bug Issue or pull request that identifies or fixes a bug labels Sep 10, 2024
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 Sep 10, 2024
Copy link

git2gus bot commented Sep 10, 2024

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

@cristiand391
Copy link
Member Author

closing this...
The bug was likely caused by an issue with the sfdx entry in my keychain, other team member couldn't repro (also tested on my personal linux machine), see the internal slack thread linked.

@cristiand391 cristiand391 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
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 doctor Issue was created using the 'doctor' command investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

1 participant