Getting an "Only absolute URLs" error while trying to open Salesforce org with sfdx:open in VS Code
Asked Answered
S

6

5

Warning: Deprecated environment variable: SFDX_JSON_TO_STDOUT. Please use SF_JSON_TO_STDOUT instead. (Use node --trace-warnings ... to show where the warning was created) Warning: The "force org open" command has been deprecated. Use "org open" instead. Error (1): Only absolute URLs are supported 14:52:35.666 sfdx force:org:open ended with exit code 1 While using sfdx:open default org in the VS code I am getting the above error please help me out of this?

Trying to open my default salesforce development org but failed to do so.

Subtenant answered 1/6, 2023 at 9:52 Comment(1)
I upvote your question, however it is more for the salesforce.stackexchange.comHypochromia
C
6

None of those solution worked for me. I suspect that migration from enhanced domain caused the issue. To solve the issue, I log out from vs code using the following sfdx command :

sfdx auth:logout

Then after that , I reauthenticate to my org. Then after that I had to close my vs code and restart it. If I do not close my vs code , the error where persisting. After that, It worked well.

Clachan answered 18/7, 2023 at 13:22 Comment(0)
N
4

I did the same thing, just try this command:

sfdx org:login:web --instance-url [your url]

You can find the correct url by clicking on View Profile button (top right) as in the following figure:

enter image description here

Nutmeg answered 5/7, 2023 at 12:24 Comment(2)
This one worked for me. Does anyone knows why it has stopped working in the new sfdx cli, which now falls back to the 'sf-cli'. For some SF-Orgs it works as expected, but for others it doesn't? Does change in the password might affect that?Hypochromia
It also worked to me. It looks like the default command of login used via VS Code brings this bug for some sandboxes. Others sandboxes, it didn't happen to me. very weird! THIS WAY CAUSES ERROR sfdx force:auth:web:login --setalias ALIAS_NAME --instanceurl test.salesforce.com --setdefaultusernameTernopol
G
2

Try to reauthorize the org. Use the following command on the terminal:

sfdx org:login:web --instance-url [your url]

do not add 'www' should just be https://yourdomain.salesforce.com

Grosberg answered 7/6, 2023 at 21:25 Comment(0)
J
1

Running the usual, "SFDX: Authorize an Org", command from the VsCode Command Palette, then closing and re-opening Vscode fixes this issue.

Judicator answered 15/8, 2023 at 16:51 Comment(0)
H
0

I tried updating sfdx-project.json file and it worked: Old:

{
  "packageDirectories": [
    { 
    "path": "force-app"
    }
  ],
  "name": "SelfMainOrg",
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "57.0"
}

New:

{
  "packageDirectories": [
    { "path": "force-app", "default": true },
     
    { "path" : "manifest" }
  ],
  "name": "SelfMainOrg",
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "57.0"
}

In Summary I added path for Manifest. Technically as I was retrieving or deploying a Single file by selecting it and clicking on "Deploy Source to Org", adding Manifest path is irrelevant. But somehow it did work for me.

Hoisch answered 29/6, 2023 at 8:55 Comment(0)
T
0

I recently installed sf and removed sfdx and I was having the same problem. Here is how I solved it:

Delete the alias that wasn't working with this command:

sf org logout --target-org [alias] --no-prompt

Then I authorized an Org but not with commands, that way it didn't work out for me, I had to do it with clicks:

  1. Ctrl + Shift + P
  2. SFDX: Authorize an Org
  3. Select Custom enter image description here
  4. Add the enhanced URL with this format: https://mycompany--dev.sandbox.my.salesforce.com enter image description here
Tarentarentum answered 30/8, 2023 at 11:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.