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

Scratch Orgs Deleted via CLI Remain Active in Dev Hub #1155

Closed
keirbowden opened this issue Aug 27, 2021 · 6 comments
Closed

Scratch Orgs Deleted via CLI Remain Active in Dev Hub #1155

keirbowden opened this issue Aug 27, 2021 · 6 comments
Assignees
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@keirbowden
Copy link

Summary

My Continuous Integration jobs involving scratch orgs have started failing since I upgraded to the latest Salesforce CLI. I use a Developer Edition for this and it turned out that the maximum number of scratch orgs were consumed, even though I delete the previous day's scratch org before starting each CI job. Running this directly from the command line I found that although the CLI reports that the scratch org has been deleted successfully, the Active Scratch Org record remains and the Scratch Org Infos record shows it as still active with no deleted information. In case this was a local issue I created a new connected app, then set the whole thing up again with a new developer edition acting as the Dev Hub and saw the same thing. Deleting the records manually allowed me to create more scratch orgs, up to the daily limit.

I've now tried this on my production org, which is our company's dev hub, and I see the same thing. I delete a scratch org which the CLI indicates was successful, but the Active Scratch Orgs record is still there, and the Scratch Org Infos record shows the org as still active with the Deleted Date and Deleted By fields empty.

Steps To Reproduce:

  1. Create a scratch org using sfdx force:org:create and locate the records in the dev hub
  2. Delete the scratch org using sfdx force:org:delete, the records are unchanged and have to be manually removed to free up the scratch org allowance.

Expected result

The Active Scratch Orgs record in the Dev Hub should be deleted when the scratch org is deleted via the CLI.

Actual result

The CLI reports success, but the records are unaffected.

System Information

$ sfdx version --verbose --json
{
"cliVersion": "sfdx-cli/7.115.1",
"architecture": "darwin-x64",
"nodeVersion": "node-v14.17.5",
"pluginVersions": [
"@brightgen/bmsfdx 1.6.0",
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.2.2 (core)",
"@oclif/plugin-not-found 1.2.4 (core)",
"@oclif/plugin-plugins 1.10.1 (core)",
"@oclif/plugin-update 1.4.0-3 (core)",
"@oclif/plugin-warn-if-update-available 1.7.0 (core)",
"@oclif/plugin-which 1.0.3 (core)",
"@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
"@salesforce/sfdx-scanner 2.11.0",
"@salesforce/sfdx-trust 3.6.0 (core)",
"alias 1.1.10 (core)",
"apex 0.2.7 (core)",
"auth 1.7.1 (core)",
"bbbookmarks 1.0.1",
"bbdoc 3.6.1",
"bbpdf 1.0.1",
"bbsfdx 1.4.1",
"config 1.2.24 (core)",
"custom-metadata 1.0.12 (core)",
"data 0.6.0 (core)",
"generator 1.1.7 (core)",
"limitlog 1.0.0",
"limits 1.2.1 (core)",
"org 1.7.0 (core)",
"salesforce-alm 52.2.6 (core)",
"schema 1.0.8 (core)",
"sfdx-cli 7.115.1 (core)",
"source 1.0.10 (core)",
"telemetry 1.2.3 (core)",
"templates 52.1.0 (core)",
"user 1.4.0 (core)"
],
"osVersion": "Darwin 20.6.0"
}

Additional information

Feel free to attach a screenshot.

@keirbowden keirbowden added the investigating We're actively investigating this issue label Aug 27, 2021
@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.

@azlam-abdulsalam
Copy link

I have also seen another variant, where I get a deleted scratch org upon creation

@chfosli
Copy link

chfosli commented Aug 31, 2021

We experience the same. We have a lot of CI/CD scripts in GitHub Actions where we create scratch orgs. The last step we have is to delete the scratch org. Seems to be deleted fine, but it is not removed from Active Scratch Org List, and count against the limit.

Run sfdx force:org:delete -p -u scratch-org
Successfully marked scratch org scratch-org for deletion

@mshanemc
Copy link
Contributor

I think I figured out what's causing this one.

@mshanemc mshanemc added the bug Issue or pull request that identifies or fixes a bug label Sep 23, 2021
@uip-robot-zz
Copy link

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

@iowillhoit iowillhoit self-assigned this Sep 30, 2021
@iowillhoit
Copy link
Contributor

Fix has been merged and will be in this week's release candidate (later today barring issues). See this doc for directions on installing the rc.

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

6 participants