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

SF Org Connections Not Working Correctly in Remote Container #5943

Open
GeekStewie opened this issue Nov 6, 2024 · 5 comments
Open

SF Org Connections Not Working Correctly in Remote Container #5943

GeekStewie opened this issue Nov 6, 2024 · 5 comments

Comments

@GeekStewie
Copy link

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

When connecting to Salesforce orgs within a Remote Container (aka Dev Containers) within VSCode, the org is connected OK, although doesn't appear on the bottom utility bar but then if you try to switch to another org or reopen the same project which was previously connected to another org and try to connect to a new org, the login URL seems to be frozen to the old org. The only workaround is to open the config file and clear the target org entry, then start again.

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. Open a SalesforceDX project within VSCode, inside a Remote Container
  2. Connect to a Salesforce org (< this should connect although the alias wont be shown in utility bar at the bottom of vscode window)
  3. Connect to a different Salesforce org (Prompt to enter code has the old org URL, so does not connect)

Note that this issues doesn't happen when running local, ie. not within a Remote Container

Tip

use sf doctor --create-issue to automatically fill the required information

Expected result

Connected org alias appears on bottom bar when connected. When connecting to a new org, it should ignore previous org connections.

Actual result

No org alias seen and when trying to connect to new org, old URL is used, not the new url or login.salesforce url.

Additional information

System Information

zsh

PASTE_VERSION_OUTPUT_HERE

{
"architecture": "darwin-arm64",
"cliVersion": "@salesforce/cli/2.64.8",
"nodeVersion": "node-v18.18.2",
"osVersion": "Darwin 24.1.0",
"rootPath": "/Users/stewart.anderson/.nvm/versions/node/v18.18.2/lib/node_modules/@salesforce/cli",
"shell": "zsh",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.6 (core)",
"@oclif/plugin-commands 4.1.3 (core)",
"@oclif/plugin-help 6.2.16 (core)",
"@oclif/plugin-not-found 3.2.22 (core)",
"@oclif/plugin-plugins 5.4.15 (core)",
"@oclif/plugin-search 1.2.12 (core)",
"@oclif/plugin-update 4.6.6 (core)",
"@oclif/plugin-version 2.2.15 (core)",
"@oclif/plugin-warn-if-update-available 3.1.20 (core)",
"@oclif/plugin-which 3.2.16 (core)",
"@salesforce/analytics 1.4.15 (user) published 176 days ago (Mon May 13 2024) (latest is 1.4.27)",
"@salesforce/cli 2.64.8 (core)",
"apex 3.5.4 (core)",
"api 1.3.1 (core)",
"auth 3.6.70 (core)",
"data 3.8.1 (core)",
"deploy-retrieve 3.13.1 (core)",
"info 3.4.13 (core)",
"limits 3.3.36 (core)",
"marketplace 1.3.0 (core)",
"org 4.7.2 (core)",
"packaging 1.27.10 (user) published 327 days ago (Thu Dec 14 2023) (latest is 2.9.0)",
"schema 3.3.37 (core)",
"settings 2.3.24 (core)",
"sobject 1.4.42 (core)",
"source 3.5.21 (core)",
"telemetry 3.6.17 (core)",
"templates 56.3.24 (core)",
"trust 3.7.35 (core)",
"user 3.5.33 (core)",
"sfdmu 4.33.17 (user) published 188 days ago (Thu May 02 2024) (latest is 4.36.7)",
"sfdx-essentials 2.12.0 (user) published 1057 days ago (Tue Dec 14 2021)",
"sfdx-git-delta 5.40.0 (user) published 174 days ago (Thu May 16 2024) (latest is 5.49.2)",
]
}

Copy link

github-actions bot commented Nov 6, 2024

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.

@cristiand391
Copy link
Member

Connected org alias appears on bottom bar when connected. When connecting to a new org, it should ignore previous org connections.

just to confirm, you are talking about vscode's bar at the bottom, right? I can transfer this issue to the vscode team if so.

@GeekStewie
Copy link
Author

From a UI perspective, yes the VSCode bar although the sf commands directly in terminal are still using the old org details so it sounds like it needs to be addressed from UI and CLI.

@cristiand391
Copy link
Member

From a UI perspective, yes the VSCode bar although the sf commands directly in terminal are still using the old org details so it sounds like it needs to be addressed from UI and CLI.

yes, sf will use what's in the local/global config file.
From what you described it sounds like vscode extensions fail to update the config (and so sf just picks up that), the CLI doesn't set any vscode-specific settings.

I'll transfer this to the IDEx team.

@cristiand391 cristiand391 transferred this issue from forcedotcom/cli Nov 11, 2024
@mingxuanzhangsfdx
Copy link
Member

Hi @GeekStewie , could you try your steps in both terminal and VSCode commands and see if there are any differences? First, try to authorize an org with sf cli directly in terminal of your mac, and then authorize another org with sf cli.

Then set the org config to empty and authorize the two orgs with VSCode command only.

Let me know the results, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants