Cli: sfdx force:auth:web:login -r https://login.salesforce.com ==> Browser just loads forever.

Created on 25 Feb 2021  Β·  17Comments  Β·  Source: forcedotcom/cli

Summary

_Short summary of what is going on or to provide context_.

Steps To Reproduce:

  1. Either run the command "sfdx force:auth:web:login -r https://login.salesforce.com" from command line or command pallet is visual studio code.
  2. The browser opens the salesforce authentication page.
  3. After entering the credentials & authorizing CLI for access, browser just loads forever.
  4. I even tried by changing default browser to 'Edge', 'FireFox', 'Chrome' one by one, none worked.

Expected result

The org should be successfully authorized.

Actual result

Browser loads for ever..

Additional information

investigating

Most helpful comment

I've been running sfdx force:auth:device:login as a workaround while this issue is open.

All 17 comments

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.

Try

 sfdx plugins:uninstall auth

Try

 sfdx plugins:uninstall auth

tried but no luck.

i also tried npm i [email protected] -g to install older version with no luck

going to try installing other versions...

we can not make and edit lwc without sfdx so this is very bad. if anyone finds a work around so we can do our jobs, please share

Got the same problem today. Here are the last lines when using flag --dev-debug
` sfdx:WebServer DEBUG Starting web server +0ms

sfdx:WebServer DEBUG Nothing listening on host: localhost port: 1717 - good! +20ms

sfdx:WebServer DEBUG socket connection initialized from 127.0.0.1 +5s

sfdx:WebServer DEBUG socket connection initialized from 127.0.0.1 +249ms`

Now, My condition is

❯ sfdx version
sfdx-cli/7.88.4-3b2e55c3f1 linux-x64 node-v14.15.4

❯ sfdx plugins --core
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
auth 1.4.8 (core)
config 1.2.4 (core)
generator 1.1.5 (core)
salesforcedx 48.22.11 (48.22.11)
β”œβ”€ salesforce-alm 48.24.3
β”œβ”€ salesforcedx-templates 48.18.0
β”œβ”€ @salesforce/sfdx-plugin-lwc-test 0.1.7
└─ custom-metadata 1.0.4
sfdx-cli 7.88.4 (core)
sfpowerkit 2.6.5
telemetry 1.1.1 (core)

❯ sfdx plugins
salesforcedx 48.22.11 (48.22.11)
β”œβ”€ salesforce-alm 48.24.3
β”œβ”€ salesforcedx-templates 48.18.0
β”œβ”€ custom-metadata 1.0.4
└─ @salesforce/sfdx-plugin-lwc-test 0.1.7
sfpowerkit 2.6.5

I tried to upgrade and downgrade salesforcedx and sfdx-cli

Finally, I find my sfdx plugin has auth

I uninstall it, then it works

Maybe you can try to downgrade salesforcedx to my version

@grieve54706 Nice, it works for me. Thanks.

@grieve54706 thanks for the listing :+1:

864 seems same issue.

steps

npm i [email protected] -g

sfdx plugins:install [email protected]

...and used nvm for node version switching

nvm install 14.15.4

nvm use 14.15.4

results

once sfdx force:auth:web:login worked, i ran and got below:

sfdx -v
sfdx-cli/7.88.4 linux-x64 node-v14.15.4

sfdx plugins --core
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-server 2.10.0
β”œβ”€ @oclif/plugin-update 1.3.10
└─ @oclif/plugin-help 2.2.3
@salesforce/sfdx-diff 0.0.6
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.7 (core)
auth 1.4.8 (core)
config 1.2.5 (core)
generator 1.1.5 (core)
salesforcedx 48.22.11 (48.22.11)
β”œβ”€ salesforcedx-templates 48.18.0
β”œβ”€ salesforce-alm 48.24.3
β”œβ”€ @salesforce/sfdx-plugin-lwc-test 0.1.7
└─ custom-metadata 1.0.4
sfdx-cli 7.88.4 (core)
sfdx-ext 0.0.49
telemetry 1.1.1 (core)

I'm experiencing same behavior described here on Windows.

sfdx force:auth:web:login -a foobar --instanceurl=https://foobar.my.salesforce.com

I use this command near daily. Was working normally for me earlier today after no login for a week (vacation). Later today after PC restart browser just hangs after entering credentials as described above. URL it hangs on is:

"https://foobar.my.salesforce.com/setup/secur/RemoteAccessAuthorizationPage.apexp?source=foo"

when I 'Terminate batch job' from sfdx I land at this URL with 'refused to connect'

"http://localhost:1717/OauthRedirect?code=foo&state=bar"

I thought maybe has to do with update to Powershell 7.2 I did earlier today, but seems others here are experiencing the problem on linux so probably unrelated.

So current theory is VSCode Salesforce Extension Pack plugin updated sfdx (or related package) in the background today and the update introduced this bug.

Not familiar with node TBH and don't seem to have npm/nvm commands in my PATH so not sure how to go about replicating the workaround discussed above. Neither have I ever updated sfdx manually so not too keen to mess about with downgrading - esp as that doesn't seem to have directly helped others. Feel free to tell me if I'm missing something dumb, but I'm happy enough for the moment to not bork my install running commands I don't understand.

Otherwise hope this info helps people cleverer than me to pinpoint the problem. Happy to provide more info if helpful.

sfdx -v
sfdx-cli/7.89.2-d1d2614d02 win32-x64 node-v14.15.4

sfdx plugins --core
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
auth 1.4.8 (core)
config 1.2.4 (core)
generator 1.1.5 (core)
salesforcedx 51.1.1 (core)
β”œβ”€ user 1.1.2 (core)
β”œβ”€ limits 1.0.4 (core)
β”œβ”€ schema 1.0.4 (core)
β”œβ”€ apex 0.1.4 (core)
β”œβ”€ templates 51.3.0 (core)
β”œβ”€ custom-metadata 1.0.11 (core)
β”œβ”€ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 51.1.1 (core)
sfdx-cli 7.89.2 (core)
telemetry 1.1.1 (core)

Having the same issue. Auth does show in my plugins but I can't uninstall it.

sfdx-cli/7.88.4 wsl-x64 node-v14.15.4

@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.7 (core)
auth 1.4.8 (core)
config 1.2.5 (core)
generator 1.1.5 (core)
salesforcedx 51.0.4 (core)
β”œβ”€ limits 1.0.4 (core)
β”œβ”€ user 1.1.2 (core)
β”œβ”€ schema 1.0.4 (core)
β”œβ”€ apex 0.1.4 (core)
β”œβ”€ templates 51.2.0 (core)
β”œβ”€ custom-metadata 1.0.11 (core)
β”œβ”€ salesforce-alm 51.0.2 (core)
└─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
sfdx-cli 7.88.4 (core)
telemetry 1.1.1 (core)
Uninstalling auth... !
 β€Ί   Error: auth is not installed

Having the same issue. Auth does show in my plugins but I can't uninstall it.

sfdx-cli/7.88.4 wsl-x64 node-v14.15.4
...

My case is I install another auth plugin
You can just try to do this

sfdx plugins:install [email protected]

Having the same issue. Auth does show in my plugins but I can't uninstall it.
sfdx-cli/7.88.4 wsl-x64 node-v14.15.4

@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.7 (core)
auth 1.4.8 (core)
config 1.2.5 (core)
generator 1.1.5 (core)
salesforcedx 51.0.4 (core)
β”œβ”€ limits 1.0.4 (core)
β”œβ”€ user 1.1.2 (core)
β”œβ”€ schema 1.0.4 (core)
β”œβ”€ apex 0.1.4 (core)
β”œβ”€ templates 51.2.0 (core)
β”œβ”€ custom-metadata 1.0.11 (core)
β”œβ”€ salesforce-alm 51.0.2 (core)
└─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
sfdx-cli 7.88.4 (core)
telemetry 1.1.1 (core)
Uninstalling auth... !
 β€Ί   Error: auth is not installed

My case is I install another auth plugin
You can just try to do this

sfdx plugins:install [email protected]

That worked for me. Thanks!!

I've been running sfdx force:auth:device:login as a workaround while this issue is open.

I had the same issue.
Downgrading with " sfdx plugins:install [email protected] " did not work for me.

I effectively had to uninstall salesforce cli; reinstall latest version and then run :
sfdx plugins:uninstall auth

With that it's working again for now ...

@grieve54706 thanks for the listing πŸ‘

864 seems same issue.

steps

npm i [email protected] -g

sfdx plugins:install [email protected]

...and used nvm for node version switching

nvm install 14.15.4

nvm use 14.15.4

results

once sfdx force:auth:web:login worked, i ran and got below:

sfdx -v
sfdx-cli/7.88.4 linux-x64 node-v14.15.4

sfdx plugins --core
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-server 2.10.0
β”œβ”€ @oclif/plugin-update 1.3.10
└─ @oclif/plugin-help 2.2.3
@salesforce/sfdx-diff 0.0.6
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.7 (core)
auth 1.4.8 (core)
config 1.2.5 (core)
generator 1.1.5 (core)
salesforcedx 48.22.11 (48.22.11)
β”œβ”€ salesforcedx-templates 48.18.0
β”œβ”€ salesforce-alm 48.24.3
β”œβ”€ @salesforce/sfdx-plugin-lwc-test 0.1.7
└─ custom-metadata 1.0.4
sfdx-cli 7.88.4 (core)
sfdx-ext 0.0.49
telemetry 1.1.1 (core)

This one worked for me,

sfdx plugins:install [email protected]
sfdx plugins:install [email protected]

Hello All,

I got some error in jenkins below you can see

C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\SCSDevOps_>C:\"Program Files"\"Salesforce CLI"\bin\sfdx auth:jwt:grant --clientid 3MVG9fe4g9fhX0E43UVmaCSnNuTBm276ttpeJuWSKS0l5TmJXMSGSNJxOgtCwV6kIv8ySP_liAUHKh6p_yRD6 --username [email protected] --jwtkeyfile ** --loglevel DEBUG --setdefaultdevhubusername --instanceurl https://login.salesforce.com/
ERROR running auth:jwt:grant: We encountered a JSON web token error, which is likely not an issue with Salesforce CLI. HereÒ€ℒs the error: error:02001005:system library:fopen:Input/output error
[Pipeline] echo
inside rc 0
[Pipeline] error
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: hub org authorization failed
Finished: FAILURE

This is fixed (for me at least!) as of sfdx-cli v 7.90.2
sfdx -v
sfdx-cli/7.90.2-b8f9206a5c win32-x64 node-v14.15.4

see also

890 (now closed)

Was this page helpful?
0 / 5 - 0 ratings