Skip to content

sf org login web timeout from Ubuntu WSL2 #3641

Description

@geksiong

Summary

sf org login web from Ubuntu inside WSL2 results in a socket timeout.

sf org open launches my browser just fine.

Steps To Reproduce

sf org login web from Ubuntu in WSL2

Expected result

It should launch the Windows browser.

Actual result

Got Error (SOCKET_TIMEOUT): timeout

Additional information

  • I'm aware of Restricted usage of the Salesforce CLI connected app #3368. As far as I can tell sf org login web should not be broken.
  • Authorize Org from VSCode (remote connection to WSL) doesn't work too
  • My existing authorized orgs are working. I just can't add new ones.
  • I think this is important as with agentic coding trending many developers will be working in sandboxed headless environments.

System Information

Ubuntu 24.04 for WSL2
@salesforce/cli/2.150.6 wsl-x64 node-v24.13.1

Activity

  1. github-actions commented on Sep 4, 2026

    @github-actions

    Hello @geksiong 👋 It looks like you didn't include the full Salesforce CLI version information in your issue.
    Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

    A few more things to check:

    • Make sure you've provided detailed steps to reproduce your issue.
      • A repository that clearly demonstrates the bug is ideal.
    • Make sure you've installed the latest version of Salesforce CLI. (docs)
      • Better yet, try the rc or nightly versions. (docs)
    • Try running the doctor command to diagnose common issues.
    • Search GitHub for existing related issues.

    Thank you!

  2. added
    more information requiredIssue requires more information or a response from the customer
    and removed
    investigatingWe're actively investigating this issue
    on Sep 4, 2026
  3. github-actions commented on Sep 4, 2026

    @github-actions

    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.

  4. iowillhoit commented on Sep 8, 2026

    @iowillhoit
    Contributor

    Hey @geksiong, are you only seeing this issue in WSL2?
    Are you able to reproduce this in powershell or command prompt?

    Could you try running your sf org login web command in wsl2 with the --dev-debug flag? I am curious to see exactly where it is hanging.

  5. geksiong commented on Sep 9, 2026

    @geksiong
    Author

    I extracted part of the output below. I could login fine on an Ubuntu desktop with Chrome as my default browser.

    I don't have my development tools on the Windows host - all my development setup is inside WSL2. If I were inside a Linux VM, I would understand login web is not possible I will have to use JWT since there's no GUI. I guess WSL2 is a different kind of environment where integration with programs on the Windows host is possible.

    [10:03:50.126] DEBUG (sf:oclif:Common): loginUrl: https://login.salesforce.com
        tag: "resolveLoginUrl"
    [10:03:50.126] TRACE (sf:oclif:WebOAuthServer): Created 'sf:oclif:WebOAuthServer' child logger instance
    [10:03:50.126] TRACE (sf:oclif): Setup child 'sf:oclif:WebOAuthServer' logger instance
    [10:03:50.126] TRACE (sf:oclif:SfProjectJson): Created 'sf:oclif:SfProjectJson' child logger instance
    [10:03:50.126] TRACE (sf:oclif): Setup child 'sf:oclif:SfProjectJson' logger instance
    [10:03:50.126] TRACE (sf:oclif:WebServer): Created 'sf:oclif:WebServer' child logger instance
    [10:03:50.126] TRACE (sf:oclif): Setup child 'sf:oclif:WebServer' logger instance
    [10:03:50.127] DEBUG (sf:oclif:WebServer): Starting web server
    Error (SOCKET_TIMEOUT): timeout
    
    
    *** Internal Diagnostic ***
    
    SOCKET_TIMEOUT: timeout
        at SfCommandError.from (file:///home/gs/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/SfCommandError.js:48:16)
        at LoginWeb.catch (file:///home/gs/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/sfCommand.js:333:47)
        at LoginWeb._run (/home/gs/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:187:29)
        at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
        at async Config.runCommand (/home/gs/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:389:25)
        at async run (/home/gs/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:97:16)
        at async file:///home/gs/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/bin/run.js:15:1 {
      actions: undefined,
      exitCode: 1,
      context: 'LoginWeb',
      data: undefined,
      cause: undefined,
      status: 1,
      commandName: 'LoginWeb',
      warnings: [],
      result: undefined,
      skipOclifErrorHandling: true,
      oclif: { exit: 1 }
    }
    ******
    
    [10:04:10.136] TRACE (sf:oclif:LoginWebCommand): Created 'sf:oclif:LoginWebCommand' child logger instance
    [10:04:10.136] TRACE (sf:oclif): Setup child 'sf:oclif:LoginWebCommand' logger instance
    [10:04:10.136] DEBUG (sf:oclif:LoginWebCommand): timeout
        err: {
          "type": "SfError",
          "message": "timeout",
          "stack":
              SOCKET_TIMEOUT: timeout
                  at Socket.<anonymous> (/home/gs/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@salesforce/core/lib/webOAuthServer.js:561:31)
                  at Object.onceWrapper (node:events:622:28)
                  at Socket.emit (node:events:508:28)
                  at Socket._onTimeout (node:net:604:8)
                  at listOnTimeout (node:internal/timers:605:17)
                  at process.processTimers (node:internal/timers:541:7)
          "name": "SOCKET_TIMEOUT",
          "exitCode": 1
        }
    [10:04:10.152] TRACE (sf:oclif:perf): Created 'sf:oclif:perf' child logger instance
    [10:04:10.152] DEBUG (sf:oclif:perf): Process Uptime: 21346.5147ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Oclif Time: 20934.5249ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Init Time: 128.2796ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Config Load Time: 16.9736ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   ΓÇó Root Plugin Load Time: 16.3440ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   ΓÇó Plugins Load Time: 0.0244ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   ΓÇó Commands Load Time: 16.2483ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Core Plugin Load Time: 36.4163ms
    [10:04:10.152] DEBUG (sf:oclif:perf): User Plugin Load Time: 19.7441ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Linked Plugin Load Time: 0.0000ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Plugin Load Times:
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-autocomplete: 29.4547ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-commands: 27.9273ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-help: 26.1656ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-plugins: 25.8011ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-not-found: 25.6158ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-apex: 25.4458ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-search: 25.4153ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-update: 24.8586ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-version: 24.5467ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-warn-if-update-available: 24.3010ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-org: 24.2486ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-agent: 23.5009ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-marketplace: 23.3060ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @oclif/plugin-which: 22.9016ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-data: 22.7517ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-deploy-retrieve: 22.5950ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-limits: 22.4891ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-info: 22.4320ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-auth: 22.3734ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-packaging: 21.9039ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-api: 21.7740ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-trust: 21.5353ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-templates: 21.0067ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-user: 20.9736ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-sobject: 20.8835ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-telemetry: 20.4953ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-schema: 20.4116ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-settings: 20.2698ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   sfdx-hardis: 17.2850ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   root: 16.3440ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-code-analyzer: 14.0830ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   sfdmu: 13.5414ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   kc-sf-plugin: 11.4040ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   lightning-flow-scanner: 11.2929ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-signups: 9.9955ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/plugin-community: 8.8841ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   @salesforce/analytics: 8.8604ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Hook Run Times:
    [10:04:10.152] DEBUG (sf:oclif:perf):   init:
    [10:04:10.152] DEBUG (sf:oclif:perf):     total: 98.1777ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     sfdx-hardis(./lib/hooks/init/log): 46.3551ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     @oclif/plugin-update(./dist/hooks/init.js): 48.0589ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     @oclif/plugin-warn-if-update-available(./lib/hooks/init/check-update): 97.7990ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     @salesforce/plugin-settings(./lib/hooks/init/load_config_meta): 81.2548ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     sfdx-hardis(./lib/hooks/init/check-upgrade): 9.0552ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     sfdx-hardis(./lib/hooks/init/start-ws-client): 25.6638ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   prerun:
    [10:04:10.152] DEBUG (sf:oclif:perf):     total: 25.6011ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     @salesforce/cli(./dist/hooks/prerun): 6.3822ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     sfdx-hardis(./lib/hooks/prerun/auth): 6.3542ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     @salesforce/plugin-telemetry(./lib/hooks/telemetryPrerun): 25.4678ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     sfdx-hardis(./lib/hooks/prerun/check-dependencies): 3.4839ms
    [10:04:10.152] DEBUG (sf:oclif:perf):   preparse:
    [10:04:10.152] DEBUG (sf:oclif:perf):     total: 2.4706ms
    [10:04:10.152] DEBUG (sf:oclif:perf):     @salesforce/cli(/dist/hooks/preparse): 2.4119ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Command Load Time: 0.0000ms
    [10:04:10.152] DEBUG (sf:oclif:perf): Command Run Time: 20806.5523ms
    [10:04:10.153] DEBUG (sf:oclif:config): start finally hook
    [10:04:10.153] DEBUG (sf:oclif:config:ts-path): Skipping typescript path lookup for /home/gs/.local/share/sf/node_modules/sfdx-hardis because NODE_ENV is NOT "test" or "development"
    [10:04:10.156] TRACE (sf:oclif:sfdx-hardis:hooks:finally): Created 'sf:oclif:sfdx-hardis:hooks:finally' child logger instance
    [10:04:10.156] DEBUG (sf:oclif:sfdx-hardis:hooks:finally): start (import) /home/gs/.local/share/sf/node_modules/sfdx-hardis/lib/hooks/finally/notify.js
    [10:04:10.156] DEBUG (sf:oclif:sfdx-hardis:hooks:finally): done
    [10:04:10.156] DEBUG (sf:oclif:config): finally hook done
    [10:04:10.157] ERROR (sf:oclif): SOCKET_TIMEOUT: timeout
        at SfCommandError.from (file://~/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/SfCommandError.js:48:16)
        at LoginWeb.catch (file://~/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/sfCommand.js:333:47)
        at LoginWeb._run (~/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:187:29)
        at async Config.runCommand (~/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:389:25)
        at async run (~/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:97:16)
        at async file://~/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/bin/run.js:15:1
      sf:telemetry Spawning "/home/gs/.nvm/versions/node/v24.13.1/bin/node /home/gs/.nvm/versions/node/v24.13.1/lib/node_modules/@salesforce/cli/node_modules/@salesforce/plugin-telemetry/processes/upload.js /home/gs/.cache/sf /tmp/sf-telemetry/telemetry-1440feaf90805514eb7117592c0f05061e7dccce.log" +20s
    
    
  6. github-actions commented on Sep 17, 2026

    @github-actions

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

  7. geksiong commented on Sep 22, 2026

    @geksiong
    Author

    Hi just wondering if there are any updates regarding this?

  8. github-actions commented on Sep 30, 2026

    @github-actions

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

  9. guillaume-dore commented on Oct 8, 2026

    @guillaume-dore

    @geksiong I've got the same issue as yours recently, i managed to get it work with a workaround.

    • First be sure to have wslu installed on your wsl distro.

    • The next step is to disable networkingMode mirrored mode and go back to default NAT mecanism.

    Open the configuration file: %USERPROFILE%/.wslconfig and comment or remove networkingMode and hostAddressLoopback changes.
    then wsl --shutdown in powershell and rerun with wsl .

    the sf org login web flow should work back as expected opening the windows Browser.
    Once the org reauthenticated you can restore your wsl configurations back.

  10. geksiong commented on Oct 9, 2026

    @geksiong
    Author

    @guillaume-dore Thanks, that worked perfectly! I must've switched to WSL mirrored mode previously somehow. The default NAT mode seems to work well, I'll probably keep it at NAT mode.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    more information requiredIssue requires more information or a response from the customerstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions