forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
492 stars 78 forks source link

No response from sfdx auth:web:login #1113

Closed renanlq closed 1 year ago

renanlq commented 3 years ago

Summary

We are trying to use CLI command: force:auth:web:login without success or any clear response.

Steps To Reproduce:

  1. Tried to run:

    > sfdx force:auth:web:login --setalias alias --instanceurl https://test.salesforce.com
    > sfdx force:auth:web:login --setalias alias --instanceurl https://test.salesforce.com --setdefaultusername

    In all cases, the login page in the browser is not triggered.

  2. Trying to use DX Extension in Visual Studio Code:

    14:03:26.563 sfdx force:auth:web:login --setalias alias --instanceurl https://org--sandboxname.my.salesforce.com --setdefaultusername
    14:04:07.84 sfdx force:auth:web:login --setalias alias --instanceurl https://org--sandboxname.my.salesforce.com --setdefaultusername
    ended with exit code 1

Expected result

Open the login page on the browser to fill up with credentials.

Actual result

Nothing happens, and the command still waiting in the background.

System Information

{
        "cliVersion": "sfdx-cli/7.110.0",
        "architecture": "win32-x64",
        "nodeVersion": "node-v14.17.3"
}

Additional information

Trying using VSCode Salesforce extension: image Trying command by myself in VSCode: image Tying command in cmd: image

github-actions[bot] commented 3 years ago

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.

renanlq commented 3 years ago

Have tried again with a different scenario in the response: image So that, I killed the process that was running in port 1717 (node.js), and with no response, again.

So that we change our strategy and tried to use auth:device:login: image Without success, my VSCode still directing to a previous (production org) one connected, before getting this issue with auth:web:login, when trying to log in any sandbox.

mshanemc commented 3 years ago

can you check your config (sfdx config list) and your environment variables (verify that you don't have something set in SFDX_INSTANCE_URL).

FYI, you can now use the auth commands without the force topic ex: sfdx auth:web:login ...

Can you also add the output of sfdx version --verbose --json to make sure your auth plugin is the correct version?

Also, try adding --dev-debug to your command, along with --json to get more details about the error.

renanlq commented 3 years ago

Result from config list: image

And sfdx version:

{
        "cliVersion": "sfdx-cli/7.110.0",
        "architecture": "win32-x64",
        "nodeVersion": "node-v14.17.3",
        "pluginVersions": [
                "@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.10.0 (core)",
                "@oclif/plugin-update 1.4.0-3 (core)",
                "@oclif/plugin-warn-if-update-available 1.7.0 (core)",
                "@oclif/plugin-which 1.0.3 (core)",
                "@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
                "@salesforce/sfdx-trust 3.6.0 (core)",
                "alias 1.1.10 (core)",
                "apex 0.2.2 (core)",
                "auth 1.7.1 (core)",
                "config 1.2.13 (core)",
                "custom-metadata 1.0.12 (core)",
                "data 0.5.2 (core)",
                "generator 1.1.7 (core)",
                "limits 1.2.1 (core)",
                "org 1.6.7 (core)",
                "salesforce-alm 52.1.0 (core)",
                "schema 1.0.8 (core)",
                "sfdx-cli 7.110.0 (core)",
                "telemetry 1.2.2 (core)",
                "templates 52.1.0 (core)",
                "user 1.3.1 (core)"
        ],
        "osVersion": "Windows_NT 10.0.18363"
}

And @mshanemc, I'm in love with --dev-debug parameter!! Really thanks for!! So that my process stuck in this step:

  sfdx:WebServer DEBUG Starting web server +0ms
  sfdx:WebServer DEBUG Nothing listening on host: localhost port: 1717 - good! +21ms
  sfdx:WebOAuthServer DEBUG OAuth web login service listening on port: 1717 +0ms
  sfdx:WebOAuthServer DEBUG Starting web auth flow +3ms <<<<<<<<<<<<<<<<<<<<<<<<< HERE

Now I'm able to see that port 1717 is not a problem anymore hahaha XD So that part of sfdx on debug:

  @oclif/config config done +26ms
  sfdx                        OS: +0ms
  sfdx                  platform: win32 +1ms
  sfdx              architecture: x64 +0ms
  sfdx                   release: 10.0.18363 +0ms
  sfdx                     shell: cmd.exe +1ms
  sfdx                      NODE: +0ms
  sfdx                   version: 14.17.3 +1ms
  sfdx                       CLI: +0ms
  sfdx                   version: 7.110.0 +0ms
  sfdx                   channel: stable +1ms
  sfdx                       bin: sfdx +0ms
  sfdx                      data: C:\Users\USERLOGIN\AppData\Local\sfdx +1ms
  sfdx                     cache: C:\Users\USERLOGIN\AppData\Local\sfdx +0ms
  sfdx                    config: C:\Users\USERLOGIN\AppData\Local\sfdx +1ms
  sfdx                       ENV: +0ms
  sfdx              NODE_OPTIONS: <not set> +1ms
  sfdx   SFDX_AUTOUPDATE_DISABLE: <not set> +0ms
  sfdx              SFDX_BINPATH: C:\Users\USERLOGIN\AppData\Local\sfdx\client\bin\sfdx +0ms
  sfdx        SFDX_COMPILE_CACHE: <not set> +1ms
  sfdx   SFDX_DISABLE_AUTOUPDATE: <not set> +0ms
  sfdx                  SFDX_ENV: development +0ms
  sfdx            SFDX_INSTALLER: true +0ms
  sfdx    SFDX_LAZY_LOAD_MODULES: true +1ms
  sfdx         SFDX_NPM_REGISTRY: <not set> +0ms
  sfdx           SFDX_REDIRECTED: 1 +1ms
  sfdx              SFDX_S3_HOST: <not set> +0ms
  sfdx  SFDX_UPDATE_INSTRUCTIONS: <not set> +1ms
  sfdx                      ARGS: +2ms
  sfdx                         0: C:\Users\USERLOGIN\AppData\Local\sfdx\client\7.110.0-85b006b\bin\node.exe +0ms
  sfdx                         1: C:\Users\USERLOGIN\AppData\Local\sfdx\client\7.110.0-85b006b\bin\run +1ms
  sfdx                         2: auth:web:login +0ms
  sfdx                         3: --setalias +0ms
  sfdx                         4: alias +0ms
  sfdx                         5: --instanceurl +0ms
  sfdx                         6: https://test.salesforce.com +1ms
  sfdx                         7: --json +0ms
renanlq commented 3 years ago

Hi, as a troubleshoot I'm using the command:

> sfdx auth:device:login -a alias -r https://test.salesforce.com
                                       === Action Required!
Enter XXXXXXXX user code in the verification URL https://test.salesforce.com/setup/connect

But everyone that doesn't know it, keep with this auth issue when using auth:web:login on CLI or Salesforce Extension in VSCode.

mshanemc commented 1 year ago

I'm pretty sure this got fixed with updates to the open library that we use to open browser windows in the various commands. Can you still reproduce the error?

github-actions[bot] commented 1 year ago

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.