Skip to content

sf org login web does not work when SF_CONTAINER_MODE is set to true #3415

@mhemani-reach

Description

@mhemani-reach

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

I am trying to use sf org login web in the salesforce/cli:latest-slim container; the following environment variables are set SF_CONTAINER_MODE=true && SFDX_CONTAINER_MODE=true. This is documented here to ensure that url is outputted, rather than opening the browser, for the org open or org login web commands. Instead it errors with the following: "Error (SfError): "<%= config.bin %> <%= command.id %>" not supported when authorizing to a headless environment. Use another OAuth flow (e.g., JWT Bearer Flow)."

Steps To Reproduce

  • Run the container docker run --rm -it salesforce/cli:latest-slim
  • Inside the containerl shell, run echo $SF_CONTAINER_MODE and echo $SFDX_CONTAINER_MODE and observe that the values are set to true
  • Inside the container shell, run sf org login web

Expected result

URL should have been outputted to the console as documented in the linked docs

Actual result

Error message: "Error (SfError): "<%= config.bin %> <%= command.id %>" not supported when authorizing to a headless environment. Use another OAuth flow (e.g., JWT Bearer Flow)."

Additional information

System Information

{
  "architecture": "linux-x64",
  "cliVersion": "@salesforce/cli/2.108.6",
  "nodeVersion": "node-v22.19.0",
  "osVersion": "Linux 6.10.14-linuxkit",
  "rootPath": "/usr/local/sf",
  "shell": "bash",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.35 (core)",
    "@oclif/plugin-commands 4.1.33 (core)",
    "@oclif/plugin-help 6.2.33 (core)",
    "@oclif/plugin-not-found 3.2.68 (core)",
    "@oclif/plugin-plugins 5.4.47 (core)",
    "@oclif/plugin-search 1.2.31 (core)",
    "@oclif/plugin-update 4.7.7 (core)",
    "@oclif/plugin-version 2.2.33 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.48 (core)",
    "@oclif/plugin-which 3.2.40 (core)",
    "@salesforce/cli 2.108.6 (core)",
    "agent 1.24.13 (core)",
    "apex 3.8.1 (core)",
    "api 1.3.3 (core)",
    "auth 3.9.8 (core)",
    "data 4.0.57 (core)",
    "deploy-retrieve 3.23.3 (core)",
    "info 3.4.88 (core)",
    "limits 3.3.67 (core)",
    "marketplace 1.3.8 (core)",
    "org 5.9.30 (core)",
    "packaging 2.20.5 (core)",
    "schema 3.3.82 (core)",
    "settings 2.4.48 (core)",
    "sobject 1.4.73 (core)",
    "telemetry 3.6.57 (core)",
    "templates 56.3.65 (core)",
    "trust 3.7.113 (core)",
    "user 3.6.38 (core)"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue or pull request that identifies or fixes a buginvestigatingWe're actively investigating this issuevalidatedVersion information for this issue has been validated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions