7

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?

2 Answers 2

6

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.

12
  • 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
    Commented Dec 15, 2018 at 14:01
  • @KeithC You're welcome! Believe me, we've all misread an error at some point in our lives ☺.
    – sfdcfox
    Commented Dec 15, 2018 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
    Commented Dec 15, 2018 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
    Commented Dec 15, 2018 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
    Commented Dec 15, 2018 at 14:23
10

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 [email protected]

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 [email protected]
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 [email protected]
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).

4
  • 1
    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
    Commented Dec 29, 2018 at 10:27
  • @KeithC, by any chance, did you get these shown? Would love to see how. Commented Apr 25, 2022 at 21:05
  • 1
    Hi @David Reed, is there a way to know at what time in the day the limit will be reset ? Otherwise, is it possible to get (via SFDX) the datetime those last orgs were created ?
    – altius_rup
    Commented Sep 13, 2022 at 12:56
  • "Rolling" seems to be confirmed here by a Salesforce engineer: youtu.be/UQMn2rzJdjM?t=856 Commented Oct 5, 2022 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .