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

"SFDX: Authorize an Org" doesn't launch browser #2579

Closed
en2026 opened this issue Nov 24, 2023 · 5 comments
Closed

"SFDX: Authorize an Org" doesn't launch browser #2579

en2026 opened this issue Nov 24, 2023 · 5 comments
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@en2026
Copy link

en2026 commented Nov 24, 2023

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

CLI 2.17.14 win32-x64 node-v20.9.0
VS Code 1.84.2
Windows 10
When running "SFDX: Authorize an Org" from VS Code, it never launches browser. Have tried changing default browser, adding c:\windows\system32 to PATH, based on other threads. Same issue when running CLI command sf org login web --alias my-org in cmd.exe

Steps To Reproduce

In VS Code, run "Create Project with Manifest"
In sfdx-project.json, change "sfdcLoginUrl" to "https://test.salesforce.com",
In VS Code, select "SFDX: Authorize an Org", it stuck at "Running SFDX: Authorize an Org", no browser window is launched

IMPORTANT
The project used to reproduce the issue has no content, as mentioned above.

Expected result

Browser should auto-launch to enter credentials

Actual result

VS Code stuck at "Running SFDX: Authorize an Org", no browser window is launched

System Information

cmd.exe

{
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.17.14",
"nodeVersion": "node-v20.9.0",
"osVersion": "Windows_NT 10.0.19045",
"rootPath": "C:\Program Files\sf\client",
"shell": "cmd.exe",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.0.1 (core)",
"@oclif/plugin-commands 3.0.6 (core)",
"@oclif/plugin-help 6.0.5 (core)",
"@oclif/plugin-not-found 3.0.3 (core)",
"@oclif/plugin-plugins 4.1.7 (core)",
"@oclif/plugin-search 1.0.6 (core)",
"@oclif/plugin-update 4.1.3 (core)",
"@oclif/plugin-version 2.0.6 (core)",
"@oclif/plugin-warn-if-update-available 3.0.2 (core)",
"@oclif/plugin-which 3.0.8 (core)",
"@salesforce/cli 2.17.14 (core)",
"apex 2.3.20 (core)",
"auth 2.8.26 (core)",
"data 2.6.3 (core)",
"deploy-retrieve 1.20.0 (core)",
"info 3.0.1 (core)",
"limits 3.0.1 (core)",
"login 2.0.1 (core)",
"marketplace 1.0.2 (core)",
"org 2.11.8 (core)",
"schema 3.0.1 (core)",
"settings 2.0.2 (core)",
"sobject 0.2.15 (core)",
"source 2.11.0 (core)",
"telemetry 3.1.0 (core)",
"templates 55.5.18 (core)",
"trust 3.0.2 (core)",
"user 2.3.42 (core)"
]
}

@en2026 en2026 added the investigating We're actively investigating this issue label Nov 24, 2023
@github-actions github-actions bot added the validated Version information for this issue has been validated label Nov 24, 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.

@mshanemc
Copy link
Contributor

Odd. Can you run it with --dev-debug so we can see what's happening?

This is the CLI issues repo, but it sounds like it doesn't work even when not using VSCode. What happens...nothing? Or is there some error?

Can you also see if there's any process running on port 1717 (or whatever your connected app is using for the callback?)

Finally, do you have any "special" security settings from your company that would, for example, not allow a program to open a browser window? What browser would you expect to open?

@en2026
Copy link
Author

en2026 commented Nov 27, 2023

Thanks. devDebug log is attached. No process running on 1717. Checked with company security team, they're not aware of policy that would do this. My teammate doesn't have this issue.
FYI - I was able to work around this by running "sfdx force:auth:web:login"
devDebug.txt

@mshanemc
Copy link
Contributor

I see the error in the logs, looks like the command it's try to run is org login web --alias my-org in cmd.exe
oclif:main 'org',
oclif:main 'login',
oclif:main 'web',
oclif:main '--alias',
oclif:main 'my-org',
oclif:main 'in',
oclif:main 'cmd.exe'`

It's complaining about the in cmd.exe portion here

Error (1): Unexpected arguments: in, cmd.exe

Try running
sf org login web --alias my-org and see if a browser opens. If VSCode is what's causing the command to run with in cmd.exe then open an issue on their repo https://github.com/forcedotcom/salesforcedx-vscode/issues

@en2026
Copy link
Author

en2026 commented Nov 27, 2023

It didn't. I switched from powershell to cmd since the company blocks powershell. I've requested to have it unblocked, will see if it makes any difference. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants