5

This Scratch Orgs page talks about "how many scratch orgs you can create daily" and I just ran into this error:

LIMIT_EXCEEDED: The signup request failed because this organization has reached its active scratch org limit

at 1pm GMT after creating just a few scratch orgs.

Does anyone know what "daily" means here e.g. is it a rolling window or based on a particular timezone day?

5

You apparently misread the error. You've actually reached your active limit, not the daily limit. You would need to delete at least one scratch org before creating another. They don't specify if the daily limit is reset at midnight or rolling, but in your case, it doesn't matter, you simply have too many active scratch orgs in your dev hub. It's ordinarily "impossible" to reach the daily limit, since the active limit is half the daily limit; you would need to delete all the orgs and create them again before you'd risk hitting the daily limit anyways.

  • Thanks! You are right I didn't read the message carefully enough. I just went into the dev hub and found 150 active orgs which is our active limit. – Keith C Dec 15 '18 at 14:01
  • @KeithC You're welcome! Believe me, we've all misread an error at some point in our lives ☺. – sfdcfox Dec 15 '18 at 14:03
  • On the daily limit, we are now running Jenkins multibranch pipelines that create scrratch orgs for our managed package builds. With branches and pull requests building, we may hit the daily limit at some point too. – Keith C Dec 15 '18 at 14:04
  • @KeithC Well, maybe, but you'd still have to be deleting and recreating scratch orgs at double the active limit. It's pretty rare to be able to hit that limit, especially since a proper CI wouldn't recreate the org each time, just deploy changes. It's a lot easier to just redeploy changes every time. At least, that's how I'd do it. – sfdcfox Dec 15 '18 at 14:07
  • Yeah we have talked about "recycling" orgs but creating/deleting from Jenkins seemed like the simplest approach. The dominant time taken in our builds remains the unit tests, and getting those to run in parallel on scratch orgs is proving difficult. – Keith C Dec 15 '18 at 14:23
1

I wanted to know the answer to the question as asked, even though it wasn't the true issue, so I did a quick experiment.

For background, my Dev Hub is a standard Developer Edition for working on personal and open source Salesforce DX projects. It's far, far easier to hit limits in a Developer Edition, where the Daily Scratch Org limit is 6 and the Active Scratch Org limit is just 3. In particular, running CI jobs that spawn and delete scratch orgs will devour the daily limit in, well, six pushes or fewer per day.

I recorded my limits as of 6 pm on 12/27:

$ sfdx force:limits:api:display -u david@ktema.org

NAME                                  REMAINING  MAXIMUM
────────────────────────────────────  ─────────  ─────────
ActiveScratchOrgs                     1          3
DailyScratchOrgs                      6          6

Then created and deleted a new scratch org, validating that DailyScratchOrgs ticks to 5 after the operation.

At 8 am the following day:

$ sfdx force:limits:api:display -u david@ktema.org
NAME                                  REMAINING  MAXIMUM
────────────────────────────────────  ─────────  ─────────
ActiveScratchOrgs                     1          3
DailyScratchOrgs                      5          6

so the limit does not reset at midnight EST.

At 7 pm the following day, 12/28, the limit has reset.

$ sfdx force:limits:api:display -u david@ktema.org
NAME                                  REMAINING  MAXIMUM
────────────────────────────────────  ─────────  ─────────
ActiveScratchOrgs                     1          3
DailyScratchOrgs                      6          6

So, daily scratch orgs is indeed a rolling 24 hour window. (Note that one active scratch org was created before and lived through this two-day observation period).

  • Thanks for this - helpful to know. One of my colleagues is aiming to get these numbers shown in a Jenkins build monitor as hitting the active limit is going to be a constant risk for us. – Keith C Dec 29 '18 at 10:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.