Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfdx force:org:delete can't delete a sandbox #1718

Closed
MarcDBehr opened this issue Sep 22, 2022 · 3 comments
Closed

sfdx force:org:delete can't delete a sandbox #1718

MarcDBehr opened this issue Sep 22, 2022 · 3 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@MarcDBehr
Copy link

Summary

The help text for the sfdx force:org:delete command states it can be used to "mark a scratch or sandbox org for deletion", but if you run the command against a sandbox, it fails stating "ERROR running force:org:delete: Unable to associate this scratch org with a DevHub."

Steps To Reproduce:

  1. Create a developer sandbox via the UI
  2. Authenticate with the sandbox using sfdx force:auth:web:login
  3. Wait > 24 hours
  4. run the command sfdx force:org:delete to try to delete the sandbox

Expected result

The sandbox would be deleted (or remove the wording from the help text that says sandboxes can be deleted)

Actual result

Error message "ERROR running force:org:delete: Unable to associate this scratch org with a DevHub." (even if you specify the devhub on the command line

System Information

  • Which shell/terminal are you using? (e.g. bash, zsh, powershell 5, powershell 7, cmd.exe, etc.)

{
"cliVersion": "sfdx-cli/7.168.0",
"architecture": "darwin-x64",
"nodeVersion": "node-v16.13.2",
"pluginVersions": [
"@dx-cli-toolbox/sfdx-toolbox-package-utils 0.8.3 (user)",
"@mshanemc/plugin-streaming 1.1.7 (user)",
"@mshanemc/sfdx-sosl 1.1.0 (user)",
"@oclif/plugin-autocomplete 1.3.0 (user)",
"@oclif/plugin-commands 2.2.0 (core)",
"@oclif/plugin-help 5.1.12 (core)",
"@oclif/plugin-not-found 2.3.1 (core)",
"@oclif/plugin-plugins 2.1.0 (core)",
"@oclif/plugin-update 3.0.0 (core)",
"@oclif/plugin-version 1.1.2 (core)",
"@oclif/plugin-warn-if-update-available 2.0.4 (core)",
"@oclif/plugin-which 2.1.0 (core)",
"alias 2.1.0 (core)",
"apex 1.2.0 (core)",
"auth 2.2.3 (core)",
"community 2.0.1 (core)",
"config 1.4.19 (core)",
"custom-metadata 2.0.0 (core)",
"data 2.1.2 (core)",
"generator 2.0.2 (core)",
"info 2.0.1 (core)",
"limits 2.0.1 (core)",
"org 2.2.0 (core)",
"packaging 1.6.0 (core)",
"schema 2.1.1 (core)",
"signups 1.2.0 (core)",
"source 2.0.13 (core)",
"telemetry 2.0.0 (core)",
"templates 55.1.0 (core)",
"trust 2.0.3 (core)",
"user 2.1.0 (core)",
"@salesforce/sfdx-diff 0.0.6 (user)",
"@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
"bbdoc 4.0.5 (user)",
"salesforce-alm 54.8.1 (core)",
"sfdmu 4.15.5 (user)",
"sfdx-flowdoc-plugin 0.5.1 (user)",
"sfdx-waw-plugin 1.5.0 (user)",
"sfdxdatadicgen 0.1.2 (user)",
"sfpowerkit 5.0.0 (user)",
"shane-sfdx-plugins 4.43.0 (user)"
],
"osVersion": "Darwin 21.6.0",
"shell": "bash",
"rootPath": "/usr/local/lib/node_modules/sfdx-cli"
}

Additional information

That is all!

@MarcDBehr MarcDBehr added the investigating We're actively investigating this issue label Sep 22, 2022
@github-actions
Copy link

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.

@cristiand391 cristiand391 added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Sep 29, 2022
@git2gus
Copy link

git2gus bot commented Sep 29, 2022

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

@cristiand391
Copy link
Member

Unable to associate this scratch org with a DevHub

that error means sfdx didn't detect that org as a sandbox (so defaulted to scratch).

I've narrowed the bug down to this line in the force:org:delete command:
https://github.com/salesforcecli/plugin-org/blob/main/src/commands/force/org/delete.ts#L34

that isSandbox() method relies on a file <ORG-ID>.sandbox.json to be present in ~/.sfdx to detect a sandbox.

When authenticating to a sandbox with force:auth:web:login that file isn't written, the workaround for this is to auth to a sbx using force:org:status.

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants