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
493 stars 78 forks source link

Failed to login to instance with "lightning" word in instance name #2241

Closed Jojolam44 closed 1 year ago

Jojolam44 commented 1 year ago

Summary

When our company migrated from classic to lightning, we created a new instance with the "-lightning" keyword in it. We can't login with sfdx-cli because it trigger the "lightning domain" URL check error.

Steps To Reproduce

sfdx org:login:web --instance-url="https://mycompanyname-lightning.my.salesforce.com"

Expected result

Allow to login sfdx-cli to our instance

Actual result

$ sfdx org:login:web --instance-url="https://mycompany-lightning.my.salesforce.com" Error (1): Invalid instance URL. It should NOT be a lightning domain.

Try this:

If you specify an --instance-url value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file.

To specify a My Domain URL, use the format https://yourcompanyname.my.salesforce.com.

To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.

System Information

Shell used : bash for windows

{
  "cliVersion": "sfdx-cli/7.205.6",
  "architecture": "win32-x64",
  "nodeVersion": "node-v18.12.1",
  "osVersion": "Windows_NT 10.0.19045",
  "shell": "C:\\Users\\myuser\\AppData\\Local\\Programs\\Git\\usr\\bin\\bash.exe",
  "rootPath": "C:\\Users\\myuser\\AppData\\Roaming\\node\\node_modules\\sfdx-cli",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.0 (core)",
    "@oclif/plugin-commands 2.2.15 (core)",
    "@oclif/plugin-help 5.2.9 (core)",
    "@oclif/plugin-not-found 2.3.24 (core)",
    "@oclif/plugin-plugins 3.1.2 (core)",
    "@oclif/plugin-search 0.0.17 (core)",
    "@oclif/plugin-update 3.1.17 (core)",
    "@oclif/plugin-version 1.3.4 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.37 (core)",
    "@oclif/plugin-which 2.2.22 (core)",
    "apex 2.3.3 (core)",
    "auth 2.8.1 (core)",
    "community 2.3.1 (core)",
    "custom-metadata 2.1.25 (core)",
    "data 2.3.22 (core)",
    "deploy-retrieve 1.11.7 (core)",
    "info 2.6.19 (core)",
    "limits 2.3.18 (core)",
    "org 2.9.8 (core)",
    "packaging 1.19.0 (core)",
    "schema 2.3.12 (core)",
    "settings 1.4.11 (core)",
    "signups 1.4.21 (core)",
    "source 2.10.14 (core)",
    "telemetry 2.2.0 (core)",
    "templates 55.4.20 (core)",
    "trust 2.4.20 (core)",
    "user 2.3.17 (core)",
    "sfdmu 4.28.0 (user)",
    "sfdx-cli 7.205.6 (core)",
    "sfdx-essentials 2.12.0 (user)",
    "sfdx-git-delta 5.22.0 (user)",
    "sfdx-hardis 3.18.1 (user)",
    "sfpowerkit 4.2.13 (user)",
    "texei-sfdx-plugin 1.17.3 (user)"
  ]
}

Additional information

github-actions[bot] commented 1 year 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.

git2gus[bot] commented 1 year ago

This issue has been linked to a new work item: W-13639832

WillieRuemmele commented 1 year ago

Hi @Jojolam44 - I just confirmed the fixed, this will be availble in the nightly build tonight, latest-rc on wed/thurs and latest in 2 weeks

shetzel commented 1 year ago

Closing this as it's fixed in latest releases

tecfu commented 1 year ago

@shetzel Can you please state which version has been tested for a fix?

I am seeing this issue in the following env:

@salesforce/cli/2.13.9 linux-x64 node-v18.15.0

Given:

shetzel commented 1 year ago

@tecfu - you're using a lightning domain, which is different from the OP in this issue, and should not be used as the instance-url. As part of the error message (in your case in the JSON) it should state:

Error (1): Invalid instance URL. It should NOT be a lightning domain.

Try this:

If you specify an --instance-url value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file.

To specify a My Domain URL, use the format https://yourcompanyname.my.salesforce.com/.

To specify a sandbox, set --instance-url to https://mydomainname--sandboxname.sandbox.my.salesforce.com/.