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 and org:delete:scratch lost flag to specify the devhub #1925

Closed
bdovh opened this issue Feb 10, 2023 · 9 comments
Closed
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@bdovh
Copy link

bdovh commented Feb 10, 2023

Summary

The new version of SFDX CLI has broken the sfdx force:org:delete command

Steps To Reproduce:

  1. Assume you have existing CI workflow, which was working just fine recent two years.
  2. Suddenly it starts failing with an error:
sfdx force:org:delete -v sodh -p
  shell: /usr/bin/bash -e {0}
Warning: The force:org:delete command is deprecated. Use org:delete:scratch or org:delete:sandbox.
Error: Nonexistent flag: -v
See more help with --help
  1. All it has is it tries to fetch the latest SFDX CLI and just delete the org after completion of CI step.

Expected result

Expect existing CI workflows not to be broken by SFDX CLI updates.

Actual result

Actually it is broken.

System Information

Version of SFDX CLI is: sfdx-cli/7.187.1 linux-x64 node-v16.19.0

Additional information

 sfdx force:org:delete -v sodh -p
  shell: /usr/bin/bash -e {0}
Warning: The force:org:delete command is deprecated. Use org:delete:scratch or org:delete:sandbox.
Error: Nonexistent flag: -v
See more help with --help
@bdovh bdovh added the investigating We're actively investigating this issue label Feb 10, 2023
@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.

@bdovh
Copy link
Author

bdovh commented Feb 10, 2023

Screenshot 2023-02-10 at 17 03 55

Screenshot 2023-02-10 at 17 04 00

@mshanemc
Copy link
Contributor

We didn't mean to break that. Sorry!

It may have been working, but only accidentally. You're not deleting a dev hub, you're deleting an org.

Use -o or -u instead to specify the scratch org alias/username (or in your case, it looks like you're maybe deleting the project's default org, so the hub is unnecessary information).

@bdovh
Copy link
Author

bdovh commented Feb 10, 2023

@mshanemc the problem is default devhub is used for package versions, but another one is used for scratch org.
So if default devhub is different than devhub from which scratch org has been created, will it fail?

Or would I have to switch between active devhubs each time I need to delete a scratch org?

@mshanemc
Copy link
Contributor

mshanemc commented Feb 10, 2023

If you're authenticated to the scratch org, you can delete it. The process goes something like,

you: please delete org X
cli: (finds that org in local authentications)
cli: (looks to see which hub it belongs to)
cli: "hey hub, delete org X"
hub: (marks it for deletion)
cli: (deletes it from local auth files)
cli: "ok, done!"

@bdovh
Copy link
Author

bdovh commented Feb 10, 2023

I received some new error

Warning: This command is currently in beta. Any aspect of this command can change without advanced notice. Don't use beta commands in your scripts.
Error (1): Target file doesn't exist. path: /home/runner/.sfdx/[email protected]

is this error expected to happen?

@mshanemc
Copy link
Contributor

can you share the command that's causing that error?

@bdovh
Copy link
Author

bdovh commented Feb 13, 2023

can you share the command that's causing that error?

not sure, it is hard to detect. maybe sfdx org:delete:scratch?

This error started when I replaced sfdx force:org:delete with sfdx org:delete:scratch command

@mshanemc mshanemc added the bug Issue or pull request that identifies or fixes a bug label Feb 17, 2023
@git2gus
Copy link

git2gus bot commented Feb 17, 2023

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

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 investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

3 participants